当我使用检查数组的形状numpy.shape(),我有时候会(length,1),有时候(length,).看起来差异是列与行向量...但似乎并没有改变关于数组本身的任何内容[除了一些函数在我传递带有形状的数组时抱怨(length,1)].
numpy.shape()
(length,1)
(length,)
这两者有什么区别? 为什么不是形状,(length)?
(length)
python arrays math numpy
arrays ×1
math ×1
numpy ×1
python ×1