Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 38bd2ba

Browse files
authoredMar 7, 2024
docs: fix the note rendering for DataFrames methods: nlargest, nsmallest (#417)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes internal issue #328445384 🦕
1 parent 76b252f commit 38bd2ba

File tree

1 file changed

+11
-10
lines changed
  • third_party/bigframes_vendored/pandas/core

1 file changed

+11
-10
lines changed
 

‎third_party/bigframes_vendored/pandas/core/frame.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -3935,6 +3935,11 @@ def nlargest(self, n: int, columns, keep: str = "first"):
39353935
``df.sort_values(columns, ascending=False).head(n)``, but more
39363936
performant.
39373937
3938+
.. note::
3939+
This function cannot be used with all column types. For example, when
3940+
specifying columns with `object` or `category` dtypes, ``TypeError`` is
3941+
raised.
3942+
39383943
**Examples:**
39393944
39403945
>>> import bigframes.pandas as bpd
@@ -4002,11 +4007,6 @@ def nlargest(self, n: int, columns, keep: str = "first"):
40024007
40034008
Returns:
40044009
DataFrame: The first `n` rows ordered by the given columns in descending order.
4005-
4006-
.. note::
4007-
This function cannot be used with all column types. For example, when
4008-
specifying columns with `object` or `category` dtypes, ``TypeError`` is
4009-
raised.
40104010
"""
40114011
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
40124012

@@ -4022,6 +4022,12 @@ def nsmallest(self, n: int, columns, keep: str = "first"):
40224022
``df.sort_values(columns, ascending=True).head(n)``, but more
40234023
performant.
40244024
4025+
.. note::
4026+
4027+
This function cannot be used with all column types. For example, when
4028+
specifying columns with `object` or `category` dtypes, ``TypeError`` is
4029+
raised.
4030+
40254031
**Examples:**
40264032
40274033
>>> import bigframes.pandas as bpd
@@ -4090,11 +4096,6 @@ def nsmallest(self, n: int, columns, keep: str = "first"):
40904096
40914097
Returns:
40924098
DataFrame: The first `n` rows ordered by the given columns in ascending order.
4093-
4094-
.. note::
4095-
This function cannot be used with all column types. For example, when
4096-
specifying columns with `object` or `category` dtypes, ``TypeError`` is
4097-
raised.
40984099
"""
40994100
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
41004101

0 commit comments

Comments
 (0)
Failed to load comments.