Skip to content

Commit fedb8f2

Browse files
authored
docs: divide BQ DataFrames quickstart code cell (#1975)
1 parent a8d57d2 commit fedb8f2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

samples/snippets/quickstart.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def 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

Comments
 (0)