From 362e4ff6b2cfc8945294508049d381cefaa373de Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi Date: Sat, 22 Feb 2020 14:53:04 -0300 Subject: [PATCH 1/2] DOC: Fix SA04 errors in docstrings #28792 --- pandas/core/computation/eval.py | 6 ++++-- pandas/core/generic.py | 17 ++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index f6947d5ec6233..56e7e081729a7 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -266,8 +266,10 @@ def eval( See Also -------- - DataFrame.query - DataFrame.eval + DataFrame.query : Evaluates a boolean expression to query the columns + of a frame. + DataFrame.eval : Evaluate a string describing operations on + DataFrame columns. Notes ----- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 40e59f04192a6..ee2002a669fe6 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -1746,8 +1746,9 @@ def empty(self) -> bool_t: See Also -------- - Series.dropna - DataFrame.dropna + Series.dropna : Return series without null values. + DataFrame.dropna : Return DataFrame with labels on given axis omitted + where (all or any) data are missing. Notes ----- @@ -2166,7 +2167,7 @@ def to_json( See Also -------- - read_json + read_json : Convert a JSON string to pandas object. Notes ----- @@ -4447,7 +4448,8 @@ def filter( See Also -------- - DataFrame.loc + DataFrame.loc : Access a group of rows and columns + by label(s) or a boolean array. Notes ----- @@ -4879,9 +4881,10 @@ def sample( See Also -------- - DataFrame.apply - DataFrame.applymap - Series.map + DataFrame.apply : Apply a function along input axis of DataFrame. + DataFrame.applymap : Apply a function elementwise on a whole DataFrame. + Series.map : Apply a mapping correspondence on a + :class:`~pandas.Series`. Notes ----- From 5032edce205684e6308443e1a616c470196677fc Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi Date: Sun, 23 Feb 2020 11:43:04 -0300 Subject: [PATCH 2/2] DOC: Fix SA04 errors in docstrings #28792 --- pandas/core/base.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 56d3596f71813..3d92fd4562fc9 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -942,7 +942,8 @@ def argmax(self, axis=None, skipna=True, *args, **kwargs): See Also -------- - numpy.ndarray.argmax + numpy.ndarray.argmax : Return indices of the maximum values along + the given axis. """ nv.validate_minmax_axis(axis) nv.validate_argmax_with_skipna(skipna, args, kwargs) @@ -1005,7 +1006,8 @@ def argmin(self, axis=None, skipna=True, *args, **kwargs): See Also -------- - numpy.ndarray.argmin + numpy.ndarray.argmin : Return indices of the minimum values along + the given axis. """ nv.validate_minmax_axis(axis) nv.validate_argmax_with_skipna(skipna, args, kwargs) @@ -1025,7 +1027,8 @@ def tolist(self): See Also -------- - numpy.ndarray.tolist + numpy.ndarray.tolist : Return the array as an a.ndim-levels deep + nested list of Python scalars. """ if not isinstance(self._values, np.ndarray): # check for ndarray instead of dtype to catch DTA/TDA @@ -1371,7 +1374,8 @@ def memory_usage(self, deep=False): See Also -------- - numpy.ndarray.nbytes + numpy.ndarray.nbytes : Total bytes consumed by the elements of the + array. Notes ----- @@ -1442,8 +1446,8 @@ def factorize(self, sort=False, na_sentinel=-1): See Also -------- - sort_values - numpy.searchsorted + sort_values : Sort by the values along either axis. + numpy.searchsorted : Similar method from NumPy. Notes -----