Google cloud platform 是否有一种简单/快速的方法将拼花地板文件从我的Google Bucket加载到我的Google Cloud笔记本中?

Google cloud platform 是否有一种简单/快速的方法将拼花地板文件从我的Google Bucket加载到我的Google Cloud笔记本中?,google-cloud-platform,jupyter-notebook,parquet,Google Cloud Platform,Jupyter Notebook,Parquet,我刚刚上传了一个拼花文件到我的桶里。我用jupyter笔记本启动了一个新实例。到目前为止,我可以从我的存储桶中读取文件名: !pip install google-cloud-storage client = storage.Client() bucket = client.get_bucket("mybucket") filename = list(bucket.list_blobs()) for name in filename: print(name.name)

我刚刚上传了一个拼花文件到我的桶里。我用jupyter笔记本启动了一个新实例。到目前为止,我可以从我的存储桶中读取文件名:

!pip install google-cloud-storage
client = storage.Client()
bucket = client.get_bucket("mybucket")
filename = list(bucket.list_blobs())
for name in filename:
    print(name.name)

a = pd.read_parquet("gcs://mybucket/myfile.gzip")

当它到达最后一行时,它只是挂起。。。这是一个2GB的文件,所以加载不会花那么长时间,它已经挂起好几个小时了。

请尝试更正文件格式。从:

注意示例中的文件名,df.parquet.gzip。我建议您修复您的文件,并遵循格式

例如:

gs://mybucket/myfile.parquet.gzip

df = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]})
df.to_parquet('df.parquet.gzip', compression='gzip')  
pd.read_parquet('df.parquet.gzip') 
 
   col1  col2
0     1     3
1     2     4