Skip to content

API: default value for read_excel sheet #6576

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

Merged
merged 1 commit into from
Mar 12, 2014

Conversation

clarkfitzg
Copy link
Contributor

closes #6573

Implements a default sheetname of 0 for read_excel #6573.

Before: read_excel(io, sheetname, **kwds)

After: read_excel(io, sheetname=0, **kwds)

@jreback
Copy link
Contributor

jreback commented Mar 8, 2014

can u add a test to validate this?
eg write a frame to a workbook with the name Sheet1 and another with the name 0
read back should work
pls follow the examples in the test_excel

@clarkfitzg
Copy link
Contributor Author

Sure, will do.

On Sat, Mar 8, 2014 at 3:49 AM, jreback [email protected] wrote:

can u add a test to validate this?
eg write a frame to a workbook with the name Sheet1 and another with the
name 0
read back should work
pls follow the examples in the test_excel

Reply to this email directly or view it on GitHubhttps://github.com//pull/6576#issuecomment-37095732
.

@jreback jreback added this to the 0.14.0 milestone Mar 9, 2014
@clarkfitzg
Copy link
Contributor Author

@jreback Added this within the roundtrip test.

@@ -63,6 +63,7 @@ New features
API Changes
~~~~~~~~~~~

- ``read_excel`` uses 0 as the default sheet (:issue:`6573`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add same line to v0.14.0.txt (in API section) as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also pls review io.rst / excel section : add that the default is to read the 0 th sheet in the example(s)

@clarkfitzg
Copy link
Contributor Author

@jreback Docs revised.

``sheet_name``.

- Pass a string to refer to the name of a particular sheet in the workbook.
- Pass an integer to refer to the index of a sheet. Indices follow Python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the leading spaces here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to bullet point. Looks like the other bullet point sections use leading spaces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK like this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep..that's fine...

@jreback
Copy link
Contributor

jreback commented Mar 11, 2014

all for clarity in the docs....but have to squeeze lots of things into a limited number of examples.

If you can make it more clear, by all means (but at the same time try to show as much as possible)

you can squash down to 1 commit right before we merge

@clarkfitzg
Copy link
Contributor Author

@jreback Ok, I changed those examples back to how they were.

@jreback
Copy link
Contributor

jreback commented Mar 11, 2014

ok...pls squash....

you can look at the built docs (now and a few minutes after the merged)

http://pandas-docs.github.io/pandas-docs-travis/

if you want to do a follow-up PR to fix/clarify docs...ok by me

the excel sectino COULD use some TLC!

@clarkfitzg
Copy link
Contributor Author

That's good to know about the built docs. Could we put that link in this page - http://pandas.pydata.org/developers.html#contributing-to-the-documentation

I'll squash when I get home tonight. Should I be using rebase -i? I don't want to make a mess for the maintainers to clean up like last time...

@jreback
Copy link
Contributor

jreback commented Mar 11, 2014

yeh....theirs been some work on add all of this info to the main docs, see here: http://pandas.pydata.org/pandas-docs/stable/contributing.html#contributing-to-the-documentation

interactive rebase -i is usually best

@clarkfitzg
Copy link
Contributor Author

@jreback how does this rebase look?

@jreback jreback merged commit 5be379f into pandas-dev:master Mar 12, 2014
@jreback
Copy link
Contributor

jreback commented Mar 12, 2014

looks good!

thanks...excellent PRing!

do some more

@clarkfitzg clarkfitzg deleted the excel_default branch March 12, 2014 14:00
@clarkfitzg
Copy link
Contributor Author

Glad to hear! I've got a much better handle on how to PR. Thanks @jreback for walking me through it.

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
Development

Successfully merging this pull request may close these issues.

ENH: Default for Excel sheetname
3 participants