-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: read_csv interpreting NA value as comment when NA contains comment string #38392
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
Conversation
…sep, usecols and parse_dates
…decimal sep, usecols and parse_dates" This reverts commit 8c2e1ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, though I suggest more variety in the input data (rather than all 1, all 2, etc).
data = ( | ||
"# this is a comment\n" | ||
"1,2,3,4\n" | ||
"1,2,3,4#inline comment\n" | ||
"1,2#,3,4\n" | ||
"1,2,#N/A,4\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to have the first row (not the commented one) to be like ``col_1,col_2,col_3,col4\n" to avoid confusion with the values below it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, done
looks fine here. can you merge master. cc @gfyoung if any comments. |
can u merge master and ping on green |
@jreback green |
thanks @phofl |
…nt string (pandas-dev#38392) * BUG: read_csv not converting to float for python engine with decimal sep, usecols and parse_dates * Fix comment issues for python parser * Add test * Add whatsnew * Revert "BUG: read_csv not converting to float for python engine with decimal sep, usecols and parse_dates" This reverts commit 8c2e1ca * Commit merge conflict * Improve test * Remove import * Add c tests * Remove function input * Improve note Co-authored-by: Jeff Reback <[email protected]>
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
I looked into the
c
case, but this is not that trivial as here. Comments are removed way before checking for na values. Would have to move that part way down to be able to do this.