Skip to content

Commit c976108

Browse files
More from explit for loop to a map (should be faster, if not much)
1 parent ff83475 commit c976108

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

intake_esm/cat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,9 @@ def pandas(self) -> pd.DataFrame:
516516

517517
if self.pl_df is not None:
518518
self.df = self.pl_df.to_pandas(use_pyarrow_extension_array=True)
519-
for colname in self.columns_with_iterables: # Can this be done in one hit?
520-
self.df[colname] = self.df[colname].apply(tuple)
519+
self.df[list(self.columns_with_iterables)] = self.df[
520+
list(self.columns_with_iterables)
521+
].map(tuple)
521522
return self.df
522523

523524
self.pl_df = self.lf.collect() # type: ignore[union-attr]

0 commit comments

Comments
 (0)