Let's say I have some simple data
y = [[datetime.datetime( 2012,1,1,1,1), 2.1],
[datetime.datetime( 2012,1,1,1,2), -3.1],
[datetime.datetime( 2012,1,1,1,3), 0.1]]
and I want a numpy record array corresponding to it. It would seem I ought to be able to do this:
np.rec.array( y, dtype=[('timestamp', object),('x','f')] )
or this
np.rec.array( y, dtype=[('timestamp', '|O8'),('x','f')] )
or maybe this
np.rec.array( y, dtype=[('timestamp', 'V'),('x','f')] )
But each of them returns an error, either
ValueError: Setting void-array with object members using buffer.
or
TypeError: expected a readable buffer object
So how exactly can I set this up, assuming it is even possible?