We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c36241f commit 475e442Copy full SHA for 475e442
pandas/core/dtypes/inference.py
@@ -50,19 +50,20 @@ def is_number(obj) -> bool:
50
51
Examples
52
--------
53
- >>> pd.api.types.is_number(1)
+ >>> from pandas.api.types import is_number
54
+ >>> is_number(1)
55
True
- >>> pd.api.types.is_number(7.15)
56
+ >>> is_number(7.15)
57
58
59
Booleans are valid because they are int subclass.
60
- >>> pd.api.types.is_number(False)
61
+ >>> is_number(False)
62
63
- >>> pd.api.types.is_number("foo")
64
+ >>> is_number("foo")
65
False
- >>> pd.api.types.is_number("5")
66
+ >>> is_number("5")
67
68
"""
69
return isinstance(obj, (Number, np.number))
0 commit comments