MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / is_numeric

Function is_numeric

python-package/lightgbmmt/basic.py:48–56  ·  view source on GitHub ↗

Check whether object is a number or not, include numpy number, etc.

(obj)

Source from the content-addressed store, hash-verified

46
47
48def is_numeric(obj):
49 """Check whether object is a number or not, include numpy number, etc."""
50 try:
51 float(obj)
52 return True
53 except (TypeError, ValueError):
54 # TypeError: obj is not a string or a number
55 # ValueError: invalid literal
56 return False
57
58
59def is_numpy_1d_array(data):

Callers 2

is_1d_listFunction · 0.85
param_dict_to_strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected