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
Pandas has significantly improved support for operations involving unsigned,
94
+
or purely non-negative, integers. Previously, handling these integers would
95
+
result in improper rounding or data-type casting, leading to incorrect results.
96
+
One notable place where this improved was in ``DataFrame`` creation (:issue:`14917`):
97
+
98
+
.. ipython:: python
99
+
100
+
arr = np.array([1, 2**63, 5], dtype=np.uint64)
101
+
arr
102
+
103
+
**Previous behavior**:
104
+
105
+
.. code-block:: ipython
106
+
107
+
In [3]: df = DataFrame({'a': arr})
108
+
109
+
In [4]: df['a']
110
+
Out[4]:
111
+
a
112
+
0 1
113
+
1 9223372036854775808
114
+
2 5
115
+
Name: a, dtype: object
116
+
117
+
The correct data type should unsigned 64-bit integer, not object. This release
118
+
rectifies this behavior as seen below:
119
+
120
+
**New behavior**:
121
+
122
+
.. ipython:: python
123
+
124
+
df = DataFrame({'a': arr})
125
+
df['a']
126
+
127
+
- Bug in converting object elements of array-like objects to unsigned 64-bit integers (:issue:`4471`)
128
+
- Bug in ``Series.unique()`` in which unsigned 64-bit integers were causing overflow (:issue:`14721`)
129
+
- New ``UInt64Index`` (subclass of ``NumericIndex``) for specifically indexing unsigned integers (:issue:`14935`)
130
+
91
131
.. _whatsnew_0200.enhancements.other:
92
132
93
133
Other enhancements
@@ -279,7 +319,6 @@ Bug Fixes
279
319
~~~~~~~~~
280
320
281
321
- Bug in ``TimedeltaIndex`` addition where overflow was being allowed without error (:issue:`14816`)
282
-
- Bug in ``DataFrame`` construction in which unsigned 64-bit integer elements were being converted to objects (:issue:`14881`)
283
322
- Bug in ``astype()`` where ``inf`` values were incorrectly converted to integers. Now raises error now with ``astype()`` for Series and DataFrames (:issue:`14265`)
284
323
- Bug in ``DataFrame(..).apply(to_numeric)`` when values are of type decimal.Decimal. (:issue:`14827`)
285
324
- Bug in ``describe()`` when passing a numpy array which does not contain the median to the ``percentiles`` keyword argument (:issue:`14908`)
@@ -297,6 +336,4 @@ Bug Fixes
297
336
298
337
299
338
300
-
- Bug in ``Series.unique()`` in which unsigned 64-bit integers were causing overflow (:issue:`14721`)
301
339
- Require at least 0.23 version of cython to avoid problems with character encodings (:issue:`14699`)
302
-
- Bug in converting object elements of array-like objects to unsigned 64-bit integers (:issue:`4471`)
0 commit comments