google-cloud-datalab

TypeError: string argument without an encoding

TypeError: string argument without an encoding Question: I want to upload compressed gzip of Json into Google Storage. I have this code: import datalab.storage as storage import gzip path = prefix + ‘/orders_newline.json.gz’ storage.Bucket(‘orders’).item(path).write_to(gzip.compress(bytes(create_jsonlines(source)),encoding=’utf8′), ‘application/json’) The create_jsonlines(source) is a function that returns Json Newline Delimited. Running this code gives: TypeError: string argument without an encoding …

Total answers: 3

Write a Pandas DataFrame to Google Cloud Storage or BigQuery

Write a Pandas DataFrame to Google Cloud Storage or BigQuery Question: Hello and thanks for your time and consideration. I am developing a Jupyter Notebook in the Google Cloud Platform / Datalab. I have created a Pandas DataFrame and would like to write this DataFrame to both Google Cloud Storage(GCS) and/or BigQuery. I have a …

Total answers: 10