File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ Other enhancements
96
96
- Let :meth: `DataFrame.to_feather ` accept a non-default :class: `Index ` and non-string column names (:issue: `51787 `)
97
97
- Performance improvement in :func: `read_csv ` (:issue: `52632 `) with ``engine="c" ``
98
98
- Performance improvement in :func: `concat ` with homogeneous ``np.float64 `` or ``np.float32 `` dtypes (:issue: `52685 `)
99
+ - Performance improvement in :meth: `DataFrame.filter ` when ``items `` is given (:issue: `52941 `)
99
100
-
100
101
101
102
.. ---------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -5586,7 +5586,7 @@ def filter(
5586
5586
name = self ._get_axis_name (axis )
5587
5587
# error: Keywords must be strings
5588
5588
return self .reindex ( # type: ignore[misc]
5589
- ** {name : [ r for r in items if r in labels ]} # type: ignore[arg-type]
5589
+ ** {name : labels . intersection ( items )}
5590
5590
)
5591
5591
elif like :
5592
5592
You can’t perform that action at this time.
0 commit comments