@@ -6,6 +6,12 @@ v0.13.0 (August ??, 2013)
6
6
This is a major release from 0.12.0 and includes several new features and
7
7
enhancements along with a large number of bug fixes.
8
8
9
+ .. warning::
10
+
11
+ In 0.13.0 ``Series`` has internaly been refactored to no longer sub-class ``ndarray``
12
+ but instead subclass ``NDFrame``, similarly to the rest of the pandas containers. This should be
13
+ a transparent change with only very limited API implications. See :ref:`Internal Refactoring<whatsnew_0130.refactoring>`
14
+
9
15
API changes
10
16
~~~~~~~~~~~
11
17
@@ -134,44 +140,71 @@ Enhancements
134
140
from pandas import offsets
135
141
td + offsets.Minute(5) + offsets.Milli(5)
136
142
143
+ .. _whatsnew_0130.refactoring:
144
+
137
145
Internal Refactoring
138
146
~~~~~~~~~~~~~~~~~~~~
139
147
140
148
In 0.13.0 there is a major refactor primarily to subclass ``Series`` from ``NDFrame``,
141
149
which is the base class currently for ``DataFrame`` and ``Panel``, to unify methods
142
- and behaviors. Series formerly subclassed directly from ``ndarray``. (:issue:`4080`,:issue:`3862`,:issue:`816`)
150
+ and behaviors. Series formerly subclassed directly from ``ndarray``. (:issue:`4080`, :issue:`3862`, :issue:`816`)
151
+
152
+ .. warning::
153
+
154
+ There are two potential incompatibilities from < 0.13.0
155
+
156
+ - Using certain numpy functions would previously return a ``Series`` if passed a ``Series``
157
+ as an argument. This seems only to affect ``np.ones_like``, ``np.empty_like``, and
158
+ ``np.diff``. These now return ``ndarrays``.
159
+
160
+ .. ipython:: python
161
+
162
+ s = Series([1,2,3,4])
163
+
164
+ # numpy usage
165
+ np.ones_like(s)
166
+ np.diff(s)
167
+
168
+ # pandonic usage
169
+ Series(1,index=s.index)
170
+ s.diff()
171
+
172
+ - Passing a ``Series`` directly to a cython function expecting an ``ndarray`` type will no
173
+ long work directly, you must pass ``Series.values``, See :ref:`Enhancing Performance<enhancingperf.ndarray>`
174
+
175
+ - ``Series(0.5)`` would previously return the scalar ``0.5``, instead this will return a 1-element ``Series``
143
176
144
177
- Refactor of series.py/frame.py/panel.py to move common code to generic.py
145
- - added _setup_axes to created generic NDFrame structures
178
+
179
+ - added ``_setup_axes`` to created generic NDFrame structures
146
180
- moved methods
147
181
148
- - from_axes,_wrap_array,axes,ix,shape,empty,swapaxes,transpose,pop
149
- - __iter__,keys,__contains__,__len__,__neg__,__invert__
150
- - convert_objects,as_blocks,as_matrix,values
151
- - __getstate__,__setstate__ (though compat remains in frame/panel)
152
- - __getattr__,__setattr__
153
- - _indexed_same,reindex_like,reindex, align,where,mask
154
- - fillna,replace
155
- - filter (also added axis argument to selectively filter on a different axis)
156
- - reindex,reindex_axis (which was the biggest change to make generic)
157
- - truncate (moved to become part of ``NDFrame``)
182
+ - `` from_axes,_wrap_array,axes,ix,loc,iloc, shape,empty,swapaxes,transpose,pop``
183
+ - `` __iter__,keys,__contains__,__len__,__neg__,__invert__``
184
+ - `` convert_objects,as_blocks,as_matrix,values``
185
+ - `` __getstate__,__setstate__`` ( compat remains in frame/panel)
186
+ - `` __getattr__,__setattr__``
187
+ - `` _indexed_same,reindex_like,align,where,mask``
188
+ - `` fillna,replace`` (``Series`` replace is now consistent with ``DataFrame``)
189
+ - `` filter`` (also added axis argument to selectively filter on a different axis)
190
+ - `` reindex,reindex_axis`` (which was the biggest change to make generic)
191
+ - `` truncate`` (moved to become part of ``NDFrame``)
158
192
159
193
- These are API changes which make ``Panel`` more consistent with ``DataFrame``
160
- - swapaxes on a Panel with the same axes specified now return a copy
194
+
195
+ - ``swapaxes`` on a ``Panel`` with the same axes specified now return a copy
161
196
- support attribute access for setting
162
- - filter supports same api as original DataFrame filter
197
+ - filter supports same api as original `` DataFrame`` filter
163
198
164
199
- Reindex called with no arguments will now return a copy of the input object
165
200
166
201
- Series now inherits from ``NDFrame`` rather than directly from ``ndarray``.
167
202
There are several minor changes that affect the API.
168
203
169
204
- numpy functions that do not support the array interface will now
170
- return ``ndarrays`` rather than series, e.g. ``np.diff`` and ``np.where ``
205
+ return ``ndarrays`` rather than series, e.g. ``np.diff`` and ``np.ones_like ``
171
206
- ``Series(0.5)`` would previously return the scalar ``0.5``, this is no
172
207
longer supported
173
- - several methods from frame/series have moved to ``NDFrame``
174
- (convert_objects,where,mask)
175
208
- ``TimeSeries`` is now an alias for ``Series``. the property ``is_time_series``
176
209
can be used to distinguish (if desired)
177
210
@@ -199,7 +232,7 @@ and behaviors. Series formerly subclassed directly from ``ndarray``. (:issue:`40
199
232
- Internal type checking is now done via a suite of generated classes, allowing ``isinstance(value, klass)``
200
233
without having to directly import the klass, courtesy of @jtratner
201
234
202
- - Bug in Series update where the parent frame is not updating its cached based on
235
+ - Bug in Series update where the parent frame is not updating its cache based on
203
236
changes (:issue:`4080`) or types (:issue:`3217`), fillna (:issue:`3386`)
204
237
205
238
- Indexing with dtype conversions fixed (:issue:`4463`, :issue:`4204`)
0 commit comments