Skip to content

Commit 5cdad82

Browse files
committed
DOC: revised 0.13 internal refactoring to add np.where
1 parent 0958d5f commit 5cdad82

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

doc/source/release.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ See :ref:`Internal Refactoring<whatsnew_0130.refactoring>`
152152
There are several minor changes that affect the API.
153153

154154
- numpy functions that do not support the array interface will now
155-
return ``ndarrays`` rather than series, e.g. ``np.diff`` and ``np.ones_like``
155+
return ``ndarrays`` rather than series, e.g. ``np.diff``, ``np.ones_like``, ``np.where``
156156
- ``Series(0.5)`` would previously return the scalar ``0.5``, this is no
157157
longer supported
158158
- ``TimeSeries`` is now an alias for ``Series``. the property ``is_time_series``

doc/source/v0.13.0.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,28 @@ and behaviors. Series formerly subclassed directly from ``ndarray``. (:issue:`40
156156
There are two potential incompatibilities from < 0.13.0
157157

158158
- Using certain numpy functions would previously return a ``Series`` if passed a ``Series``
159-
as an argument. This seems only to affect ``np.ones_like``, ``np.empty_like``, and
160-
``np.diff``. These now return ``ndarrays``.
159+
as an argument. This seems only to affect ``np.ones_like``, ``np.empty_like``,
160+
``np.diff`` and ``np.where``. These now return ``ndarrays``.
161161

162162
.. ipython:: python
163163

164164
s = Series([1,2,3,4])
165165

166-
# numpy usage
166+
Numpy Usage
167+
168+
.. ipython:: python
169+
167170
np.ones_like(s)
168171
np.diff(s)
172+
np.where(s>1,s,np.nan)
173+
174+
Pandonic Usage
175+
176+
.. ipython:: python
169177

170-
# pandonic usage
171178
Series(1,index=s.index)
172179
s.diff()
180+
s.where(s>1)
173181

174182
- Passing a ``Series`` directly to a cython function expecting an ``ndarray`` type will no
175183
long work directly, you must pass ``Series.values``, See :ref:`Enhancing Performance<enhancingperf.ndarray>`

0 commit comments

Comments
 (0)