Skip to content

Commit fe54feb

Browse files
committed
fix more docs
1 parent b81a6e6 commit fe54feb

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

third_party/bigframes_vendored/pandas/core/frame.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4735,6 +4735,7 @@ def round(self, decimals):
47354735
47364736
**Examples:**
47374737
4738+
>>> import bigframes.pandas as bpd
47384739
>>> df = bpd.DataFrame([(.21, .32), (.01, .67), (.66, .03), (.21, .18)],
47394740
... columns=['dogs', 'cats'])
47404741
>>> df
@@ -5051,7 +5052,7 @@ def prod(self, axis=0, *, numeric_only: bool = False):
50515052
50525053
**Examples:**
50535054
5054-
5055+
>>> import bigframes.pandas as bpd
50555056
>>> df = bpd.DataFrame({"A": [1, 2, 3], "B": [4.5, 5.5, 6.5]})
50565057
>>> df
50575058
A B
@@ -5261,7 +5262,7 @@ def median(self, *, numeric_only: bool = False, exact: bool = True):
52615262
52625263
**Examples:**
52635264
5264-
5265+
>>> import bigframes.pandas as bpd
52655266
>>> df = bpd.DataFrame({"A": [1, 3], "B": [2, 4]})
52665267
>>> df
52675268
A B
@@ -5297,6 +5298,7 @@ def quantile(
52975298
52985299
**Examples:**
52995300
5301+
>>> import bigframes.pandas as bpd
53005302
>>> df = bpd.DataFrame(np.array([[1, 1], [2, 10], [3, 100], [4, 100]]),
53015303
... columns=['a', 'b'])
53025304
>>> df.quantile(.1)
@@ -5544,7 +5546,7 @@ def nlargest(self, n: int, columns, keep: str = "first"):
55445546
55455547
**Examples:**
55465548
5547-
5549+
>>> import bigframes.pandas as bpd
55485550
>>> df = bpd.DataFrame({"A": [1, 1, 3, 3, 5, 5],
55495551
... "B": [5, 6, 3, 4, 1, 2],
55505552
... "C": ['a', 'b', 'a', 'b', 'a', 'b']})
@@ -5634,7 +5636,7 @@ def nsmallest(self, n: int, columns, keep: str = "first"):
56345636
56355637
**Examples:**
56365638
5637-
5639+
>>> import bigframes.pandas as bpd
56385640
>>> df = bpd.DataFrame({"A": [1, 1, 3, 3, 5, 5],
56395641
... "B": [5, 6, 3, 4, 1, 2],
56405642
... "C": ['a', 'b', 'a', 'b', 'a', 'b']})
@@ -6116,7 +6118,7 @@ def describe(self, include: None | Literal["all"] = None):
61166118
61176119
**Examples:**
61186120
6119-
6121+
>>> import bigframes.pandas as bpd
61206122
>>> df = bpd.DataFrame({"A": [3, 1, 2], "B": [0, 2, 8], "C": ["cat", "cat", "dog"]})
61216123
>>> df
61226124
A B C
@@ -6254,7 +6256,7 @@ def pivot_table(self, values=None, index=None, columns=None, aggfunc="mean"):
62546256
62556257
**Examples:**
62566258
6257-
6259+
>>> import bigframes.pandas as bpd
62586260
>>> df = bpd.DataFrame({
62596261
... 'Product': ['Product A', 'Product B', 'Product A', 'Product B', 'Product A', 'Product B'],
62606262
... 'Region': ['East', 'West', 'East', 'West', 'West', 'East'],
@@ -6867,7 +6869,7 @@ def replace(
68676869
68686870
**Examples:**
68696871
6870-
6872+
>>> import bigframes.pandas as bpd
68716873
>>> df = bpd.DataFrame({
68726874
... 'int_col': [1, 1, 2, 3],
68736875
... 'string_col': ["a", "b", "c", "b"],

third_party/bigframes_vendored/pandas/core/generic.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def astype(self, dtype):
102102
103103
**Examples:**
104104
105-
106105
Create a DataFrame:
107106
108107
>>> d = {'col1': [1, 2], 'col2': [3, 4]}
@@ -146,7 +145,7 @@ def astype(self, dtype):
146145
147146
Note that this is equivalent of using ``to_datetime`` with ``unit='us'``:
148147
149-
>>> bpd.to_datetime(ser, unit='us', utc=True)
148+
>>> bpd.to_datetime(ser, unit='us', utc=True) # doctest: +SKIP
150149
0 2034-02-08 11:13:20.246789+00:00
151150
1 2021-06-19 17:20:44.123101+00:00
152151
2 2003-06-05 17:30:34.120101+00:00
@@ -551,7 +550,7 @@ def sample(
551550
552551
**Examples:**
553552
554-
553+
>>> import bigframes.pandas as bpd
555554
>>> df = bpd.DataFrame({'num_legs': [2, 4, 8, 0],
556555
... 'num_wings': [2, 0, 0, 0],
557556
... 'num_specimen_seen': [10, 2, 1, 8]},
@@ -1045,7 +1044,7 @@ def rolling(
10451044
10461045
**Examples:**
10471046
1048-
1047+
>>> import bigframes.pandas as bpd
10491048
>>> s = bpd.Series([0,1,2,3,4])
10501049
>>> s.rolling(window=3).min()
10511050
0 <NA>

third_party/bigframes_vendored/pandas/core/groupby/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def describe(self, include: None | Literal["all"] = None):
4444
4545
**Examples:**
4646
47-
47+
>>> import bigframes.pandas as bpd
4848
>>> df = bpd.DataFrame({"A": [1, 1, 1, 2, 2], "B": [0, 2, 8, 2, 7], "C": ["cat", "cat", "dog", "mouse", "cat"]})
4949
>>> df
5050
A B C
@@ -250,7 +250,7 @@ def median(
250250
251251
For SeriesGroupBy:
252252
253-
253+
>>> import bigframes.pandas as bpd
254254
>>> lst = ['a', 'a', 'a', 'b', 'b', 'b']
255255
>>> ser = bpd.Series([7, 2, 8, 4, 3, 3], index=lst)
256256
>>> ser.groupby(level=0).median()
@@ -288,6 +288,7 @@ def quantile(self, q=0.5, *, numeric_only: bool = False):
288288
289289
**Examples:**
290290
291+
>>> import bigframes.pandas as bpd
291292
>>> df = bpd.DataFrame([
292293
... ['a', 1], ['a', 2], ['a', 3],
293294
... ['b', 1], ['b', 3], ['b', 5]
@@ -411,7 +412,7 @@ def rank(
411412
412413
**Examples:**
413414
414-
415+
>>> import bigframes.pandas as bpd
415416
>>> df = bpd.DataFrame(
416417
... {
417418
... "group": ["a", "a", "a", "a", "a", "b", "b", "b", "b", "b"],
@@ -574,6 +575,7 @@ def first(self, numeric_only: bool = False, min_count: int = -1):
574575
575576
**Examples:**
576577
578+
>>> import bigframes.pandas as bpd
577579
>>> df = bpd.DataFrame(dict(A=[1, 1, 3], B=[None, 5, 6], C=[1, 2, 3]))
578580
>>> df.groupby("A").first()
579581
B C
@@ -1077,7 +1079,7 @@ def rolling(self, *args, **kwargs):
10771079
10781080
**Examples:**
10791081
1080-
1082+
>>> import bigframes.pandas as bpd
10811083
>>> lst = ['a', 'a', 'a', 'a', 'e']
10821084
>>> ser = bpd.Series([1, 0, -2, -1, 2], index=lst)
10831085
>>> ser.groupby(level=0).rolling(2).min()
@@ -1133,7 +1135,7 @@ def expanding(self, *args, **kwargs):
11331135
11341136
**Examples:**
11351137
1136-
1138+
>>> import bigframes.pandas as bpd
11371139
>>> lst = ['a', 'a', 'c', 'c', 'e']
11381140
>>> ser = bpd.Series([1, 0, -2, -1, 2], index=lst)
11391141
>>> ser.groupby(level=0).expanding().min()

third_party/bigframes_vendored/pandas/core/indexes/accessor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def day_of_year(self):
122122
123123
**Examples:**
124124
125+
>>> import bigframes.pandas as bpd
125126
>>> s = bpd.Series(
126127
... pd.date_range('2016-12-28', '2017-01-03', freq='D').to_series()
127128
... )
@@ -152,6 +153,7 @@ def date(self):
152153
153154
**Examples:**
154155
156+
>>> import bigframes.pandas as bpd
155157
>>> s = bpd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
156158
>>> s = bpd.to_datetime(s, utc=True, format="%d/%m/%Y %H:%M:%S%Ez")
157159
>>> s
@@ -172,6 +174,7 @@ def hour(self):
172174
173175
**Examples:**
174176
177+
>>> import bigframes.pandas as bpd
175178
>>> s = bpd.Series(
176179
... pd.date_range("2000-01-01", periods=3, freq="h")
177180
... )
@@ -195,6 +198,7 @@ def minute(self):
195198
196199
**Examples:**
197200
201+
>>> import bigframes.pandas as bpd
198202
>>> s = bpd.Series(
199203
... pd.date_range("2000-01-01", periods=3, freq="min")
200204
... )
@@ -271,6 +275,7 @@ def second(self):
271275
272276
**Examples:**
273277
278+
>>> import bigframes.pandas as bpd
274279
>>> s = bpd.Series(
275280
... pd.date_range("2000-01-01", periods=3, freq="s")
276281
... )
@@ -298,6 +303,7 @@ def time(self):
298303
299304
**Examples:**
300305
306+
>>> import bigframes.pandas as bpd
301307
>>> s = bpd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
302308
>>> s = bpd.to_datetime(s, utc=True, format="%m/%d/%Y %H:%M:%S%Ez")
303309
>>> s
@@ -318,6 +324,7 @@ def quarter(self):
318324
319325
**Examples:**
320326
327+
>>> import bigframes.pandas as bpd
321328
>>> s = bpd.Series(["1/1/2020 10:00:00+00:00", "4/1/2020 11:00:00+00:00"])
322329
>>> s = bpd.to_datetime(s, utc=True, format="%m/%d/%Y %H:%M:%S%Ez")
323330
>>> s
@@ -420,6 +427,7 @@ def tz(self):
420427
421428
**Examples:**
422429
430+
>>> import bigframes.pandas as bpd
423431
>>> s = bpd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
424432
>>> s = bpd.to_datetime(s, utc=True, format="%m/%d/%Y %H:%M:%S%Ez")
425433
>>> s
@@ -441,6 +449,7 @@ def unit(self) -> str:
441449
442450
**Examples:**
443451
452+
>>> import bigframes.pandas as bpd
444453
>>> s = bpd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
445454
>>> s = bpd.to_datetime(s, utc=True, format="%m/%d/%Y %H:%M:%S%Ez")
446455
>>> s

third_party/bigframes_vendored/pandas/core/indexes/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ def drop_duplicates(self, *, keep: str = "first"):
10031003
10041004
**Examples:**
10051005
1006+
>>> import bigframes.pandas as bpd
10061007
10071008
Generate an pandas.Index with duplicate values.
10081009

0 commit comments

Comments
 (0)