Skip to content

DOC: clarify to_csv float format docstring #47436

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

Merged
merged 3 commits into from
Jun 21, 2022
Merged

Conversation

phofl
Copy link
Member

@phofl phofl commented Jun 20, 2022

I stumbled across this myself a few days ago. I think this would help

@phofl phofl added Docs IO CSV read_csv, to_csv labels Jun 20, 2022
@@ -3342,7 +3342,8 @@ def to_csv(
na_rep : str, default ''
Missing data representation.
float_format : str, default None
Format string for floating point numbers.
Format string for floating point numbers. If a format is given, it takes
precedence over other numeric formatting parameters, like decimal.
Copy link
Member

Choose a reason for hiding this comment

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

Do you know if we have a unit test for this behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good Point. I'll check. If not, I'll add my use case that showed this

Copy link
Member Author

Choose a reason for hiding this comment

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

Thx for asking, I forgot something yesterday. This is only true if you pass a Callable, which is supported but was not documented

@mroeschke mroeschke added this to the 1.5 milestone Jun 21, 2022
@mroeschke mroeschke merged commit e63885f into pandas-dev:main Jun 21, 2022
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the doc_to_csv branch June 21, 2022 22:01
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
* DOC: clarify to_csv float format docstring

* Clarify doc

* Clarify doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants