私はohlcデータのリストを持っています:
[(1360710000.0, 69.06, 69.67, 68.53, 69.53, 550000.0, 69.53),
(1360623600.0, 68.98, 69.05, 68.39, 68.94, 604200.0, 68.94)]
そして、次のような構造のnumpy配列に変換する必要があります。
array([ (1352934000, 63.130001068115234, 63.59000015258789, 62.900001525878906, 63.16999816894531, 816300.0, 63.16999816894531),
(1353020400, 62.970001220703125, 63.529998779296875, 62.599998474121094, 62.61000061035156, 942000.0, 62.61000061035156),
(1353279600, 63.0, 64.97000122070312, 63.0, 64.87999725341797, 812800.0, 64.87999725341797),
(1353366000, 64.44999694824219, 65.27999877929688, 64.29000091552734, 65.23999786376953, 467700.0, 65.23999786376953),
(1353452400, 65.16999816894531, 65.4000015258789, 64.58999633789062, 64.8499984741211, 417700.0, 64.8499984741211)],
dtype=[('time', '<i4'), ('open', '<f4'), ('high', '<f4'), ('low', '<f4'), ('close', '<f4'), ('volume', '<f4'), ('amount', '<f4')])
試行すると、期待どおりに誤った構造になります。
np.array(list, dtype=Day)
array([[1360710000.0, 69.06, 69.67, 68.53, 69.53, 550000.0, 69.53],
[1360623600.0, 68.98, 69.05, 68.39, 68.94, 604200.0, 68.94]], dtype=object)