text_plain_output_1.png
from google.cloud import bigquery

from google.cloud import bigquery
client = bigquery.Client()
dataset_ref = client.dataset('openaq', project='bigquery-public-data')
dataset = client.get_dataset(dataset_ref)

tables = list(client.list_tables(dataset))

table_ref = dataset_ref.table('global_air_quality')
table = client.get_table(table_ref)

client.list_rows(table, max_results=5).to_dataframe()

query = "\n    SELECT city\n    FROM `bigquery-public-data.openaq.global_air_quality`\n    WHERE country = 'US'\n"

query_job = client.query(query)

us_cities = query_job.to_dataframe()

us_cities.city.value_counts().head()