如何将列表转换为具有1行的数据框

时间:2019-06-17 14:35:55

标签: python web-scraping beautifulsoup

row = ['Gr',
 'http://www.purriodictableofcats.com/images/b-grumpycat.jpg',
 'Female',
 'Real Name: Tardar Sauce',
 'Hit the internet: 2012',
 "Interesting Facts: Being both grumpy and adorableNamed as MSNBC's 2012 Most Influential CatWon Buzzfeed's Meme of the Year Award in 2013Published 2 books and a wall calendarAppeared on: Today Show, Good Morning America, CBS Evening News, American Idol and many more",
 'https://www.facebook.com/TheOfficialGrumpyCat',
 'https://twitter.com/RealGrumpyCat',
 'http://instagram.com/realgrumpycat/']

然后我尝试一下:

pd.DataFrame(row, columns = ["id","img","sex","real_name","year",\
                             "fact","link1","link2","link3"])

后来我希望在python中做类似rbind的事情。 一个想法的方法就像table = rbind(row1,row2),但是当然是在python中。我希望在此示例中,表的行数将为2。

0 个答案:

没有答案