Closed jbencina closed 1 year ago
Ah I just ran this example using the latest source code and it doesn't appear to happen. There must of been a change since the 0.9.0 release which addressed this
@jbencina Can you please specify what OS, Python and Pandas version you're using? Also tabulate.__version__
. I'm surprised it doesn't happen anymore in 0.9.0.
I suppose this is a duplicate of #18. The issue is fixed in master, but not in v0.9.0. Did you install the library from source or via PyPI?
@astanin I think we're saying the same thing. I did have the issue in 0.9.0 but not in the latest source from GitHub. I downloaded the latter after filing the issue because I was going to debug it and realized it was already fixed 🙂
I was going to debug it and realized it was already fixed 🙂
Good 😃
@astanin Do you have an approximate date for the next release? Will be bumping Pandas to use the new one when ready
@jbencina No specific date for the next release yet. There are quite some bugs to fix https://github.com/astanin/python-tabulate/milestones/v0.9.1 I'll try to remember to update this thread when it's done.
Issue
When Tabulate prints a Pandas DataFrame with an int64 field the resulting value is incorrectly shown due to overflow. It appears that Tabulate is interpreting Pandas int64 fields as float and then performing a
format()
call which fails natively in Python:Expected Behavior
This error does not happen when passing a 64 bit int as a list directly into Tabulate because it is treating the int64 as an int. I believe the fix here is that Tabulate should recognize that a DataFrame
int64
field should also be treated as an integer and not attempt to perform a floating format operation.Reproduction
Test 64bit int with Pandas DataFrame
head()
-> CorrectTest 64bit int with
tabulate()
on list data-> CorrectTest 64 bit float with with
tabulate()
on float data -> IncorrectTest 64 bit int DataFrame field with various combinations -> Incorrect