@@ -349,7 +349,7 @@ def read_gbq_query(
349
349
350
350
Preserve ordering in a query input.
351
351
352
- >>> bpd.read_gbq_query('''
352
+ >>> df = bpd.read_gbq_query('''
353
353
... SELECT
354
354
... -- Instead of an ORDER BY clause on the query, use
355
355
... -- ROW_NUMBER() to create an ordered DataFrame.
@@ -362,16 +362,14 @@ def read_gbq_query(
362
362
... FROM `bigquery-public-data.baseball.games_wide`
363
363
... WHERE year = 2016
364
364
... GROUP BY pitcherFirstName, pitcherLastName
365
- ... ''', index_col="rowindex").head(n=5)
365
+ ... ''', index_col="rowindex")
366
+ >>> df.head(2)
366
367
pitcherFirstName pitcherLastName averagePitchSpeed
367
368
rowindex
368
369
1 Albertin Chapman 96.514113
369
370
2 Zachary Britton 94.591039
370
- 3 Trevor Rosenthal 94.213953
371
- 4 Jose Torres 94.103448
372
- 5 Tayron Guerrero 93.863636
373
371
<BLANKLINE>
374
- [5 rows x 3 columns]
372
+ [2 rows x 3 columns]
375
373
376
374
See also: :meth:`Session.read_gbq`.
377
375
"""
@@ -441,22 +439,17 @@ def read_gbq_table(
441
439
>>> import bigframes.pandas as bpd
442
440
>>> bpd.options.display.progress_bar = None
443
441
444
- >>> bpd.read_gbq_table("bigquery-public-data.ml_datasets.penguins").head(5)
442
+ >>> df = bpd.read_gbq_table("bigquery-public-data.ml_datasets.penguins")
443
+ >>> df.head(2)
445
444
species island culmen_length_mm \\
446
445
0 Adelie Penguin (Pygoscelis adeliae) Dream 36.6
447
446
1 Adelie Penguin (Pygoscelis adeliae) Dream 39.8
448
- 2 Adelie Penguin (Pygoscelis adeliae) Dream 40.9
449
- 3 Chinstrap penguin (Pygoscelis antarctica) Dream 46.5
450
- 4 Adelie Penguin (Pygoscelis adeliae) Dream 37.3
451
447
<BLANKLINE>
452
448
culmen_depth_mm flipper_length_mm body_mass_g sex
453
449
0 18.4 184.0 3475.0 FEMALE
454
450
1 19.1 184.0 4650.0 MALE
455
- 2 18.9 184.0 3900.0 MALE
456
- 3 17.9 192.0 3500.0 FEMALE
457
- 4 16.8 192.0 3000.0 FEMALE
458
451
<BLANKLINE>
459
- [5 rows x 7 columns]
452
+ [2 rows x 7 columns]
460
453
461
454
See also: :meth:`Session.read_gbq`.
462
455
"""
@@ -851,8 +844,7 @@ def read_gbq_model(self, model_name: str):
851
844
>>> bpd.options.display.progress_bar = None
852
845
853
846
>>> model_name = "bigframes-dev.bqml_tutorial.penguins_model"
854
- >>> bpd.read_gbq_model(model_name)
855
- LinearRegression(optimize_strategy='NORMAL_EQUATION')
847
+ >>> model = bpd.read_gbq_model(model_name)
856
848
857
849
Args:
858
850
model_name (str):
@@ -885,7 +877,8 @@ def read_pandas(self, pandas_dataframe: pandas.DataFrame) -> dataframe.DataFrame
885
877
886
878
>>> d = {'col1': [1, 2], 'col2': [3, 4]}
887
879
>>> pandas_df = pd.DataFrame(data=d)
888
- >>> bpd.read_pandas(pandas_df)
880
+ >>> df = bpd.read_pandas(pandas_df)
881
+ >>> df
889
882
col1 col2
890
883
0 1 3
891
884
1 2 4
0 commit comments