Skip to content

DOC: update the api.types.is_number docstring #20196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions pandas/core/dtypes/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,37 @@ def is_number(obj):
"""
Check if the object is a number.

Returns True when the object is a number, and False if is not.

Parameters
----------
obj : The object to check.
obj : any type
The object to check if is a number.

Returns
-------
is_number : bool
Whether `obj` is a number or not.

See Also
--------
pandas.api.types.is_integer: checks a subgroup of numbers

Examples
--------
>>> is_number(1)
>>> pd.api.types.is_number(1)
True
>>> pd.api.types.is_number(7.15)
True
>>> is_number("foo")

Booleans are valid because they are int subclass.

>>> pd.api.types.is_number(False)
True

>>> pd.api.types.is_number("foo")
False
>>> pd.api.types.is_number("5")
False
"""

Expand Down