I'd like to perform some dimension-reduction (DR) methods such as PCA, ICA and tSNE, maybe LEM on the a data set data.txt to compare the methods.
Therefore, I need to read in the data as a numpy.ndarray. Every line corresponds to a row in the matrix, with delimiter = ' '.
Alternatively, I have the file as a numpy.array now but as a string:
[ '16.72083152\t12.91868366\t14.37818919\n' ... '16.9504402\t7.81951173\t12.81342726']
How can I convert this quickly into a numpy.array of the desired format: n x 3, delimiter for rows = ' ', delimiter between elements in each row = '\t' chopping the '\n' at the end?
A quick answer much appreciated. Other tips as well. Thanks!