Skip to content

Commit 9129dc1

Browse files
committed
DOC: updated v0.13.0/release.rst for Internal Refactoring changes
TST: additional test for series dtype conversion with where (and fix!) DOC: update docstrings in to_json/to_hdf/pd.read_hdf BLD: ujson rebase issue fixed
1 parent 7f31567 commit 9129dc1

File tree

8 files changed

+192
-160
lines changed

8 files changed

+192
-160
lines changed

doc/source/dsintro.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Series
4848

4949
In 0.13.0 ``Series`` has internaly been refactored to no longer sub-class ``ndarray``
5050
but instead subclass ``NDFrame``, similarly to the rest of the pandas containers. This should be
51-
a transparent change with only very limited API implications (See the :ref:`release notes <release.refactoring_0_13_0>`)
51+
a transparent change with only very limited API implications (See the :ref:`Internal Refactoring<whatsnew_0130.refactoring>`)
5252

5353
:class:`Series` is a one-dimensional labeled array capable of holding any data
5454
type (integers, strings, floating point numbers, Python objects, etc.). The axis

doc/source/release.rst

+18-19
Original file line numberDiff line numberDiff line change
@@ -117,43 +117,42 @@ pandas 0.13
117117

118118
**Internal Refactoring**
119119

120-
.. _release.refactoring_0_13_0:
121-
122120
In 0.13.0 there is a major refactor primarily to subclass ``Series`` from ``NDFrame``,
123121
which is the base class currently for ``DataFrame`` and ``Panel``, to unify methods
124-
and behaviors. Series formerly subclassed directly from ``ndarray``. (:issue:`4080`,:issue:`3862`,:issue:`816`)
122+
and behaviors. Series formerly subclassed directly from ``ndarray``. (:issue:`4080`, :issue:`3862`, :issue:`816`)
123+
See :ref:`Internal Refactoring<whatsnew_0130.refactoring>`
125124

126125
- Refactor of series.py/frame.py/panel.py to move common code to generic.py
127-
- added _setup_axes to created generic NDFrame structures
126+
127+
- added ``_setup_axes`` to created generic NDFrame structures
128128
- moved methods
129129

130-
- from_axes,_wrap_array,axes,ix,loc,iloc,shape,empty,swapaxes,transpose,pop
131-
- __iter__,keys,__contains__,__len__,__neg__,__invert__
132-
- convert_objects,as_blocks,as_matrix,values
133-
- __getstate__,__setstate__ (though compat remains in frame/panel)
134-
- __getattr__,__setattr__
135-
- _indexed_same,reindex_like,reindex,align,where,mask
136-
- fillna,replace
137-
- filter (also added axis argument to selectively filter on a different axis)
138-
- reindex,reindex_axis (which was the biggest change to make generic)
139-
- truncate (moved to become part of ``NDFrame``)
130+
- ``from_axes,_wrap_array,axes,ix,loc,iloc,shape,empty,swapaxes,transpose,pop``
131+
- ``__iter__,keys,__contains__,__len__,__neg__,__invert__``
132+
- ``convert_objects,as_blocks,as_matrix,values``
133+
- ``__getstate__,__setstate__`` (compat remains in frame/panel)
134+
- ``__getattr__,__setattr__``
135+
- ``_indexed_same,reindex_like,align,where,mask``
136+
- ``fillna,replace`` (``Series`` replace is now consistent with ``DataFrame``)
137+
- ``filter`` (also added axis argument to selectively filter on a different axis)
138+
- ``reindex,reindex_axis`` (which was the biggest change to make generic)
139+
- ``truncate`` (moved to become part of ``NDFrame``)
140140

141141
- These are API changes which make ``Panel`` more consistent with ``DataFrame``
142-
- swapaxes on a Panel with the same axes specified now return a copy
142+
143+
- ``swapaxes`` on a ``Panel`` with the same axes specified now return a copy
143144
- support attribute access for setting
144-
- filter supports same api as original DataFrame filter
145+
- filter supports same api as original ``DataFrame`` filter
145146

146147
- Reindex called with no arguments will now return a copy of the input object
147148

148149
- Series now inherits from ``NDFrame`` rather than directly from ``ndarray``.
149150
There are several minor changes that affect the API.
150151

151152
- numpy functions that do not support the array interface will now
152-
return ``ndarrays`` rather than series, e.g. ``np.diff`` and ``np.where``
153+
return ``ndarrays`` rather than series, e.g. ``np.diff`` and ``np.ones_like``
153154
- ``Series(0.5)`` would previously return the scalar ``0.5``, this is no
154155
longer supported
155-
- several methods from frame/series have moved to ``NDFrame``
156-
(convert_objects,where,mask)
157156
- ``TimeSeries`` is now an alias for ``Series``. the property ``is_time_series``
158157
can be used to distinguish (if desired)
159158

doc/source/v0.13.0.txt

+51-18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ v0.13.0 (August ??, 2013)
66
This is a major release from 0.12.0 and includes several new features and
77
enhancements along with a large number of bug fixes.
88

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+
915
API changes
1016
~~~~~~~~~~~
1117

@@ -134,44 +140,71 @@ Enhancements
134140
from pandas import offsets
135141
td + offsets.Minute(5) + offsets.Milli(5)
136142

143+
.. _whatsnew_0130.refactoring:
144+
137145
Internal Refactoring
138146
~~~~~~~~~~~~~~~~~~~~
139147

140148
In 0.13.0 there is a major refactor primarily to subclass ``Series`` from ``NDFrame``,
141149
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``
143176

144177
- 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
146180
- moved methods
147181

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``)
158192

159193
- 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
161196
- support attribute access for setting
162-
- filter supports same api as original DataFrame filter
197+
- filter supports same api as original ``DataFrame`` filter
163198

164199
- Reindex called with no arguments will now return a copy of the input object
165200

166201
- Series now inherits from ``NDFrame`` rather than directly from ``ndarray``.
167202
There are several minor changes that affect the API.
168203

169204
- 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``
171206
- ``Series(0.5)`` would previously return the scalar ``0.5``, this is no
172207
longer supported
173-
- several methods from frame/series have moved to ``NDFrame``
174-
(convert_objects,where,mask)
175208
- ``TimeSeries`` is now an alias for ``Series``. the property ``is_time_series``
176209
can be used to distinguish (if desired)
177210

@@ -199,7 +232,7 @@ and behaviors. Series formerly subclassed directly from ``ndarray``. (:issue:`40
199232
- Internal type checking is now done via a suite of generated classes, allowing ``isinstance(value, klass)``
200233
without having to directly import the klass, courtesy of @jtratner
201234

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
203236
changes (:issue:`4080`) or types (:issue:`3217`), fillna (:issue:`3386`)
204237

205238
- Indexing with dtype conversions fixed (:issue:`4463`, :issue:`4204`)

0 commit comments

Comments
 (0)