Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/BigQuery/BigQuery_Create_table_from_csv.ipynb
2973 views
Kernel: Python 3

Naas

BigQuery - Create table from csv

Give Feedback | Bug report

Tags: #bigquery #database #snippet #operations #dataframe

Last update: 2023-04-12 (Created: 2022-08-08)

Description: This notebook demonstrates how to create a BigQuery table from a CSV file.

Input

Import libraries

from naas_drivers import bigquery

Variable

service_account_file = "big-query-777777-ffffff777777.json" project_id = "big-query-777777" dataset = "example_ds" table_name = "iris" csv_file = "iris.csv"

Model

Connect to BigQuery

conn = bigquery.connect(service_account_file, project_id)

Output

Load data into the table

conn.load_data_from_csv(dataset, table_name, csv_file)