diff --git a/README.md b/README.md index 0283a0c..ec18b22 100644 --- a/README.md +++ b/README.md @@ -766,7 +766,8 @@ column, in which case every column may have different number formatting: ``` -`intfmt` works similarly for integers +`intfmt` works similarly for integers, including signed and unsigned NumPy +integer scalars: >>> print(tabulate([["a",1000],["b",90000]], intfmt=",")) - ------ diff --git a/tabulate/__init__.py b/tabulate/__init__.py index 12a2950..3f0dd9f 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -11,6 +11,7 @@ import io from itertools import chain, zip_longest as izip_longest import math +from numbers import Integral import re import textwrap import warnings @@ -935,9 +936,10 @@ def _isint(string, inttype=int): return ( type(string) is inttype or ( - (hasattr(string, "is_integer") or hasattr(string, "__array__")) - and str(type(string)).startswith("