【发布时间】:2014-07-11 08:39:45
【问题描述】:
我正在尝试将 Google 电子表格中的数据导入 pandas 进行分析。我在一张表中有多个数据集,因此我无法将导入用作此处显示的 CSV 示例:Getting Google Spreadsheet CSV into A Pandas Dataframe
这是我的数据在电子表格中的样子:
Date letters numbers mixed
1/1/2014 a 3 z1
1/2/2014 b 2 y2
1/3/2014 c 1 x3
我已经使用gspread 导入,并且可以通过观察每一行来使数据看起来像这样:
[['Date', 'letters', 'numbers', 'mixed'], ['1/1/2014', 'a', '3', 'z1'], ['1/2/2014', 'b', '2', 'y2'], ['1/3/2014', 'c', '1', 'x3']]
我的问题是如何将它放入带有数字索引的 pandas 数据框中?我不希望日期成为索引。我需要一个通用的解决方案,我的数据集是 1000 行 x 50 列。
【问题讨论】: