当前位置:   article > 正文

解决多维数组合并报错:VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences_creating an ndarray from ragged nested sequences (

creating an ndarray from ragged nested sequences (which is a list-or-tuple o

原报错提示为:

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)
  • 1
  • 2

这是由于数组维度不一样导致的,不能直接简单附加在后面
解决方案:使用extend函数进行合并
false:sum.append(q)
修改后:sum.extend(q)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/611148
推荐阅读
相关标签
  

闽ICP备14008679号