question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`tabulate.tabulate([['126,000']], tablefmt="html")` raises error starting in 0.8.8

See original GitHub issue

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']], 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
astanincommented, Feb 19, 2021

For now I added tabulate([['126,000']]) to the list of regression tests and reverted changes which caused this problem (pr #111).

1reaction
astanincommented, Feb 22, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found