-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: tilde expansion for write functions, #11438 #11458
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
Conversation
tests pls |
class CategoricalFormatter(object): | ||
|
||
def __init__(self, categorical, buf=None, length=True, | ||
na_rep='NaN', footer=True): | ||
self.categorical = categorical | ||
self.buf = buf if buf is not None else StringIO(u("")) | ||
self.buf = _expand_user(self.buf) |
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.
doesn't belong here
actually on 2nd thought. I think you these should ONLY be used in I don't really like this here, as all of the other IO functions are localized in |
I had the same thought, but then I assumed that would cause problems for Should I put the Regarding the tests: let me start out by saying that I am oh-so-close to being out of my depth here. The current suite seems to run OK (various |
you might have a look at these: https://github.com/pydata/pandas/blob/master/pandas/io/tests/test_common.py yeh this might be quite tricky to test |
can you add a release note and we'll stick in 0.17.1 |
Closes GH11438 Enables DataFrame.to_csv(), .to_html() and .to_latex() to perform tilde expansion on file paths.
@jreback looks like I might have caused some trouble editing the most recent version of the release notes file... |
merged via ea758cd thanks! |
closes #11438
Added calls to
_expand_user()
in multiple Formatter classes so that writer functions, such asto_csv()
andto_html()
, can perform tilde expansion on file paths beginning~/
. This makes the writer functions consistent with the reader functions, such asread_csv()
. I also changed the__init__()
forCSVFormatter
to conform to the pep8 width limit.