im not trying to do this smart or fast, just trying to do it at all.
i have a file looks like this :
$ cat all_user_token_counts.csv @5raphaels,in,
This can be done easily with np.loadtxt:
import numpy as np arr=np.loadtxt('all_user_token_counts.csv',delimiter=',', dtype = '|U10,<U10,int') print(arr) # [(u'@5raphaels', u'in', 15) (u'@5raphaels', u'for', 15) # (u'@5raphaels', u'unless', 11) (u'@5raphaels', u'you', 11)]