From 18275b70947358303e72f7e4fd7c61b66d3157da Mon Sep 17 00:00:00 2001 From: Sid Jha <45739834+sidjha1@users.noreply.github.com> Date: Sat, 5 Oct 2024 13:10:00 -0700 Subject: [PATCH] Create a New Dataframe for Map (#14) Previously, map would update the dataframe in place. Changing it so that map creates a new dataframe. This fits better with the semantics of the other operators. --- lotus/sem_ops/sem_map.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lotus/sem_ops/sem_map.py b/lotus/sem_ops/sem_map.py index 99a5d940..2e903c91 100644 --- a/lotus/sem_ops/sem_map.py +++ b/lotus/sem_ops/sem_map.py @@ -126,7 +126,7 @@ def __call__( strategy=strategy, ) - new_df = self._obj + new_df = self._obj.copy() new_df[suffix] = outputs if return_explanations: new_df["explanation" + suffix] = explanations