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

read_excel kwarg for `comment`? #18735

Closed
smsaladi opened this Issue Dec 11, 2017 · 3 comments

Comments

Projects
None yet
5 participants
@smsaladi
Contributor

smsaladi commented Dec 11, 2017

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 from read_excel arg for `comment`? to read_excel kwarg for `comment`? Dec 11, 2017

@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented Dec 12, 2017

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

This comment has been minimized.

vertan commented Dec 12, 2017

I'd like to work on this!

@JanLauGe

This comment has been minimized.

Contributor

JanLauGe commented Dec 12, 2017

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