0

我有一个包含广告牌歌曲详细信息的文件。其中的几个数据点如下所示:

url#('http://www.billboard.com/charts/hot-100/1965-01-30', 'http://www.billboard.com/charts/hot-100/1965-02-06', 'http://www.billboard.com/charts/hot-100/1965-02-13', 'http://www.billboard.com/charts/hot-100/1965-02-27', 'http://www.billboard.com/charts/hot-100/1965-03-06', 'http://www.billboard.com/charts/hot-100/1965-02-20')
weekid#('1965-01-30', '1965-02-06', '1965-02-13', '1965-02-27', '1965-03-06', '1965-02-20')
week_position#(72, 48, 43, 48, 53, 50)
song#At The Club
performer#The Drifters
instance#(1, 1, 1, 1, 1, 1)
previous_week_position#(nan, 72.0, 48.0, 50.0, 48.0, 43.0)
peak_position#(72, 48, 43, 43, 43, 43)
weeks_on_chart#(1, 2, 3, 5, 6, 4)
lyrics#"Well, Friday night
Has finally come around
And me and my baby gonna
Head for a spot we found
url#('http://www.billboard.com/charts/hot-100/1966-02-05', 'http://www.billboard.com/charts/hot-100/1966-02-12', 'http://www.billboard.com/charts/hot-100/1966-02-19', 'http://www.billboard.com/charts/hot-100/1966-03-12', 'http://www.billboard.com/charts/hot-100/1966-03-05', 'http://www.billboard.com/charts/hot-100/1966-02-26', 'http://www.billboard.com/charts/hot-100/1966-03-19')
weekid#('1966-02-05', '1966-02-12', '1966-02-19', '1966-03-12', '1966-03-05', '1966-02-26', '1966-03-19')
week_position#(73, 43, 24, 18, 19, 21, 39)
song#At The Scene
performer#The Dave Clark Five
instance#(1, 1, 1, 1, 1, 1, 1)
previous_week_position#(nan, 73.0, 43.0, 19.0, 21.0, 24.0, 18.0)
peak_position#(73, 43, 24, 18, 19, 21, 18)
weeks_on_chart#(1, 2, 3, 6, 5, 4, 7)
lyrics#"Everyone who is lonely
I've got a place for you
Where the music play-ay-ay-ay-ays"
Till way past two

When you're down at the scene
When you're down at the sceneEmbedShare URLCopyEmbedCopy"

我希望能够使用 Python 中的 Pandas 创建一个数据框,如下所示,

columns = url, weekid, week_position, song, performer, instance, previous_week_position, peak_position, weeks_on_chart, lyrics (# has been used as sep).
4

0 回答 0