ENH: Functionality for read_csv to ignore comments when skipping rows…
State: closed

… and only skip data rows

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:

Comments:
Hello @mukundm19! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:

* In the file [`pandas/io/parsers.py`](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/io/parsers.py):

> [Line 454:80](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/io/parsers.py#L454): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (106 > 79 characters)

* In the file [`pandas/tests/io/parser/test_skipdatarows.py`](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py):

> [Line 4:80](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L4): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (105 > 79 characters)
> [Line 19:1](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L19): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 29:29](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L29): [E127](https://duckduckgo.com/?q=pep8%20E127) continuation line over-indented for visual indent
> [Line 30:29](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L30): [E113](https://duckduckgo.com/?q=pep8%20E113) unexpected indentation
> [Line 30:36](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L30): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 31:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L31): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 31:11](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L31): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 31:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L31): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 31:58](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L31): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 31:71](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L31): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 32:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L32): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 34:1](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L34): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 35:1](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L35): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 43:1](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L43): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 44:11](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L44): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 44:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L44): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 45:11](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L45): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 45:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L45): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 45:53](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L45): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 45:71](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L45): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 46:38](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L46): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 48:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L48): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent
> [Line 48:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L48): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 48:15](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L48): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 49:36](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L49): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 51:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L51): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent
> [Line 53:1](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L53): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 54:11](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L54): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 54:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L54): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 55:11](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L55): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 55:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L55): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 55:54](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L55): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 55:70](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L55): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 56:38](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L56): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 58:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L58): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent
> [Line 58:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L58): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 58:15](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L58): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 59:29](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L59): [E127](https://duckduckgo.com/?q=pep8%20E127) continuation line over-indented for visual indent
> [Line 62:36](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L62): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 64:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L64): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent
> [Line 66:1](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L66): [E122](https://duckduckgo.com/?q=pep8%20E122) continuation line missing indentation or outdented
> [Line 68:11](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L68): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 68:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L68): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 69:11](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L69): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 69:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L69): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 69:53](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L69): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 69:67](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L69): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 70:41](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L70): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 70:54](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L70): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 72:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L72): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent
> [Line 72:13](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L72): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 72:15](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L72): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 73:36](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L73): [E225](https://duckduckgo.com/?q=pep8%20E225) missing whitespace around operator
> [Line 75:5](https://github.com/pandas-dev/pandas/blob/42d801c08d0614ee563dc1b0a3937249bdca608e/pandas/tests/io/parser/test_skipdatarows.py#L75): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent



##### Comment last updated at 2019-04-21 04:36:28 UTC