正在数据标签jupyter笔记本中加载csv文件



我正在使用足够大的数据集(2GB(构建一个机器学习模型,该数据集无法在我的本地机器中运行,因此我决定使用谷歌云数据库。我已经成功地创建了VM,但我找不到如何像在本地机器中一样导入数据(使用pandas read_csv(。我的数据在谷歌硬盘里。有什么简单的方法可以用来解决这个问题吗。

# Excute below code in a cell
from google.colab import drive
drive.mount('/mount_unique',force_remount=True)
# HERE YOU WILL BE ASKED TO navigate to an URL, click on it and copy the authentication token to clipboard
# Paste in the text box shown and enter.
# execute the below code to list directories on your google drive
from os import listdir
print(listdir('/mount_unique'))
# print(listdir('/mount_unique/My Drive')) #lists contents of your drive
import pandas as pd
pd.read_csv('/mount_unique/My Drive/<YOUR_DATA_FILE_PATH>')

最新更新