We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92cb1e7 commit 527d1d7Copy full SHA for 527d1d7
pandas/core/frame.py
@@ -4585,7 +4585,7 @@ def select(self, *args):
4585
"""
4586
if args and isinstance(args[0], list):
4587
if len(args) == 1:
4588
- args = args[0]
+ columns = args[0]
4589
else:
4590
raise ValueError(
4591
"`DataFrame.select` supports individual columns "
@@ -4594,8 +4594,10 @@ def select(self, *args):
4594
"You can unpack the list if you have a mix: "
4595
"`df.select(*['col1', 'col2'], 'col3')`."
4596
)
4597
+ else:
4598
+ columns = list(args)
4599
- indexer = self.columns._get_indexer_strict(list(args), "columns")[1]
4600
+ indexer = self.columns._get_indexer_strict(columns, "columns")[1]
4601
return self.take(indexer, axis=1)
4602
4603
@overload
0 commit comments