Skip to content

Commit 944e26e

Browse files
danielplawrenceWillAyd
authored andcommitted
DOC: Fix PR06 errors in Series docstrings (#28253) (#28288)
1 parent d92b46f commit 944e26e

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

pandas/core/base.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1289,17 +1289,17 @@ def value_counts(
12891289
12901290
Parameters
12911291
----------
1292-
normalize : boolean, default False
1292+
normalize : bool, default False
12931293
If True then the object returned will contain the relative
12941294
frequencies of the unique values.
1295-
sort : boolean, default True
1295+
sort : bool, default True
12961296
Sort by frequencies.
1297-
ascending : boolean, default False
1297+
ascending : bool, default False
12981298
Sort in ascending order.
1299-
bins : integer, optional
1299+
bins : int, optional
13001300
Rather than count values, group them into half-open bins,
13011301
a convenience for ``pd.cut``, only works with numeric data.
1302-
dropna : boolean, default True
1302+
dropna : bool, default True
13031303
Don't include counts of NaN.
13041304
13051305
Returns
@@ -1496,7 +1496,7 @@ def memory_usage(self, deep=False):
14961496
size_hint="",
14971497
sort=textwrap.dedent(
14981498
"""\
1499-
sort : boolean, default False
1499+
sort : bool, default False
15001500
Sort `uniques` and shuffle `labels` to maintain the
15011501
relationship.
15021502
"""

pandas/core/generic.py

+18-15
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,7 @@ def to_json(
23102310
floating point values.
23112311
force_ascii : bool, default True
23122312
Force encoded string to be ASCII.
2313-
date_unit : string, default 'ms' (milliseconds)
2313+
date_unit : str, default 'ms' (milliseconds)
23142314
The time unit to encode to, governs timestamp and ISO8601
23152315
precision. One of 's', 'ms', 'us', 'ns' for second, millisecond,
23162316
microsecond, and nanosecond respectively.
@@ -2530,8 +2530,9 @@ def to_msgpack(self, path_or_buf=None, encoding="utf-8", **kwargs):
25302530
25312531
Parameters
25322532
----------
2533-
path : string File path, buffer-like, or None
2534-
if None, return generated bytes
2533+
path : str, buffer-like, or None
2534+
Destination for the serialized object.
2535+
If None, return generated bytes
25352536
append : bool whether to append to an existing msgpack
25362537
(default is False)
25372538
compress : type of compressor (zlib or blosc), default to None (no
@@ -4618,8 +4619,9 @@ def filter(self, items=None, like=None, regex=None, axis=None):
46184619
Keep labels from axis for which "like in label == True".
46194620
regex : str (regular expression)
46204621
Keep labels from axis for which re.search(regex, label) == True.
4621-
axis : int or string axis name
4622-
The axis to filter on. By default this is the info axis,
4622+
axis : {0 or ‘index’, 1 or ‘columns’, None}, default None
4623+
The axis to filter on, expressed either as an index (int)
4624+
or axis name (str). By default this is the info axis,
46234625
'index' for Series, 'columns' for DataFrame.
46244626
46254627
Returns
@@ -4852,7 +4854,7 @@ def sample(
48524854
random_state : int or numpy.random.RandomState, optional
48534855
Seed for the random number generator (if int), or numpy RandomState
48544856
object.
4855-
axis : int or string, optional
4857+
axis : {0 or ‘index’, 1 or ‘columns’, None}, default None
48564858
Axis to sample. Accepts axis number or name. Default is stat axis
48574859
for given data type (0 for Series and DataFrames).
48584860
@@ -8456,7 +8458,7 @@ def first(self, offset):
84568458
84578459
Parameters
84588460
----------
8459-
offset : string, DateOffset, dateutil.relativedelta
8461+
offset : str, DateOffset, dateutil.relativedelta
84608462
84618463
Returns
84628464
-------
@@ -8519,7 +8521,7 @@ def last(self, offset):
85198521
85208522
Parameters
85218523
----------
8522-
offset : string, DateOffset, dateutil.relativedelta
8524+
offset : str, DateOffset, dateutil.relativedelta
85238525
85248526
Returns
85258527
-------
@@ -9127,7 +9129,7 @@ def _where(
91279129
91289130
Parameters
91299131
----------
9130-
cond : boolean %(klass)s, array-like, or callable
9132+
cond : bool %(klass)s, array-like, or callable
91319133
Where `cond` is %(cond)s, keep the original value. Where
91329134
%(cond_rev)s, replace with corresponding value from `other`.
91339135
If `cond` is callable, it is computed on the %(klass)s and
@@ -9434,9 +9436,10 @@ def tshift(self, periods=1, freq=None, axis=0):
94349436
----------
94359437
periods : int
94369438
Number of periods to move, can be positive or negative
9437-
freq : DateOffset, timedelta, or time rule string, default None
9438-
Increment to use from the tseries module or time rule (e.g. 'EOM')
9439-
axis : int or basestring
9439+
freq : DateOffset, timedelta, or str, default None
9440+
Increment to use from the tseries module
9441+
or time rule expressed as a string (e.g. 'EOM')
9442+
axis : {0 or ‘index’, 1 or ‘columns’, None}, default 0
94409443
Corresponds to the axis that contains the Index
94419444
94429445
Returns
@@ -9494,9 +9497,9 @@ def truncate(self, before=None, after=None, axis=None, copy=True):
94949497
94959498
Parameters
94969499
----------
9497-
before : date, string, int
9500+
before : date, str, int
94989501
Truncate all rows before this index value.
9499-
after : date, string, int
9502+
after : date, str, int
95009503
Truncate all rows after this index value.
95019504
axis : {0 or 'index', 1 or 'columns'}, optional
95029505
Axis to truncate. Truncates the index (rows) by default.
@@ -10305,7 +10308,7 @@ def _check_percentile(self, q):
1030510308
How to handle NAs before computing percent changes.
1030610309
limit : int, default None
1030710310
The number of consecutive NAs to fill before stopping.
10308-
freq : DateOffset, timedelta, or offset alias string, optional
10311+
freq : DateOffset, timedelta, or str, optional
1030910312
Increment to use from time series API (e.g. 'M' or BDay()).
1031010313
**kwargs
1031110314
Additional keyword arguments are passed into

pandas/core/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ def to_sparse(self, kind="block", fill_value=None):
17851785
17861786
Parameters
17871787
----------
1788-
kind : {'block', 'integer'}, default 'block'
1788+
kind : {'block', 'int'}, default 'block'
17891789
fill_value : float, defaults to NaN (missing)
17901790
Value to use for filling NaN values.
17911791

pandas/plotting/_core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ def kde(self, bw_method=None, ind=None, **kwargs):
11431143
'scott', 'silverman', a scalar constant or a callable.
11441144
If None (default), 'scott' is used.
11451145
See :class:`scipy.stats.gaussian_kde` for more information.
1146-
ind : NumPy array or integer, optional
1146+
ind : NumPy array or int, optional
11471147
Evaluation points for the estimated PDF. If None (default),
11481148
1000 equally spaced points are used. If `ind` is a NumPy array, the
11491149
KDE is evaluated at the points passed. If `ind` is an integer,

0 commit comments

Comments
 (0)