Skip to content

Commit 0748c91

Browse files
tolaa001simonjayhawkins
authored andcommitted
DOC: PR06 docstring fixes (#28807)
1 parent a31e160 commit 0748c91

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

pandas/core/arrays/categorical.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None):
636636
637637
Parameters
638638
----------
639-
codes : array-like, integers
639+
codes : array-like of int
640640
An integer array, where each integer points to a category in
641641
categories or dtype.categories, or else is -1 for NaN.
642642
categories : index-like, optional
@@ -647,7 +647,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None):
647647
Whether or not this categorical is treated as an ordered
648648
categorical. If not given here or in `dtype`, the resulting
649649
categorical will be unordered.
650-
dtype : CategoricalDtype or the string "category", optional
650+
dtype : CategoricalDtype or "category", optional
651651
If :class:`CategoricalDtype`, cannot be used together with
652652
`categories` or `ordered`.
653653

pandas/core/arrays/datetimelike.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def value_counts(self, dropna=False):
670670
671671
Parameters
672672
----------
673-
dropna : boolean, default True
673+
dropna : bool, default True
674674
Don't include counts of NaT values.
675675
676676
Returns
@@ -728,7 +728,7 @@ def _maybe_mask_results(self, result, fill_value=iNaT, convert=None):
728728
----------
729729
result : a ndarray
730730
fill_value : object, default iNaT
731-
convert : string/dtype or None
731+
convert : str, dtype or None
732732
733733
Returns
734734
-------
@@ -1168,7 +1168,7 @@ def _time_shift(self, periods, freq=None):
11681168
----------
11691169
periods : int
11701170
Number of periods to shift by.
1171-
freq : pandas.DateOffset, pandas.Timedelta, or string
1171+
freq : pandas.DateOffset, pandas.Timedelta, or str
11721172
Frequency increment to shift by.
11731173
"""
11741174
if freq is not None and freq != self.freq:

pandas/core/arrays/integer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def integer_array(values, dtype=None, copy=False):
9595
values : 1D list-like
9696
dtype : dtype, optional
9797
dtype to coerce
98-
copy : boolean, default False
98+
copy : bool, default False
9999
100100
Returns
101101
-------
@@ -140,8 +140,8 @@ def coerce_to_array(values, dtype, mask=None, copy=False):
140140
----------
141141
values : 1D list-like
142142
dtype : integer dtype
143-
mask : boolean 1D array, optional
144-
copy : boolean, default False
143+
mask : bool 1D array, optional
144+
copy : bool, default False
145145
if True, copy the input
146146
147147
Returns
@@ -542,7 +542,7 @@ def value_counts(self, dropna=True):
542542
543543
Parameters
544544
----------
545-
dropna : boolean, default True
545+
dropna : bool, default True
546546
Don't include counts of NaN.
547547
548548
Returns

pandas/core/arrays/period.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def to_timestamp(self, freq=None, how="start"):
444444
445445
Parameters
446446
----------
447-
freq : string or DateOffset, optional
447+
freq : str or DateOffset, optional
448448
Target frequency. The default is 'D' for week or longer,
449449
'S' otherwise
450450
how : {'s', 'e', 'start', 'end'}
@@ -515,7 +515,7 @@ def _time_shift(self, periods, freq=None):
515515
----------
516516
periods : int
517517
Number of periods to shift by.
518-
freq : pandas.DateOffset, pandas.Timedelta, or string
518+
freq : pandas.DateOffset, pandas.Timedelta, or str
519519
Frequency increment to shift by.
520520
"""
521521
if freq is not None:

pandas/core/dtypes/cast.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ def maybe_infer_to_datetimelike(value, convert_dates=False):
10061006
Parameters
10071007
----------
10081008
value : np.array / Series / Index / list-like
1009-
convert_dates : boolean, default False
1009+
convert_dates : bool, default False
10101010
if True try really hard to convert dates (such as datetime.date), other
10111011
leave inferred dtype 'date' alone
10121012
@@ -1439,7 +1439,7 @@ def maybe_cast_to_integer_array(arr, dtype, copy=False):
14391439
The array to cast.
14401440
dtype : str, np.dtype
14411441
The integer dtype to cast the array to.
1442-
copy: boolean, default False
1442+
copy: bool, default False
14431443
Whether to make a copy of the array before returning.
14441444
14451445
Returns

pandas/core/dtypes/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def ensure_int_or_float(arr: ArrayLike, copy: bool = False) -> np.array:
152152
----------
153153
arr : array-like
154154
The array whose data type we want to enforce.
155-
copy: boolean
155+
copy: bool
156156
Whether to copy the original array or reuse
157157
it in place, if possible.
158158

pandas/core/dtypes/concat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ def union_categoricals(to_union, sort_categories=False, ignore_order=False):
192192
----------
193193
to_union : list-like of Categorical, CategoricalIndex,
194194
or Series with dtype='category'
195-
sort_categories : boolean, default False
195+
sort_categories : bool, default False
196196
If true, resulting categories will be lexsorted, otherwise
197197
they will be ordered as they appear in the data.
198-
ignore_order : boolean, default False
198+
ignore_order : bool, default False
199199
If true, the ordered attribute of the Categoricals will be ignored.
200200
Results in an unordered categorical.
201201

pandas/core/dtypes/dtypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def find(
8585
"""
8686
Parameters
8787
----------
88-
dtype : Type[ExtensionDtype] or string
88+
dtype : Type[ExtensionDtype] or str
8989
9090
Returns
9191
-------

pandas/core/dtypes/missing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def na_value_for_dtype(dtype, compat=True):
521521
Parameters
522522
----------
523523
dtype : string / dtype
524-
compat : boolean, default True
524+
compat : bool, default True
525525
526526
Returns
527527
-------

0 commit comments

Comments
 (0)