I obtained a NumPy record ndarray
from a CSV file using
data = matplotlib.mlab.csv2rec('./data.csv', delimiter=b',')
The data set is structured as:
date,a0,a1,a2,a3, b0, b1, b2, b3,[...], b9
2012-01-01, 1, 2, 3, 4,0.1,0.2,0.3,0.4,[...],0.9
I want to select (in the SQL sense) just columns b0
through b9
from the array, giving the structure
b0, b1, b2, b3,[...], b9
0.1,0.2,0.3,0.4,[...],0.9
The question "How can I use numpy array indexing to select 2 columns out of a 2D array to select unique values from?" is similar, but slicing data[:,5:]
as suggested throws IndexError: too many indices
with a record array.