Skip to content
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

to_clipboard excel defaults to "None", but doc string says "True" #19404

Closed
upkarlidder opened this issue Jan 26, 2018 · 3 comments · Fixed by #19425
Closed

to_clipboard excel defaults to "None", but doc string says "True" #19404

upkarlidder opened this issue Jan 26, 2018 · 3 comments · Fixed by #19425
Labels
Docs IO Data IO issues that don't fit into a more specific label
Milestone

Comments

@upkarlidder
Copy link

upkarlidder commented Jan 26, 2018

Problem description

I just started using python/pandas a couple of months ago. So this might be a misunderstanding on my part. The excel argument to the to_clipboard function defaults to "None", but doc string says "True". If this is a simple docstring change, I would like to contribute :)

pandas/pandas/core/generic.py

Lines 1566 to 1589 in a00154d

def to_clipboard(self, excel=None, sep=None, **kwargs):
"""
Attempt to write text representation of object to the system clipboard
This can be pasted into Excel, for example.
Parameters
----------
excel : boolean, defaults to True
if True, use the provided separator, writing in a csv
format for allowing easy pasting into excel.
if False, write a string representation of the object
to the clipboard
sep : optional, defaults to tab
other keywords are passed to to_csv
Notes
-----
Requirements for your platform
- Linux: xclip, or xsel (with gtk or PyQt4 modules)
- Windows: none
- OS X: none
"""
from pandas.io import clipboards
clipboards.to_clipboard(self, excel=excel, sep=sep, **kwargs)

Expected Output

The docstring should be defaults to None

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]
INSTALLED VERSIONS

commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Darwin
OS-release: 16.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.22.0
pytest: None
pip: 9.0.1
setuptools: 38.4.0
Cython: None
numpy: 1.14.0
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

@upkarlidder
Copy link
Author

Ah ~ I see what is going on here.

if excel is None:
excel = True

The docstring is definitely confusing when looking at the signature. Not sure if there is a better docstring.

@chris-b1
Copy link
Contributor

I think default arg in the function signature could be changed to True - want to try a PR?

@chris-b1 chris-b1 added Docs IO Data IO issues that don't fit into a more specific label Effort Low labels Jan 26, 2018
@upkarlidder
Copy link
Author

#19425

Thank you @chris-b1. I tried to follow the guidelines as best I could.

@jreback jreback added this to the 0.23.0 milestone Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants