df.filter(like='col_name') 2.975X slower than basic column list comprehension #5657
Labels
Indexing
Related to indexing on series/frames, not to indexes themselves
Performance
Memory or execution speed performance
I have found that using the filter method to select columns that match a string pattern is ~3x slower than basic list comprehension on the df.columns list. Not sure how its implemented under the hood but for basic 'in' checks on lots of columns this could slow you down depending on how often you filter.
The text was updated successfully, but these errors were encountered: