AttributeError: 'numpy.ndarray' object has no attribute 'append' python报错

出错如图:

AttributeError: 'numpy.ndarray' object has no attribute 'append' python报错_第1张图片

数组不支持append,那么解决办法就是等得到了完整的list再统一转为数组:

AttributeError: 'numpy.ndarray' object has no attribute 'append' python报错_第2张图片

顺便对比一下extend:

AttributeError: 'numpy.ndarray' object has no attribute 'append' python报错_第3张图片

你可能感兴趣的:(报错解决)