Skip to content

Commit

Permalink
DOC: Fixing EX01 - Added examples (#53880)
Browse files Browse the repository at this point in the history
* read_clipboard

* Examples read_clipboard, ExcelFile, ExcelFile.parse

* skip test for read_clipboard

* Added to ExcelFile example
  • Loading branch information
DeaMariaLeon authored Jun 28, 2023
1 parent e721af6 commit 75af60b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.errors.UnsupportedFunctionCall \
pandas.test \
pandas.NaT \
pandas.read_clipboard \
pandas.ExcelFile \
pandas.ExcelFile.parse \
pandas.io.formats.style.Styler.to_html \
pandas.HDFStore.groups \
pandas.HDFStore.walk \
Expand Down
5 changes: 5 additions & 0 deletions pandas/io/clipboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def read_clipboard(
Examples
--------
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])
>>> df.to_clipboard() # doctest: +SKIP
>>> pd.read_clipboard() # doctest: +SKIP
A B C
0 1 2 3
1 4 5 6
"""
encoding = kwargs.pop("encoding", "utf-8")

Expand Down
13 changes: 13 additions & 0 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,12 @@ class ExcelFile:
This is not supported, switch to using ``openpyxl`` instead.
engine_kwargs : dict, optional
Arbitrary keyword arguments passed to excel engine.
Examples
--------
>>> file = pd.ExcelFile('myfile.xlsx') # doctest: +SKIP
>>> with pd.ExcelFile("myfile.xls") as xls: # doctest: +SKIP
... df1 = pd.read_excel(xls, "Sheet1") # doctest: +SKIP
"""

from pandas.io.excel._odfreader import ODFReader
Expand Down Expand Up @@ -1595,6 +1601,13 @@ def parse(
-------
DataFrame or dict of DataFrames
DataFrame from the passed in Excel file.
Examples
--------
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])
>>> df.to_excel('myfile.xlsx') # doctest: +SKIP
>>> file = pd.ExcelFile('myfile.xlsx') # doctest: +SKIP
>>> file.parse() # doctest: +SKIP
"""
return self._reader.parse(
sheet_name=sheet_name,
Expand Down

0 comments on commit 75af60b

Please sign in to comment.