Skip to content

Commit b355c77

Browse files
committed
DOC: fix doc-build warnings & cleanup
1 parent bc2c28a commit b355c77

File tree

3 files changed

+60
-58
lines changed

3 files changed

+60
-58
lines changed

doc/source/enhancingperf.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ cython versions >=0.21 you can use ``%load_ext Cython``):
100100
.. ipython:: python
101101
:okwarning:
102102
103-
%load_ext cythonmagic
103+
%load_ext Cython
104104
105105
106106
Now, let's simply copy our functions over to cython as is (the suffix

doc/source/release.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ analysis / manipulation tool available in any language.
4040
pandas 0.18.0
4141
-------------
4242

43-
**Release date:** (January ??, 2016)
43+
**Release date:** (March 13, 2016)
4444

4545
This is a major release from 0.17.1 and includes a small number of API changes, several new features,
4646
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all

doc/source/whatsnew/v0.18.0.txt

+58-56
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _whatsnew_0180:
22

3-
v0.18.0 (February ??, 2016)
4-
---------------------------
3+
v0.18.0 (March 13, 2016)
4+
------------------------
55

66
This is a major release from 0.17.1 and includes a small number of API changes, several new features,
77
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all
@@ -607,9 +607,9 @@ Subtraction by ``Timedelta`` in a ``Series`` by a ``Timestamp`` works (:issue:`1
607607
Changes to msgpack
608608
^^^^^^^^^^^^^^^^^^
609609

610-
Forward incompatible changes in ``msgpack`` writing format were made over 0.17.0 and 0.18.0; older versions of pandas cannot read files packed by newer versions (:issue:`12129`, `10527`)
610+
Forward incompatible changes in ``msgpack`` writing format were made over 0.17.0 and 0.18.0; older versions of pandas cannot read files packed by newer versions (:issue:`12129`, :issue:`10527`)
611611

612-
Bug in ``to_msgpack`` and ``read_msgpack`` introduced in 0.17.0 and fixed in 0.18.0, caused files packed in Python 2 unreadable by Python 3 (:issue:`12142`). The following table describes the backward and forward compat of msgpacks.
612+
Bugs in ``to_msgpack`` and ``read_msgpack`` introduced in 0.17.0 and fixed in 0.18.0, caused files packed in Python 2 unreadable by Python 3 (:issue:`12142`). The following table describes the backward and forward compat of msgpacks.
613613

614614
.. warning::
615615

@@ -745,58 +745,6 @@ You could also specify a ``how`` directly
745745
2010-01-01 09:00:06 1.249976 1.219477 1.266330 1.224904
746746
2010-01-01 09:00:08 1.020940 1.068634 1.146402 1.613897
747747

748-
.. warning::
749-
750-
This new API for resample includes some internal changes for the prior-to-0.18.0 API, to work with a deprecation warning in most cases, as the resample operation returns a deferred object. We can intercept operations and just do what the (pre 0.18.0) API did (with a warning). Here is a typical use case:
751-
752-
.. code-block:: python
753-
754-
In [4]: r = df.resample('2s')
755-
756-
In [6]: r*10
757-
pandas/tseries/resample.py:80: FutureWarning: .resample() is now a deferred operation
758-
use .resample(...).mean() instead of .resample(...)
759-
760-
Out[6]:
761-
A B C D
762-
2010-01-01 09:00:00 4.857476 4.473507 3.570960 7.936154
763-
2010-01-01 09:00:02 8.208011 7.943173 3.640340 5.310957
764-
2010-01-01 09:00:04 4.339846 3.145823 4.241039 6.257326
765-
2010-01-01 09:00:06 6.249881 6.097384 6.331650 6.124518
766-
2010-01-01 09:00:08 5.104699 5.343172 5.732009 8.069486
767-
768-
However, getting and assignment operations directly on a ``Resampler`` will raise a ``ValueError``:
769-
770-
.. code-block:: python
771-
772-
In [7]: r.iloc[0] = 5
773-
ValueError: .resample() is now a deferred operation
774-
use .resample(...).mean() instead of .resample(...)
775-
assignment will have no effect as you are working on a copy
776-
777-
There is a situation where the new API can not perform all the operations when using original code.
778-
This code is intending to resample every 2s, take the ``mean`` AND then take the ``min` of those results.
779-
780-
.. code-block:: python
781-
782-
In [4]: df.resample('2s').min()
783-
Out[4]:
784-
A 0.433985
785-
B 0.314582
786-
C 0.357096
787-
D 0.531096
788-
dtype: float64
789-
790-
The new API will:
791-
792-
.. ipython: python
793-
794-
df.resample('2s').min()
795-
796-
Good news is the return dimensions will differ (between the new API and the old API), so this should loudly raise
797-
an exception.
798-
799-
800748
**New API**:
801749

802750
Now, you can write ``.resample`` as a 2-stage operation like groupby, which
@@ -886,6 +834,60 @@ New API
886834

887835
In the new API, you can either downsample OR upsample. The prior implementation would allow you to pass an aggregator function (like ``mean``) even though you were upsampling, providing a bit of confusion.
888836

837+
Previous API will work but deprecations
838+
'''''''''''''''''''''''''''''''''''''''
839+
840+
.. warning::
841+
842+
This new API for resample includes some internal changes for the prior-to-0.18.0 API, to work with a deprecation warning in most cases, as the resample operation returns a deferred object. We can intercept operations and just do what the (pre 0.18.0) API did (with a warning). Here is a typical use case:
843+
844+
.. code-block:: python
845+
846+
In [4]: r = df.resample('2s')
847+
848+
In [6]: r*10
849+
pandas/tseries/resample.py:80: FutureWarning: .resample() is now a deferred operation
850+
use .resample(...).mean() instead of .resample(...)
851+
852+
Out[6]:
853+
A B C D
854+
2010-01-01 09:00:00 4.857476 4.473507 3.570960 7.936154
855+
2010-01-01 09:00:02 8.208011 7.943173 3.640340 5.310957
856+
2010-01-01 09:00:04 4.339846 3.145823 4.241039 6.257326
857+
2010-01-01 09:00:06 6.249881 6.097384 6.331650 6.124518
858+
2010-01-01 09:00:08 5.104699 5.343172 5.732009 8.069486
859+
860+
However, getting and assignment operations directly on a ``Resampler`` will raise a ``ValueError``:
861+
862+
.. code-block:: python
863+
864+
In [7]: r.iloc[0] = 5
865+
ValueError: .resample() is now a deferred operation
866+
use .resample(...).mean() instead of .resample(...)
867+
assignment will have no effect as you are working on a copy
868+
869+
There is a situation where the new API can not perform all the operations when using original code.
870+
This code is intending to resample every 2s, take the ``mean`` AND then take the ``min` of those results.
871+
872+
.. code-block:: python
873+
874+
In [4]: df.resample('2s').min()
875+
Out[4]:
876+
A 0.433985
877+
B 0.314582
878+
C 0.357096
879+
D 0.531096
880+
dtype: float64
881+
882+
The new API will:
883+
884+
.. ipython:: python
885+
886+
df.resample('2s').min()
887+
888+
The good news is the return dimensions will differ between the new API and the old API, so this should loudly raise
889+
an exception.
890+
889891
Changes to eval
890892
^^^^^^^^^^^^^^^
891893

0 commit comments

Comments
 (0)