Skip to content

Conversation

lusolorz
Copy link
Contributor

  • closes BUG: DataFrame.style displays wrong value for long integers #52272
  • added tests 'test_to_latex_exceeding_float_point_double' to 'test_to_latex.py' and 'test_to_html_float_point_double' to 'test_to_html.py'
  • All [code checks passed]
  • Added [type annotations] N/A
  • Added an entry in the latest doc/source/whatsnew/v2.1.0.rst file
    Fix Description: Returns string if value exceeds float point double to avoid loss of precision.

@@ -305,6 +305,8 @@ Conversion
^^^^^^^^^^
- Bug in :meth:`ArrowDtype.numpy_dtype` returning nanosecond units for non-nanosecond ``pyarrow.timestamp`` and ``pyarrow.duration`` types (:issue:`51800`)
- Bug in :meth:`DataFrame.info` raising ``ValueError`` when ``use_numba`` is set (:issue:`51922`)
- Bug in :func:`_default_formatter`, If the DataFrame contains integers with more digits than can be represented by floating point double precision
Copy link
Member

@mroeschke mroeschke Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Bug in :func:`_default_formatter`, If the DataFrame contains integers with more digits than can be represented by floating point double precision
- Bug in :func:`DataFrame.style.to_latex` and :func:`DataFrame.style.to_html` if the DataFrame contains integers with more digits than can be represented by floating point double precision (:issue:`52272`)

@@ -305,6 +305,8 @@ Conversion
^^^^^^^^^^
- Bug in :meth:`ArrowDtype.numpy_dtype` returning nanosecond units for non-nanosecond ``pyarrow.timestamp`` and ``pyarrow.duration`` types (:issue:`51800`)
- Bug in :meth:`DataFrame.info` raising ``ValueError`` when ``use_numba`` is set (:issue:`51922`)
- Bug in :func:`_default_formatter`, If the DataFrame contains integers with more digits than can be represented by floating point double precision
_default_formatter returns incorrect data value truncated due to loss of precision. Fix adds to html or latex as string in this case (:issue:`52272`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_default_formatter returns incorrect data value truncated due to loss of precision. Fix adds to html or latex as string in this case (:issue:`52272`)

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also address the failures in the code check job

@mroeschke mroeschke added the Styler conditional formatting using DataFrame.style label Apr 17, 2023
@mroeschke mroeschke added this to the 2.1 milestone Apr 18, 2023
@mroeschke mroeschke merged commit f780104 into pandas-dev:main Apr 18, 2023
@mroeschke
Copy link
Member

Thanks @lusolorz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrame.style displays wrong value for long integers
3 participants