Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve API documentation #489

Merged
merged 6 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def strftime(self, date_format: str):
Date format string (e.g. "%Y-%m-%d").

Returns:
bigframes.series.Series of formatted strings.
bigframes.series.Series: Series of formatted strings.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down
33 changes: 16 additions & 17 deletions third_party/bigframes_vendored/pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ def align(

Args:
other (DataFrame or Series):
join ({{'outer', 'inner', 'left', 'right'}}, default 'outer'):
join ({'outer', 'inner', 'left', 'right'}, default 'outer'):
Type of alignment to be performed.
left: use only keys from left frame, preserve key order.
right: use only keys from right frame, preserve key order.
Expand Down Expand Up @@ -1627,9 +1627,6 @@ def keys(self):

This is index for Series, columns for DataFrame.

Returns:
Index: Info axis.

**Examples:**

>>> import bigframes.pandas as bpd
Expand All @@ -1641,6 +1638,9 @@ def keys(self):
... })
>>> df.keys()
Index(['A', 'B'], dtype='object')

Returns:
Index: Info axis.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down Expand Up @@ -1673,6 +1673,17 @@ def itertuples(self, index: bool = True, name: str | None = "Pandas"):
"""
Iterate over DataFrame rows as namedtuples.

**Examples:**

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = None
>>> df = bpd.DataFrame({
... 'A': [1, 2, 3],
... 'B': [4, 5, 6],
... })
>>> next(df.itertuples(name="Pair"))
Pair(Index=0, A=1, B=4)

Args:
index (bool, default True):
If True, return the index as the first element of the tuple.
Expand All @@ -1685,18 +1696,6 @@ def itertuples(self, index: bool = True, name: str | None = "Pandas"):
An object to iterate over namedtuples for each row in the
DataFrame with the first field possibly being the index and
following fields being the column values.


**Examples:**

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = None
>>> df = bpd.DataFrame({
... 'A': [1, 2, 3],
... 'B': [4, 5, 6],
... })
>>> next(df.itertuples(name="Pair"))
Pair(Index=0, A=1, B=4)
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down Expand Up @@ -3155,7 +3154,7 @@ def join(self, other, *, on: Optional[str] = None, how: str) -> DataFrame:
on:
Column in the caller to join on the index in other, otherwise
joins index-on-index. Like an Excel VLOOKUP operation.
how ({'left', 'right', 'outer', 'inner'}, default 'left'`):
how ({'left', 'right', 'outer', 'inner'}, default 'left'):
How to handle the operation of the two objects.
``left``: use calling frame's index (or column if on is specified)
``right``: use `other`'s index. ``outer``: form union of calling
Expand Down