Skip to content

Commit 232da13

Browse files
committed
Use .get_loc, get rid of matched()
1 parent a8e315e commit 232da13

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pandas/io/stata.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1614,11 +1614,8 @@ def _do_select_columns(self, data, columns):
16141614
typlist = []
16151615
fmtlist = []
16161616
lbllist = []
1617-
matched = set()
1618-
data_column_list = data.columns.tolist()
16191617
for col in columns:
1620-
matched.update([col])
1621-
i = data_column_list.index(col)
1618+
i = data.columns.get_loc(col)
16221619
dtyplist.append(self.dtyplist[i])
16231620
typlist.append(self.typlist[i])
16241621
fmtlist.append(self.fmtlist[i])

0 commit comments

Comments
 (0)