Skip to content

Commit 1131f71

Browse files
committed
Fix code-block
1 parent 78372e4 commit 1131f71

File tree

1 file changed

+28
-34
lines changed

1 file changed

+28
-34
lines changed

doc/source/whatsnew/v0.20.0.rst

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ v0.20.1 (May 5, 2017)
55

66
{{ header }}
77

8-
.. ipython:: python
9-
:suppress:
10-
11-
from pandas import * # noqa F401, F403
12-
13-
148
This is a major release from 0.19.2 and includes a number of API changes, deprecations, new features,
159
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all
1610
users upgrade to this version.
@@ -685,24 +679,24 @@ data-types would yield different return types. These are now made consistent. (:
685679

686680
Previous behaviour:
687681

688-
.. code-block:: ipython
682+
.. code-block:: ipython
689683
690684
# Series
691685
In [5]: pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
692-
pd.Timestamp('20160101', tz='US/Eastern')]).unique()
686+
...: pd.Timestamp('20160101', tz='US/Eastern')]).unique()
693687
Out[5]: array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')], dtype=object)
694688
695689
In [6]: pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
696-
pd.Timestamp('20160101', tz='US/Eastern')]))
690+
...: pd.Timestamp('20160101', tz='US/Eastern')]))
697691
Out[6]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
698692
699693
# Index
700694
In [7]: pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
701-
pd.Timestamp('20160101', tz='US/Eastern')]).unique()
695+
...: pd.Timestamp('20160101', tz='US/Eastern')]).unique()
702696
Out[7]: DatetimeIndex(['2016-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq=None)
703697
704698
In [8]: pd.unique([pd.Timestamp('20160101', tz='US/Eastern'),
705-
pd.Timestamp('20160101', tz='US/Eastern')])
699+
...: pd.Timestamp('20160101', tz='US/Eastern')])
706700
Out[8]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
707701
708702
New Behavior:
@@ -725,7 +719,7 @@ New Behavior:
725719

726720
Previous behaviour:
727721

728-
.. code-block:: ipython
722+
.. code-block:: ipython
729723
730724
In [1]: pd.Series(list('baabc'), dtype='category').unique()
731725
Out[1]:
@@ -766,7 +760,7 @@ Partial String Indexing Changes
766760
'2012-01-01 00:00:01']))
767761
Previous Behavior:
768762

769-
.. code-block:: ipython
763+
.. code-block:: ipython
770764
771765
In [4]: df['2011-12-31 23:59:59']
772766
Out[4]:
@@ -781,7 +775,7 @@ Previous Behavior:
781775
782776
New Behavior:
783777

784-
.. code-block:: ipython
778+
.. code-block:: ipython
785779
786780
In [4]: df['2011-12-31 23:59:59']
787781
KeyError: '2011-12-31 23:59:59'
@@ -807,7 +801,7 @@ Now the smallest acceptable dtype will be used (:issue:`13247`)
807801
808802
Previous Behavior:
809803

810-
.. code-block:: ipython
804+
.. code-block:: ipython
811805
812806
In [7]: pd.concat([df1, df2]).dtypes
813807
Out[7]:
@@ -838,9 +832,9 @@ In previous versions, showing ``.memory_usage()`` on a pandas structure that has
838832

839833
Previous Behavior:
840834

841-
.. code-block:: ipython
835+
.. code-block:: ipython
842836
843-
In [8]: index = Index(['foo', 'bar', 'baz'])
837+
In [8]: index = pd.Index(['foo', 'bar', 'baz'])
844838
845839
In [9]: index.memory_usage(deep=True)
846840
Out[9]: 180
@@ -853,9 +847,9 @@ Previous Behavior:
853847
854848
New Behavior:
855849

856-
.. code-block:: ipython
850+
.. code-block:: ipython
857851
858-
In [8]: index = Index(['foo', 'bar', 'baz'])
852+
In [8]: index = pd.Index(['foo', 'bar', 'baz'])
859853
860854
In [9]: index.memory_usage(deep=True)
861855
Out[9]: 180
@@ -910,7 +904,7 @@ doesn't behave as desired.
910904
911905
Previous Behavior:
912906

913-
.. code-block:: python
907+
.. code-block:: python
914908
915909
In [11]: df.sort_index()
916910
Out[11]:
@@ -945,7 +939,7 @@ This format is consistent with ``groupby.agg()`` when applying multiple function
945939

