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

Minor improvement: Change to_excel "sheet_name" to "sheetname" #10559

Closed
saintsfan342000 opened this issue Jul 12, 2015 · 2 comments · Fixed by #16442
Closed

Minor improvement: Change to_excel "sheet_name" to "sheetname" #10559

saintsfan342000 opened this issue Jul 12, 2015 · 2 comments · Fixed by #16442
Labels
API Design IO Excel read_excel, to_excel

Comments

@saintsfan342000
Copy link

pd.read_excel() takes "sheetname" as an argument.
pd.DataFrame.to_excel() takes "sheet_name" as an argument.

For consistency, I think one ought to be changed to match the other.
On my windows installation of pandas 0.16.2, I modified to_excel to take sheetname rather than sheet_name. All I had to do was locate frame.py within the core directory. to_excel() is defined here, and sheet_name is written twice in the function and once in the docstring.

Very new to github so if ideas like these are more appropriately filed through PRs I apologize.

@jorisvandenbossche jorisvandenbossche added API Design IO Excel read_excel, to_excel labels Jul 13, 2015
@jorisvandenbossche jorisvandenbossche added this to the 0.17.0 milestone Jul 13, 2015
@jorisvandenbossche
Copy link
Member

Agree we should make them the same (at least make it available, maybe not necessary to actually deprecate the discouraged alias).

I am only not fully sure if would go with sheetname instead of sheet_name (we are not always very consistent in the use of _ to separate words in keywords, but I think the general policy is to use them).

And @saintsfan342000, opening an issue for this is very good! If you get approval, always welcome to open a PR afterwards!

@abarber4gh
Copy link
Contributor

abarber4gh commented May 22, 2017

current (0.20.x) branch appears to mostly use sheet_name so propose changing sheetname to sheet_name.

$ git status
On branch 0.20.x

49 occurrences of sheet_name in io

$ grep -rc sheet_name pandas/io | grep -v 0
pandas/io/excel.py:42
pandas/io/formats/excel.py:3
pandas/io/formats/style.py:2

25 occurrences of sheetname in io

$ grep -rc sheetname pandas/io | grep -v 0
pandas/io/excel.py:25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design IO Excel read_excel, to_excel
Projects
None yet
4 participants