I want to convert the array A containing string elements to list. But I am running into error while using split(). I present the expected output.
import numpy as np
from numpy import nan
A=np.array(['[1]', '[2]', '[3]', '[4]', '[5]'])
A.split()
print(A)
The error is
in <module>
A.split()
AttributeError: 'list' object has no attribute 'split'
The expected output is
array([[1], [2], [3], [4], [5]])
A = np.array([eval(e) for e in A])splitmethod, not a list!