Skip to content

Add missing spacing before or after a param name in docstrings #23738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ class NaTType(_NaT):
minute : int, optional
second : int, optional
microsecond : int, optional
nanosecond: int, optional
nanosecond : int, optional
tzinfo : tz-convertible, optional
fold : int, optional, default is 0
added in 3.6, NotImplemented
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ cdef class _Period(object):
freq : string or DateOffset
Target frequency. Default is 'D' if self.freq is week or
longer and 'S' otherwise
how: str, default 'S' (start)
how : str, default 'S' (start)
'S', 'E'. Can be aliased as case insensitive
'Start', 'Finish', 'Begin', 'End'

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ class Timestamp(_Timestamp):
minute : int, optional
second : int, optional
microsecond : int, optional
nanosecond: int, optional
nanosecond : int, optional
tzinfo : tz-convertible, optional
fold : int, optional, default is 0
added in 3.6, NotImplemented
Expand Down
8 changes: 4 additions & 4 deletions pandas/compat/pickle_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ def load(fh, encoding=None, compat=False, is_verbose=False):

Parameters
----------
fh: a filelike object
encoding: an optional encoding
compat: provide Series compatibility mode, boolean, default False
is_verbose: show exception output
fh : a filelike object
encoding : an optional encoding
compat : provide Series compatibility mode, boolean, default False
is_verbose : show exception output
"""

try:
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ def isin(comps, values):

Parameters
----------
comps: array-like
values: array-like
comps : array-like
values : array-like

Returns
-------
Expand Down Expand Up @@ -856,8 +856,8 @@ def rank(values, axis=0, method='average', na_option='keep',
The method by which tiebreaks are broken during the ranking.
na_option : {'keep', 'top'}, default 'keep'
The method by which NaNs are placed in the ranking.
- ``keep``: rank each NaN value with a NaN ranking
- ``top``: replace each NaN with either +/- inf so that they
- ``keep`` : rank each NaN value with a NaN ranking
- ``top`` : replace each NaN with either +/- inf so that they
there are ranked at the top
ascending : boolean, default True
Whether or not the elements should be ranked in ascending order.
Expand Down Expand Up @@ -1473,10 +1473,10 @@ def take(arr, indices, axis=0, allow_fill=False, fill_value=None):
allow_fill : bool, default False
How to handle negative values in `indices`.

* False: negative values in `indices` indicate positional indices
* False : negative values in `indices` indicate positional indices
from the right (the default). This is similar to :func:`numpy.take`.

* True: negative values in `indices` indicate
* True : negative values in `indices` indicate
missing values. These values are set to `fill_value`. Any other
other negative values raise a ``ValueError``.

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ def to_perioddelta(self, freq):

Parameters
----------
freq: Period frequency
freq : Period frequency

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def union_categoricals(to_union, sort_categories=False, ignore_order=False):
sort_categories : boolean, default False
If true, resulting categories will be lexsorted, otherwise
they will be ordered as they appear in the data.
ignore_order: boolean, default False
ignore_order : boolean, default False
If true, the ordered attribute of the Categoricals will be ignored.
Results in an unordered categorical.

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True,
tupleize_cols : boolean, default False
write multi_index columns as a list of tuples (if True)
or new (expanded format) if False)
infer_datetime_format: boolean, default False
infer_datetime_format : boolean, default False
If True and `parse_dates` is True for a column, try to infer the
datetime format based on the first datetime string. If the format
can be inferred, there often will be a large parsing speed-up.
Expand Down
10 changes: 5 additions & 5 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,14 +1482,14 @@ def _is_level_reference(self, key, axis=0):

Parameters
----------
key: str
key : str
Potential level name for the given axis
axis: int, default 0
axis : int, default 0
Axis that levels are associated with (0 for index, 1 for columns)

Returns
-------
is_level: bool
is_level : bool
"""
axis = self._get_axis_number(axis)

Expand Down Expand Up @@ -4871,7 +4871,7 @@ def as_matrix(self, columns=None):

Parameters
----------
columns: list, optional, default:None
columns : list, optional, default:None
If None, return all columns, otherwise, returns specified columns.

Returns
Expand Down Expand Up @@ -7307,7 +7307,7 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
For PeriodIndex only, see PeriodIndex.asfreq
normalize : bool, default False
Whether to reset output index to midnight
fill_value: scalar, optional
fill_value : scalar, optional
Value to use for missing values, applied during upsampling (note
this does not fill NaNs that already were present).

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TimedeltaIndex(TimedeltaArray, DatetimeIndexOpsMixin,
----------
data : array-like (1-dimensional), optional
Optional timedelta-like data to construct index with
unit: unit of the arg (D,h,m,s,ms,us,ns) denote the unit, optional
unit : unit of the arg (D,h,m,s,ms,us,ns) denote the unit, optional
which is an integer/float number
freq : string or pandas offset object, optional
One of pandas date offset strings or corresponding objects. The string
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ def asfreq(self, fill_value=None):

Parameters
----------
fill_value: scalar, optional
fill_value : scalar, optional
Value to use for missing values, applied during upsampling (note
this does not fill NaNs that already were present).

Expand Down
6 changes: 3 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
def remove_na(arr):
"""Remove null values from array like structure.

.. deprecated:: 0.21.0
.. deprecated :: 0.21.0
Use s[s.notnull()] instead.
"""

Expand Down Expand Up @@ -1235,7 +1235,7 @@ def to_string(self, buf=None, na_rep='NaN', float_format=None, header=True,
float_format : one-parameter function, optional
formatter function to apply to columns' elements if they are floats
default None
header: boolean, default True
header : boolean, default True
Add the Series header (index name)
index : bool, optional
Add index (row) labels, default True
Expand Down Expand Up @@ -3876,7 +3876,7 @@ def from_csv(cls, path, sep=',', parse_dates=True, header=None,
encoding : string, optional
a string representing the encoding to use if the contents are
non-ascii, for python versions prior to 3
infer_datetime_format: boolean, default False
infer_datetime_format : boolean, default False
If True and `parse_dates` is True for a column, try to infer the
datetime format based on the first datetime string. If the format
can be inferred, there often will be a large parsing speed-up.
Expand Down
34 changes: 17 additions & 17 deletions pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

.. versionadded:: 0.20.0

engine: string, default None
engine : string, default None
If io is not a buffer or path, this must be set to identify io.
Acceptable values are None or xlrd
converters : dict, default None
Expand Down Expand Up @@ -368,7 +368,7 @@ class ExcelFile(object):
io : string, path object (pathlib.Path or py._path.local.LocalPath),
file-like object or xlrd workbook
If a string or path object, expected to be a path to xls or xlsx file
engine: string, default None
engine : string, default None
If io is not a buffer or path, this must be set to identify io.
Acceptable values are None or xlrd
"""
Expand Down Expand Up @@ -1011,8 +1011,8 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0,
cell of formatted data to save to Excel sheet
sheet_name : string, default None
Name of Excel sheet, if None, then use self.cur_sheet
startrow: upper left cell row to dump data frame
startcol: upper left cell column to dump data frame
startrow : upper left cell row to dump data frame
startcol : upper left cell column to dump data frame
freeze_panes: integer tuple of length 2
contains the bottom-most row and right-most column to freeze
"""
Expand Down Expand Up @@ -1159,7 +1159,7 @@ def _convert_to_style(cls, style_dict):
converts a style_dict to an openpyxl style object
Parameters
----------
style_dict: style dictionary to convert
style_dict : style dictionary to convert
"""

from openpyxl.style import Style
Expand Down Expand Up @@ -1652,15 +1652,15 @@ def _style_to_xlwt(cls, item, firstlevel=True, field_sep=',',
for example:

hstyle = {"font": {"bold": True},
"border": {"top": "thin",
"right": "thin",
"bottom": "thin",
"left": "thin"},
"align": {"horiz": "center"}}
"border" : {"top": "thin",
"right": "thin",
"bottom": "thin",
"left": "thin"},
"align" : {"horiz": "center"}}
will be converted to
font: bold on; \
border: top thin, right thin, bottom thin, left thin; \
align: horiz center;
font : bold on; \
border : top thin, right thin, bottom thin, left thin; \
align : horiz center;
"""
if hasattr(item, 'items'):
if firstlevel:
Expand All @@ -1687,8 +1687,8 @@ def _convert_to_style(cls, style_dict, num_format_str=None):
converts a style_dict to an xlwt style object
Parameters
----------
style_dict: style dictionary to convert
num_format_str: optional number format string
style_dict : style dictionary to convert
num_format_str : optional number format string
"""
import xlwt

Expand Down Expand Up @@ -1790,8 +1790,8 @@ def convert(cls, style_dict, num_format_str=None):

Parameters
----------
style_dict: style dictionary to convert
num_format_str: optional number format string
style_dict : style dictionary to convert
num_format_str : optional number format string
"""

# Create a XlsxWriter format object.
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/feather_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def read_feather(path, use_threads=True):

.. versionadded 0.21.0
.. deprecated 0.24.0
use_threads: bool, default True
use_threads : bool, default True
Whether to parallelize reading using multiple threads

.. versionadded 0.24.0
Expand Down
Loading