【发布时间】:2018-06-28 15:35:47
【问题描述】:
我正在尝试读取我本地存储在我的机器上的 csv 文件。 (仅供参考,它是来自 Kaggle 的泰坦尼克号数据,here。)
从this question and answers 我了解到您可以使用此代码导入数据,这对我来说效果很好。
from google.colab import files
uploaded = files.upload()
我迷路的是如何从这里将其转换为数据帧。上面答案中列出的sample google notebook page 没有谈论它。
我正在尝试使用 from_dict 命令将字典 uploaded 转换为数据框,但无法使其工作。有一些关于将 dict 转换为数据框here 的讨论,但解决方案不适用于我(我认为)。
总结一下,我的问题是:
如何将本地存储在我的文件中的 csv 文件转换为 pandas Google Colaboratory 上的数据框?
【问题讨论】:
-
嘿,看看我的答案,使用 gspread *.com/a/49397059/9017976
标签: python csv dataframe google-colaboratory