1616def run_quickstart (project_id : str ) -> None :
1717 your_gcp_project_id = project_id
1818
19- # [START bigquery_bigframes_quickstart ]
19+ # [START bigquery_bigframes_quickstart_create_dataframe ]
2020 import bigframes .pandas as bpd
2121
2222 # Set BigQuery DataFrames options
@@ -37,12 +37,16 @@ def run_quickstart(project_id: str) -> None:
3737
3838 # Efficiently preview the results using the .peek() method.
3939 df .peek ()
40+ # [END bigquery_bigframes_quickstart_create_dataframe]
4041
42+ # [START bigquery_bigframes_quickstart_calculate_print]
4143 # Use the DataFrame just as you would a pandas DataFrame, but calculations
4244 # happen in the BigQuery query engine instead of the local system.
4345 average_body_mass = df ["body_mass_g" ].mean ()
4446 print (f"average_body_mass: { average_body_mass } " )
47+ # [END bigquery_bigframes_quickstart_calculate_print]
4548
49+ # [START bigquery_bigframes_quickstart_eval_metrics]
4650 # Create the Linear Regression model
4751 from bigframes .ml .linear_model import LinearRegression
4852
@@ -70,7 +74,7 @@ def run_quickstart(project_id: str) -> None:
7074 model = LinearRegression (fit_intercept = False )
7175 model .fit (X , y )
7276 model .score (X , y )
73- # [END bigquery_bigframes_quickstart ]
77+ # [END bigquery_bigframes_quickstart_eval_metrics ]
7478
7579 # close session and reset option so not to affect other tests
7680 bpd .close_session ()
0 commit comments