Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOC: Add comprehensive floating point precision documentation for CSV operations #62618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sah0725 wants to merge 2 commits into pandas-dev:main
base: main
Choose a base branch
Loading
from sah0725:doc-csv-float-precision

Conversation

Copy link
Contributor

@sah0725 sah0725 commented Oct 7, 2025

Closes #13159

Summary

This PR adds comprehensive documentation for floating point precision issues in CSV operations, addressing the documentation gap identified in issue #13159.

Changes

  • Added new section "Floating Point Precision in CSV" to doc/source/user_guide/io.rst
  • Includes explanation of why precision loss occurs during CSV roundtrips
  • Documents proper usage of float_format parameter with practical examples
  • Provides format specifier reference (%.6f, %.10g, %.6e, etc.)
  • Includes best practices for different data types (scientific, financial, high-precision)
  • Adds testing function for users to validate their precision needs
  • Covers dtype preservation behavior after CSV roundtrips

Examples Added

  • 6 working code examples with proper cleanup
  • Interactive ipython blocks for documentation building
  • Real-world scenarios demonstrating precision issues and solutions

Validation

  • All code examples tested and verified to work correctly
  • Proper reStructuredText formatting confirmed
  • Addresses all requirements mentioned in the original issue

sah0725 added 2 commits October 7, 2025 23:37
... operations
Addresses issue pandas-dev#13159 by adding detailed documentation about:
- Why floating point precision loss occurs in CSV roundtrips
- How to use float_format parameter to control precision
- Format specifier reference (%.6f, %.10g, %.6e, etc.)
- Best practices for different data types (scientific, financial)
- Testing function to validate roundtrip precision
- dtype preservation behavior
Includes 6 working code examples with proper cleanup and
comprehensive guidance for users experiencing CSV precision issues.
Removes trailing spaces that were causing pre-commit checks to fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

DOC: floating point precision on writing/reading to csv
1 participant

AltStyle によって変換されたページ (->オリジナル) /