Google cloud storage 从谷歌云数据实验室的笔记本读取谷歌云存储中zip文件中存储的数据

Google cloud storage 从谷歌云数据实验室的笔记本读取谷歌云存储中zip文件中存储的数据,google-cloud-storage,google-cloud-datalab,Google Cloud Storage,Google Cloud Datalab,我有一个zip文件,其中包含一个相对较大的数据集(1Gb),存储在Google云存储实例的zip文件中 我需要使用谷歌云数据库中的笔记本来访问该文件和其中包含的数据。我该怎么办 谢谢。你能试试下面的吗 import pandas as pd # Path to the object in Google Cloud Storage that you want to copy sample_gcs_object = 'gs://path-to-gcs/Hello.txt.zip' # Copy

我有一个zip文件,其中包含一个相对较大的数据集(1Gb),存储在Google云存储实例的zip文件中

我需要使用谷歌云数据库中的笔记本来访问该文件和其中包含的数据。我该怎么办


谢谢。

你能试试下面的吗

import pandas as pd

# Path to the object in Google Cloud Storage that you want to copy
sample_gcs_object = 'gs://path-to-gcs/Hello.txt.zip'

# Copy the file from Google Cloud Storage to Datalab
!gsutil cp $sample_gcs_object 'Hello.txt.zip'

# Unzip the file
!unzip 'Hello.txt.zip' 

# Read the file into a pandas DataFrame
pandas_dataframe = pd.read_csv('Hello.txt')