forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv0.15.0.txt
298 lines (108 loc) · 5.99 KB
/
v0.15.0.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
.. _whatsnew_0150:
v0.15.0 (???)
-------------
This is a major release from 0.14.1 and includes a small number of API changes, several new features,
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all
users upgrade to this version.
- Highlights include:
- The ``Categorical`` type was integrated as a first-class pandas type, see here: :ref:`Categorical Changes <whatsnew_0150.cat>`
- :ref:`Other Enhancements <whatsnew_0150.enhancements>`
- :ref:`API Changes <whatsnew_0150.api>`
- :ref:`Performance Improvements <whatsnew_0150.performance>`
- :ref:`Prior Deprecations <whatsnew_0150.prior_deprecations>`
- :ref:`Deprecations <whatsnew_0150.deprecations>`
- :ref:`Known Issues <whatsnew_0150.knownissues>`
- :ref:`Bug Fixes <whatsnew_0150.bug_fixes>`
.. _whatsnew_0150.api:
API changes
~~~~~~~~~~~
- Passing multiple levels to `DataFrame.stack()` will now work when multiple level
numbers are passed (:issue:`7660`), and will raise a ``ValueError`` when the
levels aren't all level names or all level numbers. See
:ref:`Reshaping by stacking and unstacking <reshaping.stack_multiple>`.
- 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`)
- :func:`rolling_min`, :func:`rolling_max`, :func:`rolling_cov`, and :func:`rolling_corr`
now return objects with all ``NaN``s when ``len(arg) < min_periods <= window``
(like all other rolling functions do) rather than producing an error message. (:issue:`7766`)
For example, this is the old behavior:
.. ipython:: python
In [14]: s = Series([10, 11, 12, 13])
In [15]: rolling_min(s, window=10, min_periods=5)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-15-f622819d7987> in <module>()
----> 1 rolling_min(s, window=10, min_periods=5)
...
ValueError: min_periods (5) must be <= window (4)
whereas this is the new behavior:
.. ipython:: python
In [16]: rolling_min(s, window=10, min_periods=5)
Out[16]:
0 NaN
1 NaN
2 NaN
3 NaN
dtype: float64
.. _whatsnew_0150.cat:
Categoricals in Series/DataFrame
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:class:`~pandas.Categorical` can now be included in `Series` and `DataFrames` and gained new
methods to manipulate. Thanks to Jan Schultz for much of this API/implementation. (:issue:`3943`, :issue:`5313`, :issue:`5314`, :issue:`7444`).
.. ipython:: python
df = pd.DataFrame({"id":[1,2,3,4,5,6], "raw_grade":['a', 'b', 'b', 'a', 'a', 'e']})
# convert the raw grades to a categorical
df["grade"] = pd.Categorical(df["raw_grade"])
# Alternative: df["grade"] = df["raw_grade"].astype("category")
df["grade"]
# Rename the levels
df["grade"].cat.levels = ["very good", "good", "very bad"]
# Reorder the levels and simultaneously add the missing levels
df["grade"].cat.reorder_levels(["very bad", "bad", "medium", "good", "very good"])
df["grade"]
df.sort("grade")
df.groupby("grade").size()
See the :ref:`Categorical introduction<_categorical>` and the :ref:`API documentation<api.categorical>`.
- `pandas.core.group_agg` and `pandas.core.factor_agg` were removed. As an alternative, construct
a dataframe and use `df.groupby(<group>).agg(<func>)`.
- Supplying "codes/labels and levels" to the `pandas.Categorical` constructor is deprecated and does
not work without supplying ``compat=True``. The default mode now uses "values and levels".
Please change your code to use the ``Categorical.from_codes(...)`` constructor.
- The `pandas.Categorical.labels` attribute was renamed to `pandas.Categorical.codes` and is read
only. If you want to manipulate the `Categorical`, please use one of the
:ref:`API methods on Categoricals<api.categorical>`.
.. _whatsnew_0150.prior_deprecations:
Prior Version Deprecations/Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are prior version deprecations that are taking effect as of 0.15.0.
.. _whatsnew_0150.deprecations:
Deprecations
~~~~~~~~~~~~
.. _whatsnew_0150.knownissues:
Known Issues
~~~~~~~~~~~~
.. _whatsnew_0150.enhancements:
Enhancements
~~~~~~~~~~~~
- Added support for bool, uint8, uint16 and uint32 datatypes in ``to_stata`` (:issue:`7097`, :issue:`7365`)
- ``PeriodIndex`` supports ``resolution`` as the same as ``DatetimeIndex`` (:issue:`7708`)
.. _whatsnew_0150.performance:
Performance
~~~~~~~~~~~
- Performance improvements in ``DatetimeIndex.__iter__`` to allow faster iteration (:issue:`7683`)
.. _whatsnew_0150.experimental:
Experimental
~~~~~~~~~~~~
There are no experimental changes in 0.15.0
.. _whatsnew_0150.bug_fixes:
Bug Fixes
~~~~~~~~~
- Bug in Series 0-division with a float and integer operand dtypes (:issue:`7785`)
- Bug in ``Series.astype("unicode")`` not calling ``unicode`` on the values correctly (:issue:`7758`)
- Bug in ``DataFrame.as_matrix()`` with mixed ``datetime64[ns]`` and ``timedelta64[ns]`` dtypes (:issue:`7778`)
- Bug in ``HDFStore.select_column()`` not preserving UTC timezone info when selecting a DatetimeIndex (:issue:`7777`)
- Bug in pickles contains ``DateOffset`` may raise ``AttributeError`` when ``normalize`` attribute is reffered internally (:issue:`7748`)
- Bug in pickle deserialization that failed for pre-0.14.1 containers with dup items trying to avoid ambiguity
when matching block and manager items, when there's only one block there's no ambiguity (:issue:`7794`)
- Bug in ``is_superperiod`` and ``is_subperiod`` cannot handle higher frequencies than ``S`` (:issue:`7760`, :issue:`7772`, :issue:`7803`)
- Bug in ``DataFrame.reset_index`` which has ``MultiIndex`` contains ``PeriodIndex`` or ``DatetimeIndex`` with tz raises ``ValueError`` (:issue:`7746`, :issue:`7793`)
- Bug in ``DataFrame.plot`` with ``subplots=True`` may draw unnecessary minor xticks and yticks (:issue:`7801`)