Skip to content

Commit 2931f02

Browse files
tolaa001simonjayhawkins
authored andcommitted
PR06 doc string fixes (#28946)
1 parent 0eee324 commit 2931f02

File tree

17 files changed

+32
-31
lines changed

17 files changed

+32
-31
lines changed

pandas/core/computation/eval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ def eval(
198198
<https://docs.python.org/3/reference/simple_stmts.html#simple-statements>`__,
199199
only Python `expressions
200200
<https://docs.python.org/3/reference/simple_stmts.html#expression-statements>`__.
201-
parser : string, default 'pandas', {'pandas', 'python'}
201+
parser : {'pandas', 'python'}, default 'pandas'
202202
The parser to use to construct the syntax tree from the expression. The
203203
default of ``'pandas'`` parses code slightly different than standard
204204
Python. Alternatively, you can parse an expression using the
205205
``'python'`` parser to retain strict Python semantics. See the
206206
:ref:`enhancing performance <enhancingperf.eval>` documentation for
207207
more details.
208-
engine : string or None, default 'numexpr', {'python', 'numexpr'}
208+
engine : {'python', 'numexpr'}, default 'numexpr'
209209
210210
The engine used to evaluate the expression. Supported engines are
211211

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6238,7 +6238,7 @@ def unstack(self, level=-1, fill_value=None):
62386238
----------
62396239
level : int, str, or list of these, default -1 (last level)
62406240
Level(s) of index to unstack, can pass level name.
6241-
fill_value : int, string or dict
6241+
fill_value : int, str or dict
62426242
Replace NaN with this value if the unstack produces missing values.
62436243
62446244
Returns

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,7 @@ def to_json(
23532353
23542354
.. versionadded:: 0.23.0
23552355
2356-
indent : integer, optional
2356+
indent : int, optional
23572357
Length of whitespace used to indent each record.
23582358
23592359
.. versionadded:: 1.0.0

pandas/core/groupby/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ def nunique(self, dropna=True):
16441644
16451645
Parameters
16461646
----------
1647-
dropna : boolean, default True
1647+
dropna : bool, default True
16481648
Don't include NaN in the counts.
16491649
16501650
Returns

pandas/core/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4531,7 +4531,7 @@ def shift(self, periods=1, freq=None):
45314531
periods : int, default 1
45324532
Number of periods (or increments) to shift by,
45334533
can be positive or negative.
4534-
freq : pandas.DateOffset, pandas.Timedelta or string, optional
4534+
freq : pandas.DateOffset, pandas.Timedelta or str, optional
45354535
Frequency increment to shift by.
45364536
If None, the index is shifted by its own `freq` attribute.
45374537
Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc.

pandas/core/indexes/category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class CategoricalIndex(Index, accessor.PandasDelegate):
7777
Whether or not this categorical is treated as an ordered
7878
categorical. If not given here or in `dtype`, the resulting
7979
categorical will be unordered.
80-
dtype : CategoricalDtype or the string "category", optional
80+
dtype : CategoricalDtype or "category", optional
8181
If :class:`CategoricalDtype`, cannot be used together with
8282
`categories` or `ordered`.
8383

pandas/core/indexes/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ def indexer_at_time(self, time, asof=False):
13281328
13291329
Parameters
13301330
----------
1331-
time : datetime.time or string
1331+
time : datetime.time or str
13321332
datetime.time or string in appropriate format ("%H:%M", "%H%M",
13331333
"%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p",
13341334
"%I%M%S%p").

pandas/core/indexes/interval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,11 +1412,11 @@ def interval_range(
14121412
Right bound for generating intervals
14131413
periods : int, default None
14141414
Number of periods to generate
1415-
freq : numeric, string, or DateOffset, default None
1415+
freq : numeric, str, or DateOffset, default None
14161416
The length of each interval. Must be consistent with the type of start
14171417
and end, e.g. 2 for numeric, or '5H' for datetime-like. Default is 1
14181418
for numeric and 'D' for datetime-like.
1419-
name : string, default None
1419+
name : str, default None
14201420
Name of the resulting IntervalIndex
14211421
closed : {'left', 'right', 'both', 'neither'}, default 'right'
14221422
Whether the intervals are closed on the left-side, right-side, both

pandas/core/indexes/multi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ def to_frame(self, index=True, name=None):
16501650
16511651
Parameters
16521652
----------
1653-
index : boolean, default True
1653+
index : bool, default True
16541654
Set the index of the returned DataFrame as the original MultiIndex.
16551655
16561656
name : list / sequence of strings, optional
@@ -2334,7 +2334,7 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True):
23342334
level : list-like, int or str, default 0
23352335
If a string is given, must be a name of the level
23362336
If list-like must be names or ints of levels.
2337-
ascending : boolean, default True
2337+
ascending : bool, default True
23382338
False to sort in descending order
23392339
Can also be a list to specify a directed ordering
23402340
sort_remaining : sort by the remaining levels after level

pandas/core/reshape/tile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ def qcut(x, q, labels=None, retbins=False, precision=3, duplicates="raise"):
285285
Parameters
286286
----------
287287
x : 1d ndarray or Series
288-
q : integer or array of quantiles
288+
q : int or list-like of int
289289
Number of quantiles. 10 for deciles, 4 for quartiles, etc. Alternately
290290
array of quantiles, e.g. [0, .25, .5, .75, 1.] for quartiles
291-
labels : array or boolean, default None
291+
labels : array or bool, default None
292292
Used as labels for the resulting bins. Must be of the same length as
293293
the resulting bins. If False, return only integer indicators of the
294294
bins.

0 commit comments

Comments
 (0)