Skip to content

Commit 744daa7

Browse files
committed
DOC: v0.15.0.txt corrections
1 parent 31c2558 commit 744daa7

File tree

2 files changed

+123
-120
lines changed

2 files changed

+123
-120
lines changed

doc/source/io.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ result in byte strings being decoded to unicode in the result:
405405
406406
Some formats which encode all characters as multiple bytes, like UTF-16, won't
407407
parse correctly at all without specifying the encoding. `Full list of Python
408-
standard encodings
408+
standard encodings
409409
<https://docs.python.org/3/library/codecs.html#standard-encodings>`_
410410

411411
.. _io.index_col:
@@ -542,6 +542,8 @@ data columns:
542542
specify `index_col` as a column label rather then as an index on the resulting frame.
543543

544544

545+
.. _io.float_precision:
546+
545547
Specifying method for floating-point conversion
546548
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
547549
The parameter ``float_precision`` can be specified in order to use
@@ -3382,7 +3384,7 @@ functions. Note however that this depends on the database flavor (sqlite does no
33823384
have schema's). For example:
33833385

33843386
.. code-block:: python
3385-
3387+
33863388
df.to_sql('table', engine, schema='other_schema')
33873389
pd.read_sql_table('table', engine, schema='other_schema')
33883390

doc/source/v0.15.0.txt

Lines changed: 119 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ users upgrade to this version.
2525

2626
- :ref:`Other Enhancements <whatsnew_0150.enhancements>`
2727

28-
- :ref:`API Changes <whatsnew_0150.api>`
28+
- :ref:`API Changes <whatsnew_0150.api>`, and :ref:`Rolling/expanding moments API Changes <whatsnew_0150.roll>`
2929

3030
- :ref:`Performance Improvements <whatsnew_0150.performance>`
3131

@@ -61,121 +61,11 @@ API changes
6161

6262
- Raise a ``ValueError`` in ``df.to_hdf`` with 'fixed' format, if ``df`` has non-unique columns as the resulting file will be broken (:issue:`7761`)
6363

64-
- :func:`rolling_min`, :func:`rolling_max`, :func:`rolling_cov`, and :func:`rolling_corr`
65-
now return objects with all ``NaN`` when ``len(arg) < min_periods <= window`` rather
66-
than raising. (This makes all rolling functions consistent in this behavior), (:issue:`7766`)
67-
68-
Prior to 0.15.0
69-
70-
.. ipython:: python
71-
72-
s = Series([10, 11, 12, 13])
73-
74-
.. code-block:: python
75-
76-
In [15]: rolling_min(s, window=10, min_periods=5)
77-
ValueError: min_periods (5) must be <= window (4)
78-
79-
New behavior
80-
81-
.. ipython:: python
82-
83-
rolling_min(s, window=10, min_periods=5)
84-
85-
- :func:`rolling_max`, :func:`rolling_min`, :func:`rolling_sum`, :func:`rolling_mean`, :func:`rolling_median`,
86-
:func:`rolling_std`, :func:`rolling_var`, :func:`rolling_skew`, :func:`rolling_kurt`, :func:`rolling_quantile`,
87-
:func:`rolling_cov`, :func:`rolling_corr`, :func:`rolling_corr_pairwise`,
88-
:func:`rolling_window`, and :func:`rolling_apply` with ``center=True`` previously would return a result of the same
89-
structure as the input ``arg`` with ``NaN`` in the final ``(window-1)/2`` entries.
90-
Now the final ``(window-1)/2`` entries of the result are calculated as if the input ``arg`` were followed
91-
by ``(window-1)/2`` ``NaN`` values (or with shrinking windows, in the case of :func:`rolling_apply`).
92-
(:issue:`7925`, :issue:`8269`)
93-
94-
Prior behavior (note final value is ``NaN``):
95-
96-
.. code-block:: python
97-
98-
In [7]: rolling_sum(Series(range(4)), window=3, min_periods=0, center=True)
99-
Out[7]:
100-
0 1
101-
1 3
102-
2 6
103-
3 NaN
104-
dtype: float64
105-
106-
New behavior (note final value is ``5 = sum([2, 3, NaN])``):
107-
108-
.. ipython:: python
109-
110-
rolling_sum(Series(range(4)), window=3, min_periods=0, center=True)
111-
112-
- Removed ``center`` argument from :func:`expanding_max`, :func:`expanding_min`, :func:`expanding_sum`,
113-
:func:`expanding_mean`, :func:`expanding_median`, :func:`expanding_std`, :func:`expanding_var`,
114-
:func:`expanding_skew`, :func:`expanding_kurt`, :func:`expanding_quantile`, :func:`expanding_count`,
115-
:func:`expanding_cov`, :func:`expanding_corr`, :func:`expanding_corr_pairwise`, and :func:`expanding_apply`,
116-
as the results produced when ``center=True`` did not make much sense. (:issue:`7925`)
117-
118-
- Added optional ``ddof`` argument to :func:`expanding_cov` and :func:`rolling_cov`.
119-
The default value of ``1`` is backwards-compatible. (:issue:`8279`)
120-
121-
- Documented the ``ddof`` argument to :func:`expanding_var`, :func:`expanding_std`,
122-
:func:`rolling_var`, and :func:`rolling_std`. These functions' support of a
123-
``ddof`` argument (with a default value of ``1``) was previously undocumented. (:issue:`8064`)
124-
125-
- :func:`ewma`, :func:`ewmstd`, :func:`ewmvol`, :func:`ewmvar`, :func:`ewmcov`, and :func:`ewmcorr`
126-
now interpret ``min_periods`` in the same manner that the ``rolling_*`` and ``expanding_*`` functions do:
127-
a given result entry will be ``NaN`` if the (expanding, in this case) window does not contain
128-
at least ``min_periods`` values. The previous behavior was to set to ``NaN`` the ``min_periods`` entries
129-
starting with the first non- ``NaN`` value. (:issue:`7977`)
130-
131-
Prior behavior (note values start at index ``2``, which is ``min_periods`` after index ``0``
132-
(the index of the first non-empty value)):
133-
134-
.. ipython:: python
135-
136-
s = Series([1, None, None, None, 2, 3])
137-
138-
.. code-block:: python
139-
140-
In [51]: ewma(s, com=3., min_periods=2)
141-
Out[51]:
142-
0 NaN
143-
1 NaN
144-
2 1.000000
145-
3 1.000000
146-
4 1.571429
147-
5 2.189189
148-
dtype: float64
149-
150-
New behavior (note values start at index ``4``, the location of the 2nd (since ``min_periods=2``) non-empty value):
151-
152-
.. ipython:: python
153-
154-
ewma(s, com=3., min_periods=2)
155-
15664
- Made both the C-based and Python engines for `read_csv` and `read_table` ignore empty lines in input as well as
15765
whitespace-filled lines, as long as `sep` is not whitespace. This is an API change
15866
that can be controlled by the keyword parameter `skip_blank_lines`.
15967
(:issue:`4466`, see :ref:`skiplines <_io.skiplines>`)
16068

161-
- :func:`ewmstd`, :func:`ewmvol`, :func:`ewmvar`, :func:`ewmcov`, and :func:`ewmcorr`
162-
now have an optional ``adjust`` argument, just like :func:`ewma` does,
163-
affecting how the weights are calculated.
164-
The default value of ``adjust`` is ``True``, which is backwards-compatible.
165-
See :ref:`Exponentially weighted moment functions <stats.moments.exponentially_weighted>` for details. (:issue:`7911`)
166-
167-
- :func:`ewma`, :func:`ewmstd`, :func:`ewmvol`, :func:`ewmvar`, :func:`ewmcov`, and :func:`ewmcorr`
168-
now have an optional ``ignore_na`` argument.
169-
When ``ignore_na=False`` (the default), missing values are taken into account in the weights calculation.
170-
When ``ignore_na=True`` (which reproduces the pre-0.15.0 behavior), missing values are ignored in the weights calculation.
171-
(:issue:`7543`)
172-
173-
.. ipython:: python
174-
175-
ewma(Series([None, 1., 8.]), com=2.)
176-
ewma(Series([1., None, 8.]), com=2., ignore_na=True) # pre-0.15.0 behavior
177-
ewma(Series([1., None, 8.]), com=2., ignore_na=False) # new default
178-
17969
- Bug in passing a ``DatetimeIndex`` with a timezone that was not being retained in DataFrame construction from a dict (:issue:`7822`)
18070

18171
In prior versions this would drop the timezone.
@@ -428,6 +318,121 @@ The ``.dt`` accessor works for period and timedelta dtypes.
428318
s.dt.seconds
429319
s.dt.components
430320

321+
.. _whatsnew_0150.roll:
322+
323+
Rolling/exapnding moments API changes
324+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325+
326+
- :func:`rolling_min`, :func:`rolling_max`, :func:`rolling_cov`, and :func:`rolling_corr`
327+
now return objects with all ``NaN`` when ``len(arg) < min_periods <= window`` rather
328+
than raising. (This makes all rolling functions consistent in this behavior), (:issue:`7766`)
329+
330+
Prior to 0.15.0
331+
332+
.. ipython:: python
333+
334+
s = Series([10, 11, 12, 13])
335+
336+
.. code-block:: python
337+
338+
In [15]: rolling_min(s, window=10, min_periods=5)
339+
ValueError: min_periods (5) must be <= window (4)
340+
341+
New behavior
342+
343+
.. ipython:: python
344+
345+
rolling_min(s, window=10, min_periods=5)
346+
347+
- :func:`rolling_max`, :func:`rolling_min`, :func:`rolling_sum`, :func:`rolling_mean`, :func:`rolling_median`,
348+
:func:`rolling_std`, :func:`rolling_var`, :func:`rolling_skew`, :func:`rolling_kurt`, :func:`rolling_quantile`,
349+
:func:`rolling_cov`, :func:`rolling_corr`, :func:`rolling_corr_pairwise`,
350+
:func:`rolling_window`, and :func:`rolling_apply` with ``center=True`` previously would return a result of the same
351+
structure as the input ``arg`` with ``NaN`` in the final ``(window-1)/2`` entries.
352+
Now the final ``(window-1)/2`` entries of the result are calculated as if the input ``arg`` were followed
353+
by ``(window-1)/2`` ``NaN`` values (or with shrinking windows, in the case of :func:`rolling_apply`).
354+
(:issue:`7925`, :issue:`8269`)
355+
356+
Prior behavior (note final value is ``NaN``):
357+
358+
.. code-block:: python
359+
360+
In [7]: rolling_sum(Series(range(4)), window=3, min_periods=0, center=True)
361+
Out[7]:
362+
0 1
363+
1 3
364+
2 6
365+
3 NaN
366+
dtype: float64
367+
368+
New behavior (note final value is ``5 = sum([2, 3, NaN])``):
369+
370+
.. ipython:: python
371+
372+
rolling_sum(Series(range(4)), window=3, min_periods=0, center=True)
373+
374+
- Removed ``center`` argument from :func:`expanding_max`, :func:`expanding_min`, :func:`expanding_sum`,
375+
:func:`expanding_mean`, :func:`expanding_median`, :func:`expanding_std`, :func:`expanding_var`,
376+
:func:`expanding_skew`, :func:`expanding_kurt`, :func:`expanding_quantile`, :func:`expanding_count`,
377+
:func:`expanding_cov`, :func:`expanding_corr`, :func:`expanding_corr_pairwise`, and :func:`expanding_apply`,
378+
as the results produced when ``center=True`` did not make much sense. (:issue:`7925`)
379+
380+
- Added optional ``ddof`` argument to :func:`expanding_cov` and :func:`rolling_cov`.
381+
The default value of ``1`` is backwards-compatible. (:issue:`8279`)
382+
383+
- Documented the ``ddof`` argument to :func:`expanding_var`, :func:`expanding_std`,
384+
:func:`rolling_var`, and :func:`rolling_std`. These functions' support of a
385+
``ddof`` argument (with a default value of ``1``) was previously undocumented. (:issue:`8064`)
386+
387+
- :func:`ewma`, :func:`ewmstd`, :func:`ewmvol`, :func:`ewmvar`, :func:`ewmcov`, and :func:`ewmcorr`
388+
now interpret ``min_periods`` in the same manner that the ``rolling_*`` and ``expanding_*`` functions do:
389+
a given result entry will be ``NaN`` if the (expanding, in this case) window does not contain
390+
at least ``min_periods`` values. The previous behavior was to set to ``NaN`` the ``min_periods`` entries
391+
starting with the first non- ``NaN`` value. (:issue:`7977`)
392+
393+
Prior behavior (note values start at index ``2``, which is ``min_periods`` after index ``0``
394+
(the index of the first non-empty value)):
395+
396+
.. ipython:: python
397+
398+
s = Series([1, None, None, None, 2, 3])
399+
400+
.. code-block:: python
401+
402+
In [51]: ewma(s, com=3., min_periods=2)
403+
Out[51]:
404+
0 NaN
405+
1 NaN
406+
2 1.000000
407+
3 1.000000
408+
4 1.571429
409+
5 2.189189
410+
dtype: float64
411+
412+
New behavior (note values start at index ``4``, the location of the 2nd (since ``min_periods=2``) non-empty value):
413+
414+
.. ipython:: python
415+
416+
ewma(s, com=3., min_periods=2)
417+
418+
- :func:`ewmstd`, :func:`ewmvol`, :func:`ewmvar`, :func:`ewmcov`, and :func:`ewmcorr`
419+
now have an optional ``adjust`` argument, just like :func:`ewma` does,
420+
affecting how the weights are calculated.
421+
The default value of ``adjust`` is ``True``, which is backwards-compatible.
422+
See :ref:`Exponentially weighted moment functions <stats.moments.exponentially_weighted>` for details. (:issue:`7911`)
423+
424+
- :func:`ewma`, :func:`ewmstd`, :func:`ewmvol`, :func:`ewmvar`, :func:`ewmcov`, and :func:`ewmcorr`
425+
now have an optional ``ignore_na`` argument.
426+
When ``ignore_na=False`` (the default), missing values are taken into account in the weights calculation.
427+
When ``ignore_na=True`` (which reproduces the pre-0.15.0 behavior), missing values are ignored in the weights calculation.
428+
(:issue:`7543`)
429+
430+
.. ipython:: python
431+
432+
ewma(Series([None, 1., 8.]), com=2.)
433+
ewma(Series([1., None, 8.]), com=2., ignore_na=True) # pre-0.15.0 behavior
434+
ewma(Series([1., None, 8.]), com=2., ignore_na=False) # new default
435+
431436
.. _whatsnew_0150.refactoring:
432437

433438
Internal Refactoring
@@ -629,15 +634,11 @@ Enhancements
629634

630635
- Added support for bool, uint8, uint16 and uint32 datatypes in ``to_stata`` (:issue:`7097`, :issue:`7365`)
631636

632-
- Added ``layout`` keyword to ``DataFrame.plot``. You can pass a tuple of
633-
``(rows, columns)``, one of which can be ``-1`` to automatically
634-
infer (:issue:`6667`, :issue:`8071`).
637+
- Added ``layout`` keyword to ``DataFrame.plot``. You can pass a tuple of ``(rows, columns)``, one of which can be ``-1`` to automatically infer (:issue:`6667`, :issue:`8071`).
635638
- Allow to pass multiple axes to ``DataFrame.plot``, ``hist`` and ``boxplot`` (:issue:`5353`, :issue:`6970`, :issue:`7069`)
636-
- Added support for ``c``, ``colormap`` and ``colorbar`` arguments for
637-
``DataFrame.plot`` with ``kind='scatter'`` (:issue:`7780`)
639+
- Added support for ``c``, ``colormap`` and ``colorbar`` arguments for ``DataFrame.plot`` with ``kind='scatter'`` (:issue:`7780`)
638640

639-
- ``read_csv`` now has a keyword parameter ``float_precision`` which specifies which floating-point
640-
converter the C engine should use during parsing, see :ref:`_io` (:issue:`8002`, :issue:`8044`)
641+
- ``read_csv`` now has a keyword parameter ``float_precision`` which specifies which floating-point converter the C engine should use during parsing, see :ref:`here <io.float_precision>` (:issue:`8002`, :issue:`8044`)
641642

642643
- ``PeriodIndex`` supports ``resolution`` as the same as ``DatetimeIndex`` (:issue:`7708`)
643644
- ``pandas.tseries.holiday`` has added support for additional holidays and ways to observe holidays (:issue:`7070`)

0 commit comments

Comments
 (0)