Skip to content

Commit baf5df4

Browse files
danielplawrencedanlaw-amazon
authored andcommitted
DOC: Fix PR06 errors in Series docstrings (#28253)
1 parent 0bde7ce commit baf5df4

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
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

+16-14
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ def to_json(
23132313
floating point values.
23142314
force_ascii : bool, default True
23152315
Force encoded string to be ASCII.
2316-
date_unit : string, default 'ms' (milliseconds)
2316+
date_unit : str, default 'ms' (milliseconds)
23172317
The time unit to encode to, governs timestamp and ISO8601
23182318
precision. One of 's', 'ms', 'us', 'ns' for second, millisecond,
23192319
microsecond, and nanosecond respectively.
@@ -2533,7 +2533,7 @@ def to_msgpack(self, path_or_buf=None, encoding="utf-8", **kwargs):
25332533
25342534
Parameters
25352535
----------
2536-
path : string File path, buffer-like, or None
2536+
path : str (file path), buffer-like, or None
25372537
if None, return generated bytes
25382538
append : bool whether to append to an existing msgpack
25392539
(default is False)
@@ -4621,8 +4621,9 @@ def filter(self, items=None, like=None, regex=None, axis=None):
46214621
Keep labels from axis for which "like in label == True".
46224622
regex : str (regular expression)
46234623
Keep labels from axis for which re.search(regex, label) == True.
4624-
axis : int or string axis name
4625-
The axis to filter on. By default this is the info axis,
4624+
axis : int or str
4625+
The axis to filter on, expressed either as an index (int)
4626+
or axis name (str). By default this is the info axis,
46264627
'index' for Series, 'columns' for DataFrame.
46274628
46284629
Returns
@@ -4855,7 +4856,7 @@ def sample(
48554856
random_state : int or numpy.random.RandomState, optional
48564857
Seed for the random number generator (if int), or numpy RandomState
48574858
object.
4858-
axis : int or string, optional
4859+
axis : int or str, optional
48594860
Axis to sample. Accepts axis number or name. Default is stat axis
48604861
for given data type (0 for Series and DataFrames).
48614862
@@ -8462,7 +8463,7 @@ def first(self, offset):
84628463
84638464
Parameters
84648465
----------
8465-
offset : string, DateOffset, dateutil.relativedelta
8466+
offset : str, DateOffset, dateutil.relativedelta
84668467
84678468
Returns
84688469
-------
@@ -8525,7 +8526,7 @@ def last(self, offset):
85258526
85268527
Parameters
85278528
----------
8528-
offset : string, DateOffset, dateutil.relativedelta
8529+
offset : str, DateOffset, dateutil.relativedelta
85298530
85308531
Returns
85318532
-------
@@ -9133,7 +9134,7 @@ def _where(
91339134
91349135
Parameters
91359136
----------
9136-
cond : boolean %(klass)s, array-like, or callable
9137+
cond : bool %(klass)s, array-like, or callable
91379138
Where `cond` is %(cond)s, keep the original value. Where
91389139
%(cond_rev)s, replace with corresponding value from `other`.
91399140
If `cond` is callable, it is computed on the %(klass)s and
@@ -9440,9 +9441,10 @@ def tshift(self, periods=1, freq=None, axis=0):
94409441
----------
94419442
periods : int
94429443
Number of periods to move, can be positive or negative
9443-
freq : DateOffset, timedelta, or time rule string, default None
9444-
Increment to use from the tseries module or time rule (e.g. 'EOM')
9445-
axis : int or basestring
9444+
freq : DateOffset, timedelta, or str, default None
9445+
Increment to use from the tseries module
9446+
or time rule expressed as a string (e.g. 'EOM')
9447+
axis : int or str
94469448
Corresponds to the axis that contains the Index
94479449
94489450
Returns
@@ -9500,9 +9502,9 @@ def truncate(self, before=None, after=None, axis=None, copy=True):
95009502
95019503
Parameters
95029504
----------
9503-
before : date, string, int
9505+
before : date, str, int
95049506
Truncate all rows before this index value.
9505-
after : date, string, int
9507+
after : date, str, int
95069508
Truncate all rows after this index value.
95079509
axis : {0 or 'index', 1 or 'columns'}, optional
95089510
Axis to truncate. Truncates the index (rows) by default.
@@ -10311,7 +10313,7 @@ def _check_percentile(self, q):
1031110313
How to handle NAs before computing percent changes.
1031210314
limit : int, default None
1031310315
The number of consecutive NAs to fill before stopping.
10314-
freq : DateOffset, timedelta, or offset alias string, optional
10316+
freq : DateOffset, timedelta, or str, optional
1031510317
Increment to use from time series API (e.g. 'M' or BDay()).
1031610318
**kwargs
1031710319
Additional keyword arguments are passed into

pandas/core/series.py

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

pandas/plotting/_core.py

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

0 commit comments

Comments
 (0)