'list' object has no attribute 'shape'

后端 未结 7 772
执笔经年
执笔经年 2020-12-07 22:13

how to create an array to numpy array?

def test(X, N):
    [n,T] = X.shape
    print \"n : \", n
    print \"T : \", T



if __name__==\"__main__\":

    X =         


        
相关标签:
7条回答
  • 2020-12-07 22:54

    Alternatively, you can use np.shape(...)

    For instance:

    import numpy as np

    a=[1,2,3]

    and np.shape(a) will give an output of (3,)

    0 讨论(0)
提交回复
热议问题