<jupyter_start><jupyter_text>Sample Notebook: BigQuery table stats  Imports<jupyter_code>%load_ext google.cloud.bigquery

!pip install --user facets-overview<jupyter_output><empty_output><jupyter_text>Load data<jupyter_code>%%bigquery total_births
SELECT *
FROM `bigquery-public-data.samples.natality`
LIMIT 100000
total_births.describe().transpose()<jupyter_output><empty_output><jupyter_text>Visualize statistics<jupyter_code># Create the feature stats for the datasets and stringify it.
import base64
from facets_overview.generic_feature_statistics_generator import GenericFeatureStatisticsGenerator

gfsg = GenericFeatureStatisticsGenerator()
proto = gfsg.ProtoFromDataFrames([{'name': 'total_births', 'table': total_births}])
protostr = base64.b64encode(proto.SerializeToString()).decode("utf-8")
# Display the facets overview visualization for this data
from IPython.core.display import display, HTML

HTML_TEMPLATE = """
        <script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.3.3/webcomponents-lite.js"></script>
        <link rel="import" href="https://raw.githubusercontent.com/PAIR-code/facets/1.0.0/facets-dist/facets-jupyter.html" >
        <facets-overview id="elem"></facets-overview>
        <script>
          document.querySelector("#elem").protoInput = "{protostr}";
        </script>"""
html = HTML_TEMPLATE.format(protostr=protostr)
display(HTML(html))<jupyter_output><empty_output>