You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, when using certain iteration methods for a ``Series`` with dtype ``int`` or ``float``, you would receive a ``numpy`` scalar, e.g. a ``np.int64``, rather than a python ``int``. Issue (:issue:`10904`) corrected this for ``Series.tolist()`` and ``list(Series)``. This change makes all iteration methods consistent, in particular, for ``__iter__()`` and ``.map()``; note that this only affect int/float dtypes. (:issue:`13236`, :issue:`13258`, :issue:`14216`).
196
+
Previously, when using certain iteration methods for a ``Series`` with dtype ``int`` or ``float``, you would receive a ``numpy`` scalar, e.g. a ``np.int64``, rather than a python ``int``. Issue (:issue:`10904`) corrected this for ``Series.tolist()`` and ``list(Series)``. This change makes all iteration methods consistent, in particular, for ``__iter__()`` and ``.map()``; note that this only affects int/float dtypes. (:issue:`13236`, :issue:`13258`, :issue:`14216`).
197
197
198
198
.. ipython:: python
199
199
200
-
s = Series([1, 2, 3])
200
+
s = pd.Series([1, 2, 3])
201
201
s
202
202
203
203
Previously:
204
204
205
-
.. code-block:: python
205
+
.. code-block:: ipython
206
206
207
207
In [2]: type(list(s)[0])
208
208
Out[2]: numpy.int64
@@ -215,14 +215,14 @@ New Behaviour:
215
215
216
216
Furthermore this will now correctly box the results of iteration for :func:`DataFrame.to_dict` as well.
0 commit comments