标签: python numpy numpy-ndarray string-literals
我有一个numpy数组的字符串表示形式。如何从这种格式转换为数组数组?
答案 0 :(得分:0)
使用eval是最好的解决方案
import numpy as np a = "np.array([[1,2],[2,3]])" a = eval(a)