I have a string of data data = "1,Hey,234,4456,789" that I want to convert into a numpy array. Whenever I try the code numpy.fromstring(data,dtype=str,sep=","), I get the error "ValueError: zero-valued itemsize". What is the correct way to use this function so that it works as intended? The output I am trying to get is np.array(['1','Hey','234','4456','789']). Thanks!
Add a comment
|