Skip to content

Instantly share code, notes, and snippets.

@vwrs
Last active April 14, 2023 07:32
Show Gist options
  • Save vwrs/064633fa5bedc2fc0d35d66103991e94 to your computer and use it in GitHub Desktop.
Save vwrs/064633fa5bedc2fc0d35d66103991e94 to your computer and use it in GitHub Desktop.
jupyter notebook template bigquery
import pandas as pd
import matplotlib.pyplot as plt
%load_ext autoreload
%autoreload 2
# pandas settings
pd.set_option('display.max_columns', 200)
pd.set_option('display.max_rows', 100)
# matplotlib settings
plt.rcParams['figure.figsize'] = [10,8]
plt.rcParams['figure.dpi'] = 100
plt.rcParams['font.size'] = 18
plt.rcParams['axes.labelsize'] = 20
def read_gbq(q):
return pd.read_gbq(q, project_id=project_id,
dialect='standard',
progress_bar_type='tqdm_notebook',
use_bqstorage_api=True)
q = '''
#standardSQL
WITH
mst AS (
SELECT
*
FROM xxx
)
SELECT
*
FROM mst
ORDER BY order_columns
LIMIT 10000
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment