a1=[1,2,3,4,5,6] b1=[[1,2,3], [4,5,6]]
如果使用np.shapelista1将返回(6,)并且b1将返回(2, 3).
np.shape
a1
(6,)
b1
(2, 3)
如果禁止使用 Numpy,我如何获得 list 的形状a1?
我主要对如何让python程序知道a1只有一维感到困惑。有什么好的方法吗?
python python-3.x
python ×1
python-3.x ×1