Skip to content

Commit 1e30a67

Browse files
RomainSajreback
authored andcommitted
DOC/TST: doctests leaving extraneous files (#23858)
1 parent 54932d0 commit 1e30a67

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pandas/core/frame.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2028,8 +2028,9 @@ def to_parquet(self, fname, engine='auto', compression='snappy',
20282028
Examples
20292029
--------
20302030
>>> df = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]})
2031-
>>> df.to_parquet('df.parquet.gzip', compression='gzip')
2032-
>>> pd.read_parquet('df.parquet.gzip')
2031+
>>> df.to_parquet('df.parquet.gzip',
2032+
... compression='gzip') # doctest: +SKIP
2033+
>>> pd.read_parquet('df.parquet.gzip') # doctest: +SKIP
20332034
col1 col2
20342035
0 1 3
20352036
1 2 4
@@ -2243,7 +2244,8 @@ def info(self, verbose=None, buf=None, max_cols=None, memory_usage=None,
22432244
>>> buffer = io.StringIO()
22442245
>>> df.info(buf=buffer)
22452246
>>> s = buffer.getvalue()
2246-
>>> with open("df_info.txt", "w", encoding="utf-8") as f:
2247+
>>> with open("df_info.txt", "w",
2248+
... encoding="utf-8") as f: # doctest: +SKIP
22472249
... f.write(s)
22482250
260
22492251

pandas/core/generic.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -2069,25 +2069,26 @@ def _repr_latex_(self):
20692069
>>> df1 = pd.DataFrame([['a', 'b'], ['c', 'd']],
20702070
... index=['row 1', 'row 2'],
20712071
... columns=['col 1', 'col 2'])
2072-
>>> df1.to_excel("output.xlsx")
2072+
>>> df1.to_excel("output.xlsx") # doctest: +SKIP
20732073
20742074
To specify the sheet name:
20752075
2076-
>>> df1.to_excel("output.xlsx", sheet_name='Sheet_name_1')
2076+
>>> df1.to_excel("output.xlsx",
2077+
... sheet_name='Sheet_name_1') # doctest: +SKIP
20772078
20782079
If you wish to write to more than one sheet in the workbook, it is
20792080
necessary to specify an ExcelWriter object:
20802081
20812082
>>> df2 = df1.copy()
2082-
>>> with pd.ExcelWriter('output.xlsx') as writer:
2083+
>>> with pd.ExcelWriter('output.xlsx') as writer: # doctest: +SKIP
20832084
... df1.to_excel(writer, sheet_name='Sheet_name_1')
20842085
... df2.to_excel(writer, sheet_name='Sheet_name_2')
20852086
20862087
To set the library that is used to write the Excel file,
20872088
you can pass the `engine` keyword (the default engine is
20882089
automatically chosen depending on the file extension):
20892090
2090-
>>> df1.to_excel('output1.xlsx', engine='xlsxwriter')
2091+
>>> df1.to_excel('output1.xlsx', engine='xlsxwriter') # doctest: +SKIP
20912092
"""
20922093

20932094
def to_json(self, path_or_buf=None, orient=None, date_format=None,

0 commit comments

Comments
 (0)