File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,10 +31,12 @@ def _get_cleaned_column_resolvers(
3131 # give the raw arrays to the compute engine. This is potentially a breaking
3232 # change if any of the operations in the eval string require a pd.Series.
3333 if raw :
34+ # Performance tradeoff: in the dict below, we iterate over `df.items`,
35+ # which yields tuples of (column_name, data as pd.Series). This is marginally
36+ # slower than iterating over `df.columns` and `df._iter_column_arrays()`,
37+ # but the latter is not in Pandas' public API, and may be removed in the future.
3438 return {
35- clean_column_name (k ): v
36- for k , v in zip (df .columns , df ._iter_column_arrays ())
37- if not isinstance (k , int )
39+ clean_column_name (k ): v for k , v in df .items () if not isinstance (k , int )
3840 }
3941
4042 # CHANGED FROM PANDAS: do not call df.dtype inside the dict comprehension loop
You can’t perform that action at this time.
0 commit comments