Skip to content

docs: fix the note rendering for DataFrames methods: nlargest, nsmallest #417

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 4 commits into from
Mar 7, 2024
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
21 changes: 11 additions & 10 deletions third_party/bigframes_vendored/pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3935,6 +3935,11 @@ def nlargest(self, n: int, columns, keep: str = "first"):
``df.sort_values(columns, ascending=False).head(n)``, but more
performant.

.. note::
This function cannot be used with all column types. For example, when
specifying columns with `object` or `category` dtypes, ``TypeError`` is
raised.

**Examples:**

>>> import bigframes.pandas as bpd
Expand Down Expand Up @@ -4002,11 +4007,6 @@ def nlargest(self, n: int, columns, keep: str = "first"):

Returns:
DataFrame: The first `n` rows ordered by the given columns in descending order.

.. note::
This function cannot be used with all column types. For example, when
specifying columns with `object` or `category` dtypes, ``TypeError`` is
raised.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand All @@ -4022,6 +4022,12 @@ def nsmallest(self, n: int, columns, keep: str = "first"):
``df.sort_values(columns, ascending=True).head(n)``, but more
performant.

.. note::

This function cannot be used with all column types. For example, when
specifying columns with `object` or `category` dtypes, ``TypeError`` is
raised.

**Examples:**

>>> import bigframes.pandas as bpd
Expand Down Expand Up @@ -4090,11 +4096,6 @@ def nsmallest(self, n: int, columns, keep: str = "first"):

Returns:
DataFrame: The first `n` rows ordered by the given columns in ascending order.

.. note::
This function cannot be used with all column types. For example, when
specifying columns with `object` or `category` dtypes, ``TypeError`` is
raised.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down