@@ -5,12 +5,6 @@ v0.20.1 (May 5, 2017)
5
5
6
6
{{ header }}
7
7
8
- .. ipython :: python
9
- :suppress:
10
-
11
- from pandas import * # noqa F401, F403
12
-
13
-
14
8
This is a major release from 0.19.2 and includes a number of API changes, deprecations, new features,
15
9
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all
16
10
users upgrade to this version.
@@ -685,24 +679,24 @@ data-types would yield different return types. These are now made consistent. (:
685
679
686
680
Previous behaviour:
687
681
688
- .. code-block :: ipython
682
+ .. code-block :: ipython
689
683
690
684
# Series
691
685
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()
693
687
Out[5]: array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')], dtype=object)
694
688
695
689
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')]))
697
691
Out[6]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
698
692
699
693
# Index
700
694
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()
702
696
Out[7]: DatetimeIndex(['2016-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq=None)
703
697
704
698
In [8]: pd.unique([pd.Timestamp('20160101', tz='US/Eastern'),
705
- pd.Timestamp('20160101', tz='US/Eastern')])
699
+ ...: pd.Timestamp('20160101', tz='US/Eastern')])
706
700
Out[8]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
707
701
708
702
New Behavior:
@@ -725,7 +719,7 @@ New Behavior:
725
719
726
720
Previous behaviour:
727
721
728
- .. code-block :: ipython
722
+ .. code-block :: ipython
729
723
730
724
In [1]: pd.Series(list('baabc'), dtype='category').unique()
731
725
Out[1]:
@@ -766,7 +760,7 @@ Partial String Indexing Changes
766
760
' 2012-01-01 00:00:01' ]))
767
761
Previous Behavior:
768
762
769
- .. code-block :: ipython
763
+ .. code-block :: ipython
770
764
771
765
In [4]: df['2011-12-31 23:59:59']
772
766
Out[4]:
@@ -781,7 +775,7 @@ Previous Behavior:
781
775
782
776
New Behavior:
783
777
784
- .. code-block :: ipython
778
+ .. code-block :: ipython
785
779
786
780
In [4]: df['2011-12-31 23:59:59']
787
781
KeyError: '2011-12-31 23:59:59'
@@ -807,7 +801,7 @@ Now the smallest acceptable dtype will be used (:issue:`13247`)
807
801
808
802
Previous Behavior:
809
803
810
- .. code-block :: ipython
804
+ .. code-block :: ipython
811
805
812
806
In [7]: pd.concat([df1, df2]).dtypes
813
807
Out[7]:
@@ -838,9 +832,9 @@ In previous versions, showing ``.memory_usage()`` on a pandas structure that has
838
832
839
833
Previous Behavior:
840
834
841
- .. code-block :: ipython
835
+ .. code-block :: ipython
842
836
843
- In [8]: index = Index(['foo', 'bar', 'baz'])
837
+ In [8]: index = pd. Index(['foo', 'bar', 'baz'])
844
838
845
839
In [9]: index.memory_usage(deep=True)
846
840
Out[9]: 180
@@ -853,9 +847,9 @@ Previous Behavior:
853
847
854
848
New Behavior:
855
849
856
- .. code-block :: ipython
850
+ .. code-block :: ipython
857
851
858
- In [8]: index = Index(['foo', 'bar', 'baz'])
852
+ In [8]: index = pd. Index(['foo', 'bar', 'baz'])
859
853
860
854
In [9]: index.memory_usage(deep=True)
861
855
Out[9]: 180
@@ -910,7 +904,7 @@ doesn't behave as desired.
910
904
911
905
Previous Behavior:
912
906
913
- .. code-block :: python
907
+ .. code-block :: python
914
908
915
909
In [11 ]: df.sort_index()
916
910
Out[11 ]:
@@ -945,7 +939,7 @@ This format is consistent with ``groupby.agg()`` when applying multiple function
945
939
946
940
Previous Behavior:
947
941
948
- .. code-block :: ipython
942
+ .. code-block :: ipython
949
943
950
944
In [1]: df = pd.DataFrame({'A': [1, 1, 2, 2], 'B': [1, 2, 3, 4]})
951
945
@@ -1010,7 +1004,7 @@ See the section on :ref:`Windowed Binary Operations <stats.moments.binary>` for
1010
1004
1011
1005
Previous Behavior:
1012
1006
1013
- .. code-block :: ipython
1007
+ .. code-block :: ipython
1014
1008
1015
1009
In [2]: df.rolling(12).corr()
1016
1010
Out[2]:
@@ -1050,7 +1044,7 @@ usually resulting in an invalid comparison, returning an empty result frame. The
1050
1044
1051
1045
Previous Behavior:
1052
1046
1053
- .. code-block :: ipython
1047
+ .. code-block :: ipython
1054
1048
1055
1049
In [4]: pd.read_hdf('store.h5', 'key', where='unparsed_date > ts')
1056
1050
File "<string>", line 1
@@ -1060,7 +1054,7 @@ Previous Behavior:
1060
1054
1061
1055
New Behavior:
1062
1056
1063
- .. code-block :: ipython
1057
+ .. code-block :: ipython
1064
1058
1065
1059
In [18]: ts = pd.Timestamp('2014-01-01')
1066
1060
@@ -1116,7 +1110,7 @@ New Behavior:
1116
1110
1117
1111
Previous Behavior:
1118
1112
1119
- .. code- block:: ipython
1113
+ .. code-block :: ipython
1120
1114
1121
1115
In [4]: left.join(right, how='inner')
1122
1116
Out[4]:
@@ -1147,7 +1141,7 @@ is fixed that allowed this to return a ``Series`` under certain circumstance. (:
1147
1141
1148
1142
Previous Behavior:
1149
1143
1150
- .. code-block :: ipython
1144
+ .. code-block :: ipython
1151
1145
1152
1146
In [2]: df.pivot_table('col1', index=['col3', 'col2'], aggfunc=np.sum)
1153
1147
Out[2]:
@@ -1263,7 +1257,7 @@ will be removed from the ``*.common`` locations in a future release. (:issue:`15
1263
1257
1264
1258
The following are now part of this API:
1265
1259
1266
- .. code-block :: python
1260
+ .. code-block :: python
1267
1261
1268
1262
[' DtypeWarning' ,
1269
1263
' EmptyDataError' ,
@@ -1337,7 +1331,7 @@ Using ``.ix`` will now show a ``DeprecationWarning`` with a link to some example
1337
1331
1338
1332
Previous Behavior, where you wish to get the 0th and the 2nd elements from the index in the 'A' column.
1339
1333
1340
- .. code-block :: ipython
1334
+ .. code-block :: ipython
1341
1335
1342
1336
In [3]: df.ix[[0, 2], 'A']
1343
1337
Out[3]:
@@ -1423,7 +1417,7 @@ columns and applying the list of functions. This returns a ``MultiIndex`` for th
1423
1417
Here's an example of the first deprecation, passing a dict to a grouped ``Series ``. This
1424
1418
is a combination aggregation & renaming:
1425
1419
1426
- .. code-block :: ipython
1420
+ .. code-block :: ipython
1427
1421
1428
1422
In [6]: df.groupby('A').B.agg({'foo': 'count'})
1429
1423
FutureWarning: using a dict on a Series for aggregation
@@ -1444,11 +1438,11 @@ You can accomplish the same operation, more idiomatically by:
1444
1438
1445
1439
Here's an example of the second deprecation, passing a dict-of-dict to a grouped ``DataFrame ``:
1446
1440
1447
- .. code-block :: python
1441
+ .. code-block :: python
1448
1442
1449
1443
In [23 ]: (df.groupby(' A' )
1450
- .agg({' B' : {' foo' : ' sum' }, ' C' : {' bar' : ' min' }})
1451
- )
1444
+ ... : .agg({' B' : {' foo' : ' sum' }, ' C' : {' bar' : ' min' }})
1445
+ ... : )
1452
1446
FutureWarning : using a dict with renaming is deprecated and
1453
1447
will be removed in a future version
1454
1448
@@ -1484,14 +1478,14 @@ Users can import these from ``pandas.plotting`` as well.
1484
1478
1485
1479
Previous script:
1486
1480
1487
- .. code-block :: python
1481
+ .. code-block :: python
1488
1482
1489
1483
pd.tools.plotting.scatter_matrix(df)
1490
1484
pd.scatter_matrix(df)
1491
1485
1492
1486
Should be changed to:
1493
1487
1494
- .. code-block :: python
1488
+ .. code-block :: python
1495
1489
1496
1490
pd.plotting.scatter_matrix(df)
1497
1491
0 commit comments