I'm running genfromtxt
like below:
date_conv = lambda x: str(x).replace(":", "/")
time_conv = lambda x: str(x)
a = np.genfromtxt(input.txt, delimiter=',', skip_header=4,
usecols=[0, 1] + radii_indices, converters={0: date_conv, 1: time_conv})
Where input.txt
is from this gist.
When I look at the results, it is a 1D array not a 2D array:
>>> np.shape(a)
(918,)
It seems to be an array of tuples instead:
>>> a[0]
('06/03/2006', '08:27:23', 6.4e-05, 0.000336, 0.001168, 0.002716, 0.004274, 0.004658, 0.003756, 0.002697, 0.002257, 0.002566, 0.003522, 0.004471, 0.00492, 0.005602, 0.006956, 0.008442, 0.008784, 0.006976, 0.003917, 0.001494, 0.000379, 6.4e-05)
If I remove the converters specification from the genfromtxt
call it works fine and produces a 2D array:
>>> np.shape(a)
(918, 24)