原报错提示为:
VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order)
这是由于数组维度不一样导致的,不能直接简单附加在后面
解决方案:使用extend函数进行合并
false:sum.append(q)
修改后:sum.extend(q)
版权声明:本文为qq_43544934原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。