`tabulate.tabulate([['126,000']], tablefmt="html")` raises error starting in 0.8.8
See original GitHub issueStarting in 0.8.8 we’re seeing errors when converting to HTML with large numbers encoded as strings:
import tabualate
tabulate.tabulate([['126,000']], tablefmt="html")
Error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-37ea0f4d62eb> in <module>()
1 import tabulate
2 print(tabulate.__version__)
----> 3 tabulate.tabulate([['126,000']], tablefmt="html")
3 frames
/usr/local/lib/python3.6/dist-packages/tabulate.py in _format(val, valtype, floatfmt, missingval, has_invisible)
1002 return val.replace(raw_val, formatted_val)
1003 else:
-> 1004 return format(float(val), floatfmt)
1005 else:
1006 return "{0}".format(val)
ValueError: could not convert string to float: '126,000'
This works in previous versions of tabulate, see https://colab.research.google.com/gist/tomhennigan/55ffecb257911296cf181ae968a7356a/tabulate-0-8-8-bug.ipynb for an example.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
tabulate · PyPI
Pretty-print tabular data in Python, a library and a command-line utility. The main use cases of the library are: printing small tables without...
Read more >Trouble importing Tabulate with Python 3.7 - Stack Overflow
I'm running Python 3.7 on Windows 10 and I keep getting No module named 'tabulate' error. I have deleted Python 2. I've tried...
Read more >cmck/python-tabulate - GitHub
Pretty-print tabular data in Python, a library and a command-line utility. The main use cases of the library are: printing small tables without...
Read more >python-tabulate - Bountysource
Starting in 0.8.8 we're seeing errors when converting to HTML with large numbers encoded as strings: import tabualate tabulate.tabulate([['126,000']], ...
Read more >How to use the tabulate.tabulate function in tabulate - Snyk
To help you get started, we've selected a few tabulate.tabulate examples, based on popular ways it is used in public projects.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For now I added
tabulate([['126,000']])
to the list of regression tests and reverted changes which caused this problem (pr #111).This bug is due to a feature introduced in 0.8.8 (pull request #51). A regression test was added, and the feature was disabled in 0.8.9 (pull request #111). It will be implemented differently.