Is there any way to turn a list of strings into a numpy.ndarray?. Because I tried this code:
All = np.ndarray([str(necessary_lines).split(',')])
Which gives this error:
Traceback (most recent call last):
File "/Users/username/Desktop/Coding/Python/somePythonProgram.py", line 47, in <module>
print(parseCSV(file))
File "/Users/username/Desktop/Coding/Python/somePythonProgram.py", line 34, in somePythonProgram
All = np.ndarray([str(necessary_lines).split(',')])
TypeError: 'list' object cannot be interpreted as an integer
Or is it that you can't turn a list of strings into a numpy array?
necessary_lines?[,]in[str(necessary_lines).split(',')]?.split()already returns a list, you don't need to stick it into another. In any event, please provide a minimal reproducible example. We shouldn't need to guess about what your data is.