Skip to content

Commit eb1f51f

Browse files
tapumarjorisvandenbossche
authored andcommitted
DOC: update the api.types.is_number docstring (#20196)
1 parent f4db33b commit eb1f51f

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

pandas/core/dtypes/inference.py

+20-3
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)