为什么在熊猫中打开文本文件时索引没有显示为数字

时间:2019-05-25 22:17:17

标签: python pandas csv

我想以数据框格式打开文本文件,但是我尝试打开它,如下图所示

https://i.stack.imgur.com/SKEp3.png

但是我的实际文本文件看起来像

"2018rank
","City
","State[c]
","2018estimate
","2010Census
","Change
","2016 land area
","2016 population density
","Location
"
"1
","New York City[d]
"," New York
","8,398,748
","8,175,133
","+2.74%
","301.5 sq mi
","780.9 km2
","28,317/sq mi
","10,933/km2
","40°39′49″N 73°56′19″W / 40.6635°N 73.9387°W / 40.6635; -73.9387 (1 New York City)
"
data = pd.DataFrame.from_csv("table_data.txt",index_col=None)

0 个答案:

没有答案