I am getting recarray from matplotlib.mlab.csv2rec function. My expectation was it would have 2 dimensions like 'x', but it has 1 dimension like 'y'. Is there any way to get x from y?
>>> import numpy as np
>>> from datetime import date
>>> x=np.array([(date(2000,1,1),0,1),
... (date(2000,1,1),1,1),
... (date(2000,1,1),1,0),
... (date(2000,1,1),0,0),
... ])
>>> x
array([[2000-01-01, 0, 1],
[2000-01-01, 1, 1],
[2000-01-01, 1, 0],
[2000-01-01, 0, 0]], dtype=object)
>>> y = np.rec.fromrecords( x )
>>> y
rec.array([(datetime.date(2000, 1, 1), 0, 1),
(datetime.date(2000, 1, 1), 1, 1),
(datetime.date(2000, 1, 1), 1, 0), (datetime.date(2000, 1, 1), 0, 0)],
dtype=[('f0', '|O4'), ('f1', '<i4'), ('f2', '<i4')])
>>> x.ndim
2
>>> y.ndim
1
>>> x.shape
(4, 3)
>>> y.ndim
1
>>> y.shape
(4,)
>>>