946940
Previous Behavior:
947941

948-
.. code-block:: ipython
942+
.. code-block:: ipython
949943
950944
In [1]: df = pd.DataFrame({'A': [1, 1, 2, 2], 'B': [1, 2, 3, 4]})
951945
@@ -1010,7 +1004,7 @@ See the section on :ref:`Windowed Binary Operations <stats.moments.binary>` for
10101004
10111005
Previous Behavior:
10121006

1013-
.. code-block:: ipython
1007+
.. code-block:: ipython
10141008
10151009
In [2]: df.rolling(12).corr()
10161010
Out[2]:
@@ -1050,7 +1044,7 @@ usually resulting in an invalid comparison, returning an empty result frame. The
10501044
10511045
Previous Behavior:
10521046

1053-
.. code-block:: ipython
1047+
.. code-block:: ipython
10541048
10551049
In [4]: pd.read_hdf('store.h5', 'key', where='unparsed_date > ts')
10561050
File "<string>", line 1
@@ -1060,7 +1054,7 @@ Previous Behavior:
10601054
10611055
New Behavior:
10621056

1063-
.. code-block:: ipython
1057+
.. code-block:: ipython
10641058
10651059
In [18]: ts = pd.Timestamp('2014-01-01')
10661060
@@ -1116,7 +1110,7 @@ New Behavior:
11161110
11171111
Previous Behavior:
11181112
1119-
.. code-block:: ipython
1113+
.. code-block:: ipython
11201114
11211115
In [4]: left.join(right, how='inner')
11221116
Out[4]:
@@ -1147,7 +1141,7 @@ is fixed that allowed this to return a ``Series`` under certain circumstance. (:
11471141
11481142
Previous Behavior:
11491143

1150-
.. code-block:: ipython
1144+
.. code-block:: ipython
11511145
11521146
In [2]: df.pivot_table('col1', index=['col3', 'col2'], aggfunc=np.sum)
11531147
Out[2]:
@@ -1263,7 +1257,7 @@ will be removed from the ``*.common`` locations in a future release. (:issue:`15
12631257

12641258
The following are now part of this API:
12651259

1266-
.. code-block:: python
1260+
.. code-block:: python
12671261
12681262
['DtypeWarning',
12691263
'EmptyDataError',
@@ -1337,7 +1331,7 @@ Using ``.ix`` will now show a ``DeprecationWarning`` with a link to some example
13371331
13381332
Previous Behavior, where you wish to get the 0th and the 2nd elements from the index in the 'A' column.
13391333

1340-
.. code-block:: ipython
1334+
.. code-block:: ipython
13411335
13421336
In [3]: df.ix[[0, 2], 'A']
13431337
Out[3]:
@@ -1423,7 +1417,7 @@ columns and applying the list of functions. This returns a ``MultiIndex`` for th
14231417
Here's an example of the first deprecation, passing a dict to a grouped ``Series``. This
14241418
is a combination aggregation & renaming:
14251419

1426-
.. code-block:: ipython
1420+
.. code-block:: ipython
14271421
14281422
In [6]: df.groupby('A').B.agg({'foo': 'count'})
14291423
FutureWarning: using a dict on a Series for aggregation
@@ -1444,11 +1438,11 @@ You can accomplish the same operation, more idiomatically by:
14441438
14451439
Here's an example of the second deprecation, passing a dict-of-dict to a grouped ``DataFrame``:
14461440

1447-
.. code-block:: python
1441+
.. code-block:: python
14481442
14491443
In [23]: (df.groupby('A')
1450-
.agg({'B': {'foo': 'sum'}, 'C': {'bar': 'min'}})
1451-
)
1444+
...: .agg({'B': {'foo': 'sum'}, 'C': {'bar': 'min'}})
1445+
...: )
14521446
FutureWarning: using a dict with renaming is deprecated and
14531447
will be removed in a future version
14541448
@@ -1484,14 +1478,14 @@ Users can import these from ``pandas.plotting`` as well.
14841478

14851479
Previous script:
14861480

1487-
.. code-block:: python
1481+
.. code-block:: python
14881482
14891483
pd.tools.plotting.scatter_matrix(df)
14901484
pd.scatter_matrix(df)
14911485
14921486
Should be changed to:
14931487

1494-
.. code-block:: python
1488+
.. code-block:: python
14951489
14961490
pd.plotting.scatter_matrix(df)
14971491

0 commit comments

Comments
 (0)