Skip to content

Commit

Permalink
feat: enable copy-on-write for pandas dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Nov 16, 2023
1 parent 5bf0e75 commit bdff1aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/safeds/data/tabular/containers/_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
T = TypeVar("T")
R = TypeVar("R")

# Enable copy-on-write for pandas dataframes
pd.set_option("mode.copy_on_write", True)


class Column(Sequence[T]):
"""
Expand Down
3 changes: 3 additions & 0 deletions src/safeds/data/tabular/containers/_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
if TYPE_CHECKING:
from collections.abc import Iterator

# Enable copy-on-write for pandas dataframes
pd.set_option("mode.copy_on_write", True)


class Row(Mapping[str, Any]):
"""
Expand Down
3 changes: 3 additions & 0 deletions src/safeds/data/tabular/containers/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@

from ._tagged_table import TaggedTable

# Enable copy-on-write for pandas dataframes
pd.set_option("mode.copy_on_write", True)


# noinspection PyProtectedMember
class Table:
Expand Down

0 comments on commit bdff1aa

Please sign in to comment.