Skip to content

Commit 290c58a

Browse files
nagesh-chowdaiahnagesh-kumar-abinbevjorisvandenbosschesimonjayhawkins
authored
DOC: Updated resample.py and groupby.py to fix SA04 Errors (#37219)
* DOC: Updated resample.py and groupby.py to fix SA04 Errors * DOC: Fixed flake8 issue * #28792 DOC: Fixed SA04 Errors * #28792 Doc Fix SA04 Errors * Update pandas/core/arrays/integer.py Co-authored-by: Joris Van den Bossche <[email protected]> * Update pandas/core/arrays/boolean.py Co-authored-by: Joris Van den Bossche <[email protected]> * #28792 DOC: udpated reviewers comments * #28792 DOC: Fixing flake8 Errors Co-authored-by: Nagesh Kumar C <[email protected]> Co-authored-by: Joris Van den Bossche <[email protected]> Co-authored-by: Simon Hawkins <[email protected]>
1 parent 10e5ad7 commit 290c58a

File tree

14 files changed

+83
-58
lines changed

14 files changed

+83
-58
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,8 @@ cdef class _Timedelta(timedelta):
10561056

10571057
See Also
10581058
--------
1059-
Timestamp.isoformat
1059+
Timestamp.isoformat : Function is used to convert the given
1060+
Timestamp object into the ISO format.
10601061

10611062
Notes
10621063
-----

pandas/core/arrays/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ def _from_factorized(cls, values, original):
232232
233233
See Also
234234
--------
235-
factorize
236-
ExtensionArray.factorize
235+
factorize : Top-level factorize method that dispatches here.
236+
ExtensionArray.factorize : Encode the extension array as an enumerated type.
237237
"""
238238
raise AbstractMethodError(cls)
239239

@@ -501,7 +501,7 @@ def _values_for_argsort(self) -> np.ndarray:
501501
502502
See Also
503503
--------
504-
ExtensionArray.argsort
504+
ExtensionArray.argsort : Return the indices that would sort this array.
505505
"""
506506
# Note: this is used in `ExtensionArray.argsort`.
507507
return np.array(self)
@@ -968,8 +968,8 @@ def take(
968968
969969
See Also
970970
--------
971-
numpy.take
972-
api.extensions.take
971+
numpy.take : Take elements from an array along an axis.
972+
api.extensions.take : Take elements from an array.
973973
974974
Notes
975975
-----

pandas/core/arrays/boolean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def _values_for_argsort(self) -> np.ndarray:
418418
419419
See Also
420420
--------
421-
ExtensionArray.argsort
421+
ExtensionArray.argsort : Return the indices that would sort this array.
422422
"""
423423
data = self._data.copy()
424424
data[self._mask] = -1

pandas/core/arrays/categorical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ def unique(self):
20612061
--------
20622062
pandas.unique
20632063
CategoricalIndex.unique
2064-
Series.unique
2064+
Series.unique : Return unique values of Series object.
20652065
20662066
Examples
20672067
--------

pandas/core/arrays/datetimes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,10 @@ def isocalendar(self):
12611261
12621262
See Also
12631263
--------
1264-
Timestamp.isocalendar
1265-
datetime.date.isocalendar
1264+
Timestamp.isocalendar : Function return a 3-tuple containing ISO year,
1265+
week number, and weekday for the given Timestamp object.
1266+
datetime.date.isocalendar : Return a named tuple object with
1267+
three components: year, week and weekday.
12661268
12671269
Examples
12681270
--------

pandas/core/arrays/integer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def _values_for_argsort(self) -> np.ndarray:
484484
485485
See Also
486486
--------
487-
ExtensionArray.argsort
487+
ExtensionArray.argsort : Return the indices that would sort this array.
488488
"""
489489
data = self._data.copy()
490490
if self._mask.any():

pandas/core/dtypes/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ class ExtensionDtype:
2121
2222
See Also
2323
--------
24-
extensions.register_extension_dtype
25-
extensions.ExtensionArray
24+
extensions.register_extension_dtype: Register an ExtensionType
25+
with pandas as class decorator.
26+
extensions.ExtensionArray: Abstract base class for custom 1-D array types.
2627
2728
Notes
2829
-----

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def shape(self) -> Tuple[int, int]:
589589
590590
See Also
591591
--------
592-
ndarray.shape
592+
ndarray.shape : Tuple of array dimensions.
593593
594594
Examples
595595
--------

pandas/core/generic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def attrs(self) -> Dict[Optional[Hashable], Any]:
260260
261261
See Also
262262
--------
263-
DataFrame.flags
263+
DataFrame.flags : Global flags applying to this object.
264264
"""
265265
if self._attrs is None:
266266
self._attrs = {}
@@ -281,8 +281,8 @@ def flags(self) -> Flags:
281281
282282
See Also
283283
--------
284-
Flags
285-
DataFrame.attrs
284+
Flags : Flags that apply to pandas objects.
285+
DataFrame.attrs : Global metadata applying to this dataset.
286286
287287
Notes
288288
-----

pandas/core/groupby/groupby.py

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ class providing the base-class of operations.
7979
_common_see_also = """
8080
See Also
8181
--------
82-
Series.%(name)s
83-
DataFrame.%(name)s
82+
Series.%(name)s : Apply a function %(name)s to a Series.
83+
DataFrame.%(name)s : Apply a function %(name)s
84+
to each row or column of a DataFrame.
8485
"""
8586

8687
_apply_docs = dict(
@@ -318,9 +319,12 @@ class providing the base-class of operations.
318319
319320
See Also
320321
--------
321-
%(klass)s.groupby.apply
322-
%(klass)s.groupby.aggregate
323-
%(klass)s.transform
322+
%(klass)s.groupby.apply : Apply function func group-wise
323+
and combine the results together.
324+
%(klass)s.groupby.aggregate : Aggregate using one or more
325+
operations over the specified axis.
326+
%(klass)s.transform : Transforms the Series on each group
327+
based on the given function.
324328
325329
Notes
326330
-----
@@ -427,9 +431,12 @@ class providing the base-class of operations.
427431
428432
See Also
429433
--------
430-
{klass}.groupby.apply
431-
{klass}.groupby.transform
432-
{klass}.aggregate
434+
{klass}.groupby.apply : Apply function func group-wise
435+
and combine the results together.
436+
{klass}.groupby.transform : Aggregate using one or more
437+
operations over the specified axis.
438+
{klass}.aggregate : Transforms the Series on each group
439+
based on the given function.
433440
434441
Notes
435442
-----
@@ -1871,8 +1878,8 @@ def _fill(self, direction, limit=None):
18711878
18721879
See Also
18731880
--------
1874-
pad
1875-
backfill
1881+
pad : Returns Series with minimum number of char in object.
1882+
backfill : Backward fill the missing values in the dataset.
18761883
"""
18771884
# Need int value for Cython
18781885
if limit is None:
@@ -1906,10 +1913,10 @@ def pad(self, limit=None):
19061913
19071914
See Also
19081915
--------
1909-
Series.pad
1910-
DataFrame.pad
1911-
Series.fillna
1912-
DataFrame.fillna
1916+
Series.pad: Returns Series with minimum number of char in object.
1917+
DataFrame.pad: Object with missing values filled or None if inplace=True.
1918+
Series.fillna: Fill NaN values of a Series.
1919+
DataFrame.fillna: Fill NaN values of a DataFrame.
19131920
"""
19141921
return self._fill("ffill", limit=limit)
19151922

@@ -1932,10 +1939,10 @@ def backfill(self, limit=None):
19321939
19331940
See Also
19341941
--------
1935-
Series.backfill
1936-
DataFrame.backfill
1937-
Series.fillna
1938-
DataFrame.fillna
1942+
Series.backfill : Backward fill the missing values in the dataset.
1943+
DataFrame.backfill: Backward fill the missing values in the dataset.
1944+
Series.fillna: Fill NaN values of a Series.
1945+
DataFrame.fillna: Fill NaN values of a DataFrame.
19391946
"""
19401947
return self._fill("bfill", limit=limit)
19411948

0 commit comments

Comments
 (0)