1
我有以下數據:如何更改數據框中保存的數據格式?
DF1
0 (AG, AD, AE)
1 (AG, AM, AF)
dtype: object
DF2
0 [99.0, 45.0, 99.0, 92.0, 140.0, 53.0, 185.0, 8...
1 [78.0, 52.0, 74.0, 29.0, 30.0, 57.0, 48.0, 39....
DF3
0 [19.0, 22.0, 13.0, 24.0, 70.0, 50.0, 185.0, 8...
1 [18.0, 33.0, 74.0, 29.0, 30.0, 77.0, 48.0, 39....
我想將這些系列保存爲數據框。如果我做df = pd.DataFrame({"TYPE-1":df1,"TYPE-2":df2,"TYPE-2":df2})
,然後我得到這樣的:
TYPE-1 TYPE-2 TYPE-3
(AG, AD, AE) [99.0, 45.0, 99.0, 92.0,...] [78.0, 52.0, 74.0, 29.0, ...]
(AG, AM, AF) [78.0, 52.0, 74.0, 29.0,...] [18.0, 33.0, 74.0, 29.0,...]
如何更改格式,以這一個?:
TYPE-1 TYPE-2 TYPE-3
(AG, AD, AE) 99.0 78.0
(AG, AD, AE) 45.0 52.0
...
啊哎呀我錯過了與第一列的細節,這是更好。 – miradulo
是的,不幸的是:( – jezrael