python降维将多列数据压缩为一列_将列值拆分为多列pandas/python

我是Python/Pandas的新手,并且有两列一列和另一列的数据框。 我期待将一列(系列)的内容拆分为多列。赞赏您在这方面的投入。 这是我的当前数据帧内容将列值拆分为多列pandas/python

Songdetails Density

0 ["'t Hof Van Commerce", "Chance", "SORETGR12AB... 4.445323

1 ["-123min.", "Try", "SOERGVA12A6D4FEC55"] 3.854437

2 ["10_000 Maniacs", "Please Forgive Us (LP Vers... 3.579846

3 ["1200 Micrograms", "ECSTACY", "SOKYOEA12AB018... 5.503980

4 ["13 Cats", "Please Give Me Something", "SOYLO... 2.964401

5 ["16 Bit Lolitas", "Tim Likes Breaks (intermez... 5.564306

6 ["23 Skidoo", "100 Dark", "SOTACCS12AB0185B85"] 5.572990

7 ["2econd Class Citizen", "For This We'll Find ... 3.756746

8 ["2tall", "Demonstration", "SOYYQZR12A8C144F9D"] 5.472524

希望的输出是歌曲,艺术家,歌曲ID,密度即分裂乐曲的详细信息成列。

例如,对样本数据

SONG DETAILS DENSITY

8 ["2tall", "Demonstration", "SOYYQZR12A8C144F9D"] 5.472524

SONG ARTIST SONG ID DENSITY

2tall Demonstration SOYYQZR12A8C144F9D 5.472524

感谢

2014-10-10

MUKUND

+1

你可以试试这个:'pd.DataFrame(data = list(df ['Songdetails']。values),columns = ['SONG','ARTIST','SONG ID'] )' –

2014-10-10 15:15:30

你可能感兴趣的:(python降维将多列数据压缩为一列_将列值拆分为多列pandas/python)