Skip to content

read_excel kwarg for comment? #18735

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

Closed
smsaladi opened this issue Dec 11, 2017 · 3 comments · Fixed by #18753
Closed

read_excel kwarg for comment? #18735

smsaladi opened this issue Dec 11, 2017 · 3 comments · Fixed by #18753
Labels
Milestone

Comments

@smsaladi
Copy link
Contributor

This is a feature request to add a comment kwarg to pandas.read_excel just like pandas.read_csv can accept a comment kwarg.

Sorry if this request should be placed somewhere else.

@smsaladi smsaladi changed the title read_excel arg for comment? read_excel kwarg for comment? Dec 11, 2017
@chris-b1
Copy link
Contributor

It turns out this works already, the comment kwarg gets passed down the generic parsing code, but isn't documented (or likely tested). A PR to flesh this out would be welcome

In [31]: df = pd.DataFrame({'a': ['1', '#2'], 'b': ['2', '3']})

In [32]: df.to_excel('tmp.xlsx', index=False)

In [33]: pd.read_excel('tmp.xlsx')
Out[33]: 
    a  b
0   1  2
1  #2  3

In [34]: pd.read_excel('tmp.xlsx', comment='#')
Out[34]: 
   a  b
0  1  2

@chris-b1 chris-b1 added this to the Next Major Release milestone Dec 12, 2017
@vertan
Copy link

vertan commented Dec 12, 2017

I'd like to work on this!

@JanLauGe
Copy link
Contributor

Hi @vertan, @chris-b1, I just submitted a PR referencing this, but I've only done the example for the docs. Perhaps there is more work to do here in terms of tests?

@jreback jreback modified the milestones: Next Major Release, 0.22.0 Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants