@DSM beat me to it when I am preparing a full answer. But yes, it is sort-of already there. Only that you have to use Pandas
(imported as pd
) to convert it to a DataFrame
and then convert it to a recarray
In [8]:
print pd.DataFrame(raw)
age extra has_money name
0 45 NaN True Billy
1 32 Something wicked False Tommy
2 31 NaN True Al
In [9]:
pd.DataFrame(raw).to_records()
Out[9]:
rec.array([(0, 45, nan, True, 'Billy'),
(1, 32, 'Something wicked', False, 'Tommy'),
(2, 31, nan, True, 'Al')],
dtype=[('index', '<i8'), ('age', '<i8'), ('extra', 'O'), ('has_money', '?'), ('name', 'O')])