def is_number ( obj ) : return isinstance ( obj , ( int , float , np . int_ , np . float_ ) )
python check if object is numeric
Check if obj is number .
def is_number(obj):
    """Check if obj is number."""
    return isinstance(obj, (int, float, np.int_, np.float_))