File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,40 @@ For situations where you need an ``ndarray`` of ``Interval`` objects, use
238
238
np.asarray(idx)
239
239
idx.values.astype(object)
240
240
241
+
242
+ .. _whatsnew_0240.api.types.is_scalar:
243
+
244
+ Support for PEP 3141 numbers
245
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
246
+
247
+ The `is_scalar` function now returns True when a `Number` or `Fraction` is passed.
248
+
249
+ Previous Behavior:
250
+
251
+ .. code-block:: ipython
252
+
253
+ In [1]: pandas.api.types.is_scalar(fractions.Fraction(1))
254
+ Out[1]:
255
+ False
256
+
257
+ In [2]: pandas.api.types.is_scalar(numbers.Number(1))
258
+ Out[2]:
259
+ False
260
+
261
+ New Behavior:
262
+
263
+ .. code-block:: ipython
264
+
265
+ In [1]: pandas.api.types.is_scalar(fractions.Fraction(1))
266
+ Out[1]:
267
+ True
268
+
269
+ In [2]: pandas.api.types.is_scalar(numbers.Number(1))
270
+ Out[2]:
271
+ True
272
+
273
+ This mirrors ``numpy.isscalar``, which already supports PEP 3141 and is a requirement for `pandas`.
274
+
241
275
.. _whatsnew_0240.api.timezone_offset_parsing:
242
276
243
277
Parsing Datetime Strings with Timezone Offsets
You can’t perform that action at this time.
0 commit comments