astanin / python-tabulate

Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
https://pypi.org/project/tabulate/
MIT License
2.1k stars 163 forks source link

Update _isnumber to ensure the output string convertible to float #252

Open zhihanyue opened 1 year ago

zhihanyue commented 1 year ago

The numpy.datetime64[ns] was recognized as float, because numpy.datetime64[ns] is convertible to float. This PR fixes this problem.

Fix #251

andy-maier commented 1 year ago

While this PR may solve the issue with numpy.datetime64, it does not go far enough to also fix incorrect conversions of strings to float, e.g. "1E10" becomes 1e+10. See issue #266 I still think this PR can go forward, I just wanted to mention it.

Update: I discovered disable_numparse=True which solves that issue ... never mind ...