Skip to content

Commit 5c758aa

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fu1+sort
2 parents 7efece2 + aaa4d90 commit 5c758aa

File tree

13 files changed

+610
-42
lines changed

13 files changed

+610
-42
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ Categorical
843843
``self`` but in a different order (:issue:`19551`)
844844
- Bug in :meth:`Index.astype` with a categorical dtype where the resultant index is not converted to a :class:`CategoricalIndex` for all types of index (:issue:`18630`)
845845
- Bug in :meth:`Series.astype` and ``Categorical.astype()`` where an existing categorical data does not get updated (:issue:`10696`, :issue:`18593`)
846+
- Bug in :meth:`Series.str.split` with ``expand=True`` incorrectly raising an IndexError on empty strings (:issue:`20002`).
846847
- Bug in :class:`Index` constructor with ``dtype=CategoricalDtype(...)`` where ``categories`` and ``ordered`` are not maintained (issue:`19032`)
847848
- Bug in :class:`Series` constructor with scalar and ``dtype=CategoricalDtype(...)`` where ``categories`` and ``ordered`` are not maintained (issue:`19565`)
848849
- Bug in ``Categorical.__iter__`` not converting to Python types (:issue:`19909`)

pandas/_libs/tslibs/period.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ cdef class _Period(object):
13551355
13561356
Returns
13571357
-------
1358-
int
1358+
int
13591359
13601360
See Also
13611361
--------
@@ -1371,7 +1371,7 @@ cdef class _Period(object):
13711371
>>> p = pd.Period("2018-02-01", "D")
13721372
>>> p.week
13731373
5
1374-
1374+
13751375
>>> p = pd.Period("2018-01-06", "D")
13761376
>>> p.week
13771377
1

pandas/core/dtypes/inference.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,37 @@ def is_number(obj):
2828
"""
2929
Check if the object is a number.
3030
31+
Returns True when the object is a number, and False if is not.
32+
3133
Parameters
3234
----------
33-
obj : The object to check.
35+
obj : any type
36+
The object to check if is a number.
3437
3538
Returns
3639
-------
3740
is_number : bool
3841
Whether `obj` is a number or not.
3942
43+
See Also
44+
--------
45+
pandas.api.types.is_integer: checks a subgroup of numbers
46+
4047
Examples
4148
--------
42-
>>> is_number(1)
49+
>>> pd.api.types.is_number(1)
50+
True
51+
>>> pd.api.types.is_number(7.15)
4352
True
44-
>>> is_number("foo")
53+
54+
Booleans are valid because they are int subclass.
55+
56+
>>> pd.api.types.is_number(False)
57+
True
58+
59+
>>> pd.api.types.is_number("foo")
60+
False
61+
>>> pd.api.types.is_number("5")
4562
False
4663
"""
4764

0 commit comments

Comments
 (0)