Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

docs: add examples for dataframe.cummin, dataframe.cummax, dataframe.… #243

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

Merged
merged 3 commits into from
Dec 1, 2023
Merged
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
96 changes: 92 additions & 4 deletions 96 third_party/bigframes_vendored/pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3367,40 +3367,128 @@ def nunique(self):
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def cummin(self) -> DataFrame:
"""Return cumulative minimum over a DataFrame axis.
"""Return cumulative minimum over columns.

Returns a DataFrame of the same size containing the cumulative minimum.

**Examples:**

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = None

>>> df = bpd.DataFrame({"A": [3, 1, 2], "B": [1, 2, 3]})
>>> df
A B
0 3 1
1 1 2
2 2 3
<BLANKLINE>
[3 rows x 2 columns]

>>> df.cummin()
A B
0 3 1
1 1 1
2 1 1
<BLANKLINE>
[3 rows x 2 columns]

Returns:
bigframes.dataframe.DataFrame: Return cumulative minimum of DataFrame.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def cummax(self) -> DataFrame:
"""Return cumulative maximum over a DataFrame axis.
"""Return cumulative maximum over columns.

Returns a DataFrame of the same size containing the cumulative maximum.

**Examples:**

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = None

>>> df = bpd.DataFrame({"A": [3, 1, 2], "B": [1, 2, 3]})
>>> df
A B
0 3 1
1 1 2
2 2 3
<BLANKLINE>
[3 rows x 2 columns]

>>> df.cummax()
A B
0 3 1
1 3 2
2 3 3
<BLANKLINE>
[3 rows x 2 columns]

Returns:
bigframes.dataframe.DataFrame: Return cumulative maximum of DataFrame.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def cumsum(self) -> DataFrame:
"""Return cumulative sum over a DataFrame axis.
"""Return cumulative sum over columns.

Returns a DataFrame of the same size containing the cumulative sum.

**Examples:**

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = None

>>> df = bpd.DataFrame({"A": [3, 1, 2], "B": [1, 2, 3]})
>>> df
A B
0 3 1
1 1 2
2 2 3
<BLANKLINE>
[3 rows x 2 columns]

>>> df.cumsum()
A B
0 3 1
1 4 3
2 6 6
<BLANKLINE>
[3 rows x 2 columns]

Returns:
bigframes.dataframe.DataFrame: Return cumulative sum of DataFrame.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def cumprod(self) -> DataFrame:
"""Return cumulative product over a DataFrame axis.
"""Return cumulative product over columns.

Returns a DataFrame of the same size containing the cumulative product.

**Examples:**

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = None

>>> df = bpd.DataFrame({"A": [3, 1, 2], "B": [1, 2, 3]})
>>> df
A B
0 3 1
1 1 2
2 2 3
<BLANKLINE>
[3 rows x 2 columns]

>>> df.cumprod()
A B
0 3 1
1 3 2
2 6 6
<BLANKLINE>
[3 rows x 2 columns]

Returns:
bigframes.dataframe.DataFrame: Return cumulative product of DataFrame.
"""
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.