How to save a list as numpy array in python?

前端 未结 9 930
心在旅途
心在旅途 2020-12-04 08:27

Is possible to construct a NumPy array from a python list?

9条回答
  •  天涯浪人
    2020-12-04 08:58

    maybe:

    import numpy as np
    a=[[1,1],[2,2]]
    b=np.asarray(a)
    print(type(b))
    

    output:

    
    

提交回复
热议问题