Skip to content

Commit b83c8b1

Browse files
committed
update to comments
1 parent 946233c commit b83c8b1

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

doc/source/whatsnew/v0.23.0.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Rolling/Expanding.apply() accepts a ``raw`` keyword to pass a ``Series`` to the
7474
:func:`Series.expanding().apply() <pandas.core.window.Expanding.apply>`, and :func:`DataFrame.expanding().apply() <pandas.core.window.Expanding.apply>` have gained a ``raw=None`` parameter.
7575
This is similar to :func:`DataFame.apply`. This parameter, if ``True`` allows one to send a ``np.ndarray`` to the applied function. If ``False`` a ``Series`` will be passed. The
7676
default is ``None``, which preserves backward compatibility, so this will default to ``True``, sending an ``np.ndarray``.
77-
In a future version the default will be changed to ``False``, sending a ``Series``. (:issue:`5071`)
77+
In a future version the default will be changed to ``False``, sending a ``Series``. (:issue:`5071`, :issue:`20584`)
7878

7979
.. ipython:: python
8080

@@ -844,6 +844,7 @@ Other API Changes
844844
- :func:`DatetimeIndex.strftime` and :func:`PeriodIndex.strftime` now return an ``Index`` instead of a numpy array to be consistent with similar accessors (:issue:`20127`)
845845
- Constructing a Series from a list of length 1 no longer broadcasts this list when a longer index is specified (:issue:`19714`, :issue:`20391`).
846846
- :func:`DataFrame.to_dict` with ``orient='index'`` no longer casts int columns to float for a DataFrame with only int and float columns (:issue:`18580`)
847+
- A user-defined-function that is passed to :func:`Series.rolling().aggregate() <pandas.core.window.Rolling.aggregate>`, :func:`DataFrame.rolling().aggregate() <pandas.core.window.Rolling.aggregate>`, or its expanding cousines, will now *always* be passed a ``Series``, rather than an ``np.array``; ``.apply()`` only has the ``raw`` keyword, see :ref:`here <whatsnew_0230.enhancements.window_raw>`. This is consistent with the signatures of ``.aggregate()`` across pandas (:issue:`20584`)
847848

848849
.. _whatsnew_0230.deprecations:
849850

@@ -873,8 +874,7 @@ Deprecations
873874
- ``NDFrame.get_ftype_counts()`` is deprecated and will be removed in a future version (:issue:`18243`)
874875
- The ``convert_datetime64`` parameter in :func:`DataFrame.to_records` has been deprecated and will be removed in a future version. The NumPy bug motivating this parameter has been resolved. The default value for this parameter has also changed from ``True`` to ``None`` (:issue:`18160`).
875876
- :func:`Series.rolling().apply() <pandas.core.window.Rolling.apply>`, :func:`DataFrame.rolling().apply() <pandas.core.window.Rolling.apply>`,
876-
:func:`Series.expanding().apply() <pandas.core.window.Expanding.apply>`, and :func:`DataFrame.expanding().apply() <pandas.core.window.Expanding.apply>` will show a ``FutureWarning`` if the new
877-
``raw`` parameter is not explicity passed (:issue:`20584`)
877+
:func:`Series.expanding().apply() <pandas.core.window.Expanding.apply>`, and :func:`DataFrame.expanding().apply() <pandas.core.window.Expanding.apply>` have deprecated passing an ``np.array`` by default. One will need to pass the new ``raw`` parameter to be explicit about what is passed (:issue:`20584`)
878878

879879
.. _whatsnew_0230.prior_deprecations:
880880

pandas/core/generic.py

+2
Original file line numberDiff line numberDiff line change
@@ -4292,6 +4292,8 @@ def pipe(self, func, *args, **kwargs):
42924292
Notes
42934293
-----
42944294
`agg` is an alias for `aggregate`. Use the alias.
4295+
4296+
A passed user-defined-funtion will be passed a Series for evaluation.
42954297
""")
42964298

42974299
_shared_docs['transform'] = ("""

pandas/core/window.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,8 @@ def count(self):
954954
Parameters
955955
----------
956956
func : function
957-
Must produce a single value from an ndarray input if raw=True
958-
or a Series if raw=False
957+
Must produce a single value from an ndarray input if ``raw=True``
958+
or a Series if ``raw=False``
959959
raw : bool, default None
960960
* ``False`` : passes each row or column as a Series to the
961961
function.
@@ -965,7 +965,7 @@ def count(self):
965965
achieve much better performance.
966966
967967
The raw parameter is required and will show a FutureWarning if
968-
not passed. In the futures raw will default to False.
968+
not passed. In the future raw will default to False.
969969
970970
.. versionadded:: 0.23.0
971971
@@ -984,10 +984,10 @@ def apply(self, func, raw=None, args=(), kwargs={}):
984984
# change to False in the future
985985
if raw is None:
986986
warnings.warn(
987-
"raw defaults to False "
988-
"meaning a Series will be passed to the "
989-
"applied function. In the future raw will default to True "
990-
"meaning a ndarray is passed to the "
987+
"`raw` defaults to True "
988+
"meaning a nndarray will be passed to the "
989+
"applied function. In the future `raw` will default to False "
990+
"meaning a Series is passed to the "
991991
"applied function", FutureWarning, stacklevel=3)
992992
raw = True
993993

0 commit comments

Comments
 (0)