1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def is_number(s):
if s is None:
return False

try:
float(s)
return True
except ValueError:
pass

try:
import unicodedata
unicodedata.numeric(s)
return True
except (TypeError, ValueError):
pass

return False