Skip to content

Commit 1a42c70

Browse files
srinivasreddyjreback
authored andcommitted
Add missing spacing before or after a param name in docstrings (#23738)
1 parent f8727ce commit 1a42c70

23 files changed

+130
-132
lines changed

pandas/_libs/tslibs/nattype.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ class NaTType(_NaT):
648648
minute : int, optional
649649
second : int, optional
650650
microsecond : int, optional
651-
nanosecond: int, optional
651+
nanosecond : int, optional
652652
tzinfo : tz-convertible, optional
653653
fold : int, optional, default is 0
654654
added in 3.6, NotImplemented

pandas/_libs/tslibs/period.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ cdef class _Period(object):
17771777
freq : string or DateOffset
17781778
Target frequency. Default is 'D' if self.freq is week or
17791779
longer and 'S' otherwise
1780-
how: str, default 'S' (start)
1780+
how : str, default 'S' (start)
17811781
'S', 'E'. Can be aliased as case insensitive
17821782
'Start', 'Finish', 'Begin', 'End'
17831783

pandas/_libs/tslibs/timestamps.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ class Timestamp(_Timestamp):
11551155
minute : int, optional
11561156
second : int, optional
11571157
microsecond : int, optional
1158-
nanosecond: int, optional
1158+
nanosecond : int, optional
11591159
tzinfo : tz-convertible, optional
11601160
fold : int, optional, default is 0
11611161
added in 3.6, NotImplemented

pandas/compat/pickle_compat.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ def load(fh, encoding=None, compat=False, is_verbose=False):
210210
211211
Parameters
212212
----------
213-
fh: a filelike object
214-
encoding: an optional encoding
215-
compat: provide Series compatibility mode, boolean, default False
216-
is_verbose: show exception output
213+
fh : a filelike object
214+
encoding : an optional encoding
215+
compat : provide Series compatibility mode, boolean, default False
216+
is_verbose : show exception output
217217
"""
218218

219219
try:

pandas/core/algorithms.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ def isin(comps, values):
387387
388388
Parameters
389389
----------
390-
comps: array-like
391-
values: array-like
390+
comps : array-like
391+
values : array-like
392392
393393
Returns
394394
-------
@@ -856,8 +856,8 @@ def rank(values, axis=0, method='average', na_option='keep',
856856
The method by which tiebreaks are broken during the ranking.
857857
na_option : {'keep', 'top'}, default 'keep'
858858
The method by which NaNs are placed in the ranking.
859-
- ``keep``: rank each NaN value with a NaN ranking
860-
- ``top``: replace each NaN with either +/- inf so that they
859+
- ``keep`` : rank each NaN value with a NaN ranking
860+
- ``top`` : replace each NaN with either +/- inf so that they
861861
there are ranked at the top
862862
ascending : boolean, default True
863863
Whether or not the elements should be ranked in ascending order.
@@ -1473,10 +1473,10 @@ def take(arr, indices, axis=0, allow_fill=False, fill_value=None):
14731473
allow_fill : bool, default False
14741474
How to handle negative values in `indices`.
14751475
1476-
* False: negative values in `indices` indicate positional indices
1476+
* False : negative values in `indices` indicate positional indices
14771477
from the right (the default). This is similar to :func:`numpy.take`.
14781478
1479-
* True: negative values in `indices` indicate
1479+
* True : negative values in `indices` indicate
14801480
missing values. These values are set to `fill_value`. Any other
14811481
other negative values raise a ``ValueError``.
14821482

pandas/core/arrays/datetimes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ def to_perioddelta(self, freq):
925925
926926
Parameters
927927
----------
928-
freq: Period frequency
928+
freq : Period frequency
929929
930930
Returns
931931
-------

pandas/core/dtypes/concat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def union_categoricals(to_union, sort_categories=False, ignore_order=False):
231231
sort_categories : boolean, default False
232232
If true, resulting categories will be lexsorted, otherwise
233233
they will be ordered as they appear in the data.
234-
ignore_order: boolean, default False
234+
ignore_order : boolean, default False
235235
If true, the ordered attribute of the Categoricals will be ignored.
236236
Results in an unordered categorical.
237237

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True,
16891689
tupleize_cols : boolean, default False
16901690
write multi_index columns as a list of tuples (if True)
16911691
or new (expanded format) if False)
1692-
infer_datetime_format: boolean, default False
1692+
infer_datetime_format : boolean, default False
16931693
If True and `parse_dates` is True for a column, try to infer the
16941694
datetime format based on the first datetime string. If the format
16951695
can be inferred, there often will be a large parsing speed-up.

pandas/core/generic.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1482,14 +1482,14 @@ def _is_level_reference(self, key, axis=0):
14821482
14831483
Parameters
14841484
----------
1485-
key: str
1485+
key : str
14861486
Potential level name for the given axis
1487-
axis: int, default 0
1487+
axis : int, default 0
14881488
Axis that levels are associated with (0 for index, 1 for columns)
14891489
14901490
Returns
14911491
-------
1492-
is_level: bool
1492+
is_level : bool
14931493
"""
14941494
axis = self._get_axis_number(axis)
14951495

@@ -4871,7 +4871,7 @@ def as_matrix(self, columns=None):
48714871
48724872
Parameters
48734873
----------
4874-
columns: list, optional, default:None
4874+
columns : list, optional, default:None
48754875
If None, return all columns, otherwise, returns specified columns.
48764876
48774877
Returns
@@ -7307,7 +7307,7 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
73077307
For PeriodIndex only, see PeriodIndex.asfreq
73087308
normalize : bool, default False
73097309
Whether to reset output index to midnight
7310-
fill_value: scalar, optional
7310+
fill_value : scalar, optional
73117311
Value to use for missing values, applied during upsampling (note
73127312
this does not fill NaNs that already were present).
73137313

pandas/core/indexes/timedeltas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TimedeltaIndex(TimedeltaArray, DatetimeIndexOpsMixin,
4141
----------
4242
data : array-like (1-dimensional), optional
4343
Optional timedelta-like data to construct index with
44-
unit: unit of the arg (D,h,m,s,ms,us,ns) denote the unit, optional
44+
unit : unit of the arg (D,h,m,s,ms,us,ns) denote the unit, optional
4545
which is an integer/float number
4646
freq : string or pandas offset object, optional
4747
One of pandas date offset strings or corresponding objects. The string

pandas/core/resample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ def asfreq(self, fill_value=None):
725725
726726
Parameters
727727
----------
728-
fill_value: scalar, optional
728+
fill_value : scalar, optional
729729
Value to use for missing values, applied during upsampling (note
730730
this does not fill NaNs that already were present).
731731

pandas/core/series.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
def remove_na(arr):
7878
"""Remove null values from array like structure.
7979
80-
.. deprecated:: 0.21.0
80+
.. deprecated :: 0.21.0
8181
Use s[s.notnull()] instead.
8282
"""
8383

@@ -1235,7 +1235,7 @@ def to_string(self, buf=None, na_rep='NaN', float_format=None, header=True,
12351235
float_format : one-parameter function, optional
12361236
formatter function to apply to columns' elements if they are floats
12371237
default None
1238-
header: boolean, default True
1238+
header : boolean, default True
12391239
Add the Series header (index name)
12401240
index : bool, optional
12411241
Add index (row) labels, default True
@@ -3876,7 +3876,7 @@ def from_csv(cls, path, sep=',', parse_dates=True, header=None,
38763876
encoding : string, optional
38773877
a string representing the encoding to use if the contents are
38783878
non-ascii, for python versions prior to 3
3879-
infer_datetime_format: boolean, default False
3879+
infer_datetime_format : boolean, default False
38803880
If True and `parse_dates` is True for a column, try to infer the
38813881
datetime format based on the first datetime string. If the format
38823882
can be inferred, there often will be a large parsing speed-up.

pandas/io/excel.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
123123
.. versionadded:: 0.20.0
124124
125-
engine: string, default None
125+
engine : string, default None
126126
If io is not a buffer or path, this must be set to identify io.
127127
Acceptable values are None or xlrd
128128
converters : dict, default None
@@ -368,7 +368,7 @@ class ExcelFile(object):
368368
io : string, path object (pathlib.Path or py._path.local.LocalPath),
369369
file-like object or xlrd workbook
370370
If a string or path object, expected to be a path to xls or xlsx file
371-
engine: string, default None
371+
engine : string, default None
372372
If io is not a buffer or path, this must be set to identify io.
373373
Acceptable values are None or xlrd
374374
"""
@@ -1011,8 +1011,8 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0,
10111011
cell of formatted data to save to Excel sheet
10121012
sheet_name : string, default None
10131013
Name of Excel sheet, if None, then use self.cur_sheet
1014-
startrow: upper left cell row to dump data frame
1015-
startcol: upper left cell column to dump data frame
1014+
startrow : upper left cell row to dump data frame
1015+
startcol : upper left cell column to dump data frame
10161016
freeze_panes: integer tuple of length 2
10171017
contains the bottom-most row and right-most column to freeze
10181018
"""
@@ -1159,7 +1159,7 @@ def _convert_to_style(cls, style_dict):
11591159
converts a style_dict to an openpyxl style object
11601160
Parameters
11611161
----------
1162-
style_dict: style dictionary to convert
1162+
style_dict : style dictionary to convert
11631163
"""
11641164

11651165
from openpyxl.style import Style
@@ -1652,15 +1652,15 @@ def _style_to_xlwt(cls, item, firstlevel=True, field_sep=',',
16521652
for example:
16531653
16541654
hstyle = {"font": {"bold": True},
1655-
"border": {"top": "thin",
1656-
"right": "thin",
1657-
"bottom": "thin",
1658-
"left": "thin"},
1659-
"align": {"horiz": "center"}}
1655+
"border" : {"top": "thin",
1656+
"right": "thin",
1657+
"bottom": "thin",
1658+
"left": "thin"},
1659+
"align" : {"horiz": "center"}}
16601660
will be converted to
1661-
font: bold on; \
1662-
border: top thin, right thin, bottom thin, left thin; \
1663-
align: horiz center;
1661+
font : bold on; \
1662+
border : top thin, right thin, bottom thin, left thin; \
1663+
align : horiz center;
16641664
"""
16651665
if hasattr(item, 'items'):
16661666
if firstlevel:
@@ -1687,8 +1687,8 @@ def _convert_to_style(cls, style_dict, num_format_str=None):
16871687
converts a style_dict to an xlwt style object
16881688
Parameters
16891689
----------
1690-
style_dict: style dictionary to convert
1691-
num_format_str: optional number format string
1690+
style_dict : style dictionary to convert
1691+
num_format_str : optional number format string
16921692
"""
16931693
import xlwt
16941694

@@ -1790,8 +1790,8 @@ def convert(cls, style_dict, num_format_str=None):
17901790
17911791
Parameters
17921792
----------
1793-
style_dict: style dictionary to convert
1794-
num_format_str: optional number format string
1793+
style_dict : style dictionary to convert
1794+
num_format_str : optional number format string
17951795
"""
17961796

17971797
# Create a XlsxWriter format object.

pandas/io/feather_format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def read_feather(path, use_threads=True):
9898
9999
.. versionadded 0.21.0
100100
.. deprecated 0.24.0
101-
use_threads: bool, default True
101+
use_threads : bool, default True
102102
Whether to parallelize reading using multiple threads
103103
104104
.. versionadded 0.24.0

0 commit comments

Comments
 (0)