forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathv0.15.0.txt
258 lines (69 loc) · 3.31 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
.. _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
~~~~~~~~~~~
.. _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
~~~~~~~~~~~~
.. _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
~~~~~~~~~