pythonでBigQueryにデータを読み込む
slack分析
conda install -c conda-forge google-cloud-bigquery
conda install -c anaconda protobuf
conda install -c conda-forge fastparquet
conda install -c conda-forge pyarrow
code:sample.py
from google.cloud import bigquery
client = bigquery.Client()
query = (
'select * from dl_guild_slack.slack_channel limit 1000'
)
df = client.query(query).to_dataframe()
リファレンスに感してはGoogle Cloud Client Library for Pythonを参照
Using BigQuery with Pandasの、Load a Pandas DataFrame to a BigQuery Tableを参考に、Bigqueryにデータをインサートする