gcp read data from bucket

PHOTO EMBED

Thu Jan 20 2022 00:01:12 GMT+0000 (UTC)

Saved by @aurora1625 #pandas #gcp

import pandas as pd
from google.cloud import storage

BUCKET_NAME = 'zhibo-work'

# Create a Cloud Storage client to download the data
storage_client = storage.Client()

# Download the data
data_bucket = storage_client.bucket(BUCKET_NAME)
blob = data_bucket.blob('description/data_gics.csv')
blob.download_to_filename('data_gics.csv')
content_copyCOPY