Before you begin
- Use the Cloud Resource Manager to Create a Cloud Platform project if you do not already have one.
- Enable billing for the project.
- Enable BigQuery APIs for the project.
Colab includes the google.colab.data_table package that can be used to display large pandas dataframes as an interactive data table.
It can be enabled with:
If you would prefer to return to the classic Pandas dataframe display, you can disable this by running:
%unload_ext google.colab.data_table
The google.cloud.bigquery library also includes a magic command which runs a query and either displays the result or saves it to a variable as a DataFrame.
See BigQuery documentation and library reference documentation.
The GSOD sample table contains weather information collected by NOAA, such as precipitation amounts and wind speeds from late 1929 to early 2010.
Full dataset has 114420316 rows
The pandas-gbq library is a community led project by the pandas community. It covers basic functionality, such as writing a DataFrame to BigQuery and running a query, but as a third-party library it may not handle all BigQuery features or use cases.
google.colab.syntax can be used to add syntax highlighting to any Python string literals which are used in a query later.