|
53 | 53 | from pandas.tseries.period import PeriodIndex
|
54 | 54 | from pandas.tseries.index import DatetimeIndex
|
55 | 55 | from pandas.tseries.tdi import TimedeltaIndex
|
56 |
| - |
| 56 | +from pandas.io.common import _expand_user |
57 | 57 |
|
58 | 58 | import pandas.core.algorithms as algos
|
59 | 59 | import pandas.core.base as base
|
@@ -1315,7 +1315,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
|
1315 | 1315 | .. versionadded:: 0.16.0
|
1316 | 1316 |
|
1317 | 1317 | """
|
1318 |
| - |
| 1318 | + path_or_buf = _expand_user(path_or_buf) |
1319 | 1319 | formatter = fmt.CSVFormatter(self, path_or_buf,
|
1320 | 1320 | line_terminator=line_terminator,
|
1321 | 1321 | sep=sep, encoding=encoding,
|
@@ -1518,6 +1518,7 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
|
1518 | 1518 | FutureWarning, stacklevel=2)
|
1519 | 1519 | col_space = colSpace
|
1520 | 1520 |
|
| 1521 | + buf = _expand_user(buf) |
1521 | 1522 | formatter = fmt.DataFrameFormatter(self, buf=buf, columns=columns,
|
1522 | 1523 | col_space=col_space, na_rep=na_rep,
|
1523 | 1524 | formatters=formatters,
|
@@ -1568,6 +1569,7 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
|
1568 | 1569 | FutureWarning, stacklevel=2)
|
1569 | 1570 | col_space = colSpace
|
1570 | 1571 |
|
| 1572 | + buf = _expand_user(buf) |
1571 | 1573 | formatter = fmt.DataFrameFormatter(self, buf=buf, columns=columns,
|
1572 | 1574 | col_space=col_space, na_rep=na_rep,
|
1573 | 1575 | header=header, index=index,
|
|
0 commit comments