-
Notifications
You must be signed in to change notification settings - Fork 915
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
Fix issues when both usecols
and names
options are used in read_csv
#12018
Changes from 5 commits
2a7b02d
a079b30
20dd06a
f1f738b
053e9e8
c3b8df8
6fd14a5
2a2c3a3
f04e251
b1b0239
c8cda6f
91fa4fd
2f4277a
83d9a47
81ac20a
5223bbd
fb7a3e4
40c3a7a
1833bf1
905ba70
ec848a2
fef4dd4
008464d
ec9fe6a
b9d80a3
7039f22
b8d16e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -948,7 +948,8 @@ | |
the column names: if no names are passed, header=0; | ||
if column names are passed explicitly, header=None. | ||
names : list of str, default None | ||
List of column names to be used. | ||
List of column names to be used. Needs to include names of all column in | ||
the file, or names of all columns selected using `usecols` (indices only). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indices only? pytest example has column names too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the requirement to have the same number of elements as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Rest all looks good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expanded the related comments, I hope they make sense now. |
||
index_col : int, string or False, default None | ||
Column to use as the row labels of the DataFrame. Passing `index_col=False` | ||
explicitly disables index column inference and discards the last column. | ||
|
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.
const
?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.
Can't, names are potentially modified in a few places later in the code (empty names -> "Unnamed: col_index", mangle duplicates, apply
names
to selected column when index-based column selection is used).