-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: extra leading space in to_string when index=False #36094
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
BUG: extra leading space in to_string when index=False #36094
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@onshek nice! this probably needs to be moved to 1.2 whatsnew note?
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. ping on green.
@charlesdong1991 if any comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@onshek since the default has changed from None
to True
, maybe nicer to update the docstring a bit as well, something like?
# current doc
leading_space : bool, optional
# suggested?
leading_space : bool, optional, default is True
Sure, working on it. |
@jreback @charlesdong1991 Done. Thanks for your reviews :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comment, ping on green.
doc/source/whatsnew/v1.2.0.rst
Outdated
@@ -257,7 +255,7 @@ Conversion | |||
|
|||
Strings | |||
^^^^^^^ | |||
|
|||
- Bug in :meth:`Series.to_string` adding a leading space when ``index=False`` (:issue:`24980`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also that this would affect DataFrame.to_latex
and DataFrame.to_string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also that this would affect
DataFrame.to_latex
andDataFrame.to_string
"also" waht? Do you mean give a mark here like:
Bug in :meth:Series.to_string
adding a leading space when index=False
and this would affect DataFrame.to_latex
and DataFrame.to_string
(:issue:24980
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Bug in :meth:`Series.to_string` adding a leading space when ``index=False`` (:issue:`24980`) | |
- Bug in :meth:`Series.to_string`, :meth:`DataFrame.to_string`, and :meth:`DataFrame.to_latex` adding a leading space when ``index=False`` (:issue:`24980`) |
ping if you could make this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated :)
thanks @onshek very nice! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
This PR is mainly from #29670 contributed by @charlesdong1991, and I made a few changes on his work.
The code have passed all tests modified and added in
test_format.py
andtest_to_latex.py
.Any comment is welcomed!