Skip to content

Fix docstrings #27621

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
Jul 28, 2019
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/core/arrays/numpy_.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PandasArray(ExtensionArray, ExtensionOpsMixin, NDArrayOperatorsMixin):
"""
A pandas ExtensionArray for NumPy data.

.. versionadded :: 0.24.0
.. versionadded:: 0.24.0

This is mostly for internal compatibility, and is not especially
useful on its own.
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,7 @@ class SparseFrameAccessor(BaseAccessor, PandasDelegate):
"""
DataFrame accessor for sparse data.

.. versionadded :: 0.25.0
.. versionadded:: 0.25.0
"""

def _validate(self, data):
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def item(self):
"""
Return the first element of the underlying data as a python scalar.

.. deprecated 0.25.0
.. deprecated:: 0.25.0

Returns
-------
Expand Down Expand Up @@ -1559,7 +1559,7 @@ def factorize(self, sort=False, na_sentinel=-1):
A scalar or array of insertion points with the
same shape as `value`.

.. versionchanged :: 0.24.0
.. versionchanged:: 0.24.0
If `value` is a scalar, an int is now always returned.
Previously, scalar inputs returned an 1-item array for
:class:`Series` and :class:`Categorical`.
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ class DataFrame(NDFrame):
data : ndarray (structured or homogeneous), Iterable, dict, or DataFrame
Dict can contain Series, arrays, constants, or list-like objects

.. versionchanged :: 0.23.0
.. versionchanged:: 0.23.0
If data is a dict, column order follows insertion-order for
Python 3.6 and later.

.. versionchanged :: 0.25.0
.. versionchanged:: 0.25.0
If data is a list of dicts, column order follows insertion-order
Python 3.6 and later.

Expand Down Expand Up @@ -3560,7 +3560,7 @@ def assign(self, **kwargs):
or modified columns. All items are computed first, and then assigned
in alphabetical order.

.. versionchanged :: 0.23.0
.. versionchanged:: 0.23.0

Keyword argument order is maintained for Python 3.6 and later.

Expand Down Expand Up @@ -5628,7 +5628,7 @@ def update(
If 'raise', will raise a ValueError if the DataFrame and `other`
both contain non-NA data in the same place.

.. versionchanged :: 0.24.0
.. versionchanged:: 0.24.0
Changed from `raise_conflict=False|True`
to `errors='ignore'|'raise'`.

Expand Down Expand Up @@ -5774,7 +5774,7 @@ def update(
specified, all remaining columns will be used and the result will
have hierarchically indexed columns.

.. versionchanged :: 0.23.0
.. versionchanged:: 0.23.0
Also accept list of column names.

Returns
Expand Down Expand Up @@ -5903,7 +5903,7 @@ def pivot(self, index=None, columns=None, values=None):
If True: only show observed values for categorical groupers.
If False: show all values for categorical groupers.

.. versionchanged :: 0.25.0
.. versionchanged:: 0.25.0

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11490,7 +11490,7 @@ def _doc_parms(cls):
The required number of valid values to perform the operation. If fewer than
``min_count`` non-NA values are present the result will be NA.

.. versionadded :: 0.22.0
.. versionadded:: 0.22.0

Added with the default being 0. This means the sum of an all-NA
or empty Series is 0, and the product of an all-NA or empty
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ def item(self):
return the first element of the underlying data as a python
scalar

.. deprecated 0.25.0
.. deprecated:: 0.25.0

"""
warnings.warn(
Expand Down
10 changes: 5 additions & 5 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
data : array-like, Iterable, dict, or scalar value
Contains data stored in Series.

.. versionchanged :: 0.23.0
.. versionchanged:: 0.23.0
If data is a dict, argument order is maintained for Python 3.6
and later.

Expand Down Expand Up @@ -370,7 +370,7 @@ def from_array(
"""
Construct Series from array.

.. deprecated :: 0.23.0
.. deprecated:: 0.23.0
Use pd.Series(..) constructor instead.

Returns
Expand Down Expand Up @@ -597,7 +597,7 @@ def asobject(self):
"""
Return object Series which contains boxed values.

.. deprecated :: 0.23.0
.. deprecated:: 0.23.0

Use ``astype(object)`` instead.

Expand Down Expand Up @@ -952,7 +952,7 @@ def real(self):
"""
Return the real value of vector.

.. deprecated 0.25.0
.. deprecated:: 0.25.0
"""
warnings.warn(
"`real` has be deprecated and will be removed in a future version",
Expand All @@ -970,7 +970,7 @@ def imag(self):
"""
Return imag value of vector.

.. deprecated 0.25.0
.. deprecated:: 0.25.0
"""
warnings.warn(
"`imag` has be deprecated and will be removed in a future version",
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sparse/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SparseDataFrame(DataFrame):
Parameters
----------
data : same types as can be passed to DataFrame or scipy.sparse.spmatrix
.. versionchanged :: 0.23.0
.. versionchanged:: 0.23.0
If data is a dict, argument order is maintained for Python 3.6
and later.

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sparse/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SparseSeries(Series):
Parameters
----------
data : {array-like, Series, SparseSeries, dict}
.. versionchanged :: 0.23.0
.. versionchanged:: 0.23.0
If data is a dict, argument order is maintained for Python 3.6
and later.

Expand Down
10 changes: 5 additions & 5 deletions pandas/io/feather_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def read_feather(path, columns=None, use_threads=True):
"""
Load a feather-format object from the file path.

.. versionadded 0.20.0
.. versionadded:: 0.20.0

Parameters
----------
Expand All @@ -90,16 +90,16 @@ def read_feather(path, columns=None, use_threads=True):
columns : sequence, default None
If not provided, all columns are read.

.. versionadded 0.24.0
.. versionadded:: 0.24.0
nthreads : int, default 1
Number of CPU threads to use when reading to pandas.DataFrame.

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

.. versionadded 0.24.0
.. versionadded:: 0.24.0

Returns
-------
Expand Down
6 changes: 3 additions & 3 deletions pandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def to_parquet(
``False``, they will not be written to the file. If ``None``, the
engine's default behavior will be used.

.. versionadded 0.24.0
.. versionadded:: 0.24.0

partition_cols : list, optional, default None
Column names by which to partition the dataset
Expand All @@ -257,7 +257,7 @@ def read_parquet(path, engine="auto", columns=None, **kwargs):
"""
Load a parquet object from the file path, returning a DataFrame.

.. versionadded 0.21.0
.. versionadded:: 0.21.0

Parameters
----------
Expand All @@ -281,7 +281,7 @@ def read_parquet(path, engine="auto", columns=None, **kwargs):
columns : list, default=None
If not None, only these columns will be read from the file.

.. versionadded 0.21.1
.. versionadded:: 0.21.1
**kwargs
Any additional kwargs are passed to the engine.

Expand Down
2 changes: 1 addition & 1 deletion pandas/io/spss.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def read_spss(
"""
Load an SPSS file from the file path, returning a DataFrame.

.. versionadded 0.25.0
.. versionadded:: 0.25.0

Parameters
----------
Expand Down