@@ -139,11 +139,11 @@ def test_jupyter_tutorial(ipython):
139
139
pivot_table .plot (kind = 'bar' , stacked = True , figsize = (15 , 7 ));
140
140
# [END bigquery_jupyter_plot_plurality_by_year]
141
141
142
- # [START bigquery_jupyter_query_weight_by_gestation ]
142
+ # [START bigquery_jupyter_query_births_by_gestation ]
143
143
sql = """
144
144
SELECT
145
145
gestation_weeks,
146
- AVG(weight_pounds ) AS ave_weight
146
+ COUNT(1 ) AS count
147
147
FROM
148
148
`bigquery-public-data.samples.natality`
149
149
WHERE
@@ -154,12 +154,11 @@ def test_jupyter_tutorial(ipython):
154
154
gestation_weeks
155
155
"""
156
156
df = client .query (sql ).to_dataframe ()
157
- # [END bigquery_jupyter_query_weight_by_gestation ]
157
+ # [END bigquery_jupyter_query_births_by_gestation ]
158
158
159
- # [START bigquery_jupyter_plot_weight_by_gestation]
160
- ax = df .plot (
161
- kind = 'bar' , x = 'gestation_weeks' , y = 'ave_weight' , figsize = (15 , 7 ))
162
- ax .set_title ('Average Weight by Gestation Weeks' )
159
+ # [START bigquery_jupyter_plot_births_by_gestation]
160
+ ax = df .plot (kind = 'bar' , x = 'gestation_weeks' , y = 'count' , figsize = (15 ,7 ))
161
+ ax .set_title ('Count of Births by Gestation Weeks' )
163
162
ax .set_xlabel ('Gestation Weeks' )
164
- ax .set_ylabel ('Average Weight ' );
165
- # [END bigquery_jupyter_plot_weight_by_gestation ]
163
+ ax .set_ylabel ('Count ' );
164
+ # [END bigquery_jupyter_plot_births_by_gestation ]
0 commit comments