Skip to content

Commit 9dcc075

Browse files
DeaMariaLeonim-vinicius
authored and
im-vinicius
committed
DOC: Fixing EX01 - Added examples (pandas-dev#53880)
* read_clipboard * Examples read_clipboard, ExcelFile, ExcelFile.parse * skip test for read_clipboard * Added to ExcelFile example
1 parent 403e111 commit 9dcc075

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

ci/code_checks.sh

-3
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
105105
pandas.errors.UnsupportedFunctionCall \
106106
pandas.test \
107107
pandas.NaT \
108-
pandas.read_clipboard \
109-
pandas.ExcelFile \
110-
pandas.ExcelFile.parse \
111108
pandas.io.formats.style.Styler.to_html \
112109
pandas.HDFStore.groups \
113110
pandas.HDFStore.walk \

pandas/io/clipboards.py

+5
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ def read_clipboard(
6363
6464
Examples
6565
--------
66+
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])
67+
>>> df.to_clipboard() # doctest: +SKIP
6668
>>> pd.read_clipboard() # doctest: +SKIP
69+
A B C
70+
0 1 2 3
71+
1 4 5 6
6772
"""
6873
encoding = kwargs.pop("encoding", "utf-8")
6974

pandas/io/excel/_base.py

+13
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,12 @@ class ExcelFile:
14801480
This is not supported, switch to using ``openpyxl`` instead.
14811481
engine_kwargs : dict, optional
14821482
Arbitrary keyword arguments passed to excel engine.
1483+
1484+
Examples
1485+
--------
1486+
>>> file = pd.ExcelFile('myfile.xlsx') # doctest: +SKIP
1487+
>>> with pd.ExcelFile("myfile.xls") as xls: # doctest: +SKIP
1488+
... df1 = pd.read_excel(xls, "Sheet1") # doctest: +SKIP
14831489
"""
14841490

14851491
from pandas.io.excel._odfreader import ODFReader
@@ -1595,6 +1601,13 @@ def parse(
15951601
-------
15961602
DataFrame or dict of DataFrames
15971603
DataFrame from the passed in Excel file.
1604+
1605+
Examples
1606+
--------
1607+
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])
1608+
>>> df.to_excel('myfile.xlsx') # doctest: +SKIP
1609+
>>> file = pd.ExcelFile('myfile.xlsx') # doctest: +SKIP
1610+
>>> file.parse() # doctest: +SKIP
15981611
"""
15991612
return self._reader.parse(
16001613
sheet_name=sheet_name,

0 commit comments

Comments
 (0)