numbers.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (c) 2010-2024 openpyxl
  2. from decimal import Decimal
  3. NUMERIC_TYPES = (int, float, Decimal)
  4. try:
  5. import numpy
  6. NUMPY = True
  7. except ImportError:
  8. NUMPY = False
  9. if NUMPY:
  10. NUMERIC_TYPES = NUMERIC_TYPES + (numpy.short,
  11. numpy.ushort,
  12. numpy.intc,
  13. numpy.uintc,
  14. numpy.int_,
  15. numpy.uint,
  16. numpy.longlong,
  17. numpy.ulonglong,
  18. numpy.half,
  19. numpy.float16,
  20. numpy.single,
  21. numpy.double,
  22. numpy.longdouble,
  23. numpy.int8,
  24. numpy.int16,
  25. numpy.int32,
  26. numpy.int64,
  27. numpy.uint8,
  28. numpy.uint16,
  29. numpy.uint32,
  30. numpy.uint64,
  31. numpy.intp,
  32. numpy.uintp,
  33. numpy.float32,
  34. numpy.float64,
  35. numpy.bool_,
  36. numpy.floating,
  37. numpy.integer)