I would like to load a big text file (around 1 GB with 3*10^6 rows and 10 - 100 columns) as a 2D np-array containing strings. However, it seems like numpy.loadtxt() onl
Use genfromtxt instead. It's a much more general method than loadtxt:
import numpy as np
print np.genfromtxt('col.txt',dtype='str')
Using the file col.txt:
foo bar
cat dog
man wine
This gives:
[['foo' 'bar']
['cat' 'dog']
['man' 'wine']]
If you expect that each row has the same number of columns, read the first row and set the attribute filling_values to fix any missing rows.