Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
タプルのリストが与えられた場合、各タプルはテーブル内の行を表します。
tab = [('a',1),('b',2)]
これをレコード配列に変換する簡単な方法はありますか? 私は試した
np.recarray(tab,dtype=[('name',str),('value',int)])
うまくいかないようです。
試す
np.rec.fromrecords(tab) rec.array([('a', 1), ('b', 2)], dtype=[('f0', '|S1'), ('f1', '<i4')])