You are probably better off using np.genfromtxtfor text files; np.fromfilebetter for binary files.
This gives a string array from which you initially seemed to be going to:
>>> np.genfromtxt('tmp.txt', dtype=str)
array([['1', 'Hydrogen', '1.008'],
['2', 'Helium', '4.002602'],
['3', 'Lithium', '6.94'],
['4', 'Beryllium', '9.0121831'],
['5', 'Boron', '10.81'],
['6', 'Carbon', '12.011']],
dtype='|S9')
dtype:
>>> np.genfromtxt('tmp.txt', dtype=None)
array([(1, 'Hydrogen', 1.008), (2, 'Helium', 4.002602),
(3, 'Lithium', 6.94), (4, 'Beryllium', 9.0121831),
(5, 'Boron', 10.81), (6, 'Carbon', 12.011)],
dtype=[('f0', '<i8'), ('f1', 'S9'), ('f2', '<f8')])
, , unpack, :
>>> n, name, mass = np.genfromtxt('tmp.txt', dtype='S', unpack=True)
>>> n = n.astype(int)
>>> mass = mass.astype(float)