-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Labels
EnhancementIO CSVread_csv, to_csvread_csv, to_csvNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
There isn't a way to tell read_csv
to skiprows
after the specified header
row.
Feature Description
To avoid breaking existing logic, I think a new argument would be required, perhaps skiprows_after
?
So one could, parse, for example:
ignore,me
foo,bar
ignore,me
123,1
456,2
with read_csv(f, header=1, skiprows_after=1)
and get:
foo bar
0 123 1
1 456 2
Alternative Solutions
Workaround:
header = read_csv(f, skiprows=1, nrows=1)
names = header.columns.to_list()
read_csv(f, skiprows=4, names=names)
Additional Context
No response
Metadata
Metadata
Assignees
Labels
EnhancementIO CSVread_csv, to_csvread_csv, to_csvNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action