0
リストオブジェクトを定義された形式のPandas Dataframeに変換するには?リストオブジェクトを定義された形式のPandas Dataframeに変換するには?
印刷されたリストは、この出力(Jupyter)を持つ:
パンダDATAFRAMEに変換(u'variable', price threshold
0 13.5 100.0
1 10.0 NaN)
(u'standard', price threshold
0 12.5 300.0
1 11.0 NaN)
(u'fixed', price threshold
0 14.5 250.0
1 10.1 200.0
2 9.0 NaN)
(u'standing-charge', price
0 9)
:
0 1
0 variable price threshold 0 13.5 100.0 1 10...
1 standard price threshold 0 12.5 300.0 1 11...
2 fixed price threshold 0 14.5 250.0 1 10...
3 standing-charge price 0 9
私が必要:
type price threshold
variable 13.5 100
variable 10.0 NaN
...
、助けてください;)
これらのリストの要素は何ですか?データフレーム? – MaxNoe
ああ、あなたのインデックスはDataFrameが一意でなければならないので、あなたの「私は必要」はできません。インデックスの rows_list = [] 、ds.iterrowsの行(): = {} =行[ '平面']、json_normalize(行[ '速度']) – MaxNoe
はJSONファイルを解析からの出力です rows_list.append(a) print rows_list –