Files
zeekay e037e8f7ea torus: one name for the package, and it is ours
The distribution called itself torus-ml while shipping a package directory
named concrete, so the name a user installs and the name they import disagreed
— and most of the tree already said torus.ml, which could not resolve against
src/concrete. Moved src/concrete to src/torus and pointed the include at it.

The dependency was Zama's concrete-python from their index. It is torus-fhe
from ours, which is what luxfhe/torus already ships: that frontend declares
torus-fhe and ships a torus/fhe module, so every 'from torus.fhe' in this tree
was already naming our compiler and only the dependency lagged.

Two distributions share one namespace, which is the shape the upstream this
forked from used and the reason the split works: torus-fhe gives torus.fhe,
torus-ml gives torus.ml.

Swept every other spelling — identifiers, enum members, workflow variables,
filenames, notebooks. LICENSE and NOTICE keep the upstream attribution a fork
owes; the figures carry the old name in JPEG metadata a text sweep cannot
reach.
2026-08-27 13:20:50 -07:00

4.2 KiB

module torus.ml.pandas

Public API for encrypted data-frames.

Global Variables

  • dataframe
  • client_engine

function load_encrypted_dataframe

load_encrypted_dataframe(path: Union[Path, str]) → EncryptedDataFrame

Load a serialized encrypted data-frame.

Args:

  • path (Union[Path, str]): The path to consider for loading the serialized encrypted data-frame.

Returns:

  • EncryptedDataFrame: The loaded encrypted data-frame.

function merge

merge(
    left_encrypted: EncryptedDataFrame,
    right_encrypted: EncryptedDataFrame,
    how: str = 'left',
    on: Optional[str] = None,
    left_on: Optional[Hashable, Sequence[Hashable]] = None,
    right_on: Optional[Hashable, Sequence[Hashable]] = None,
    left_index: bool = False,
    right_index: bool = False,
    sort: bool = False,
    suffixes: Tuple[Optional[str], Optional[str]] = ('_x', '_y'),
    copy: Optional[bool] = None,
    indicator: Union[bool, str] = False,
    validate: Optional[str] = None
) → EncryptedDataFrame

Merge two encrypted data-frames in FHE using Pandas parameters.

Note that for now, only a left and right join is implemented. Additionally, only some Pandas parameters are supported, and joining on multiple columns is not available.

Pandas documentation for version 2.0 can be found here: https://pandas.pydata.org/pandas-docs/version/2.0/reference/api/pandas.DataFrame.merge.html

Args:

  • left_encrypted (EncryptedDataFrame): The left encrypted data-frame.
  • right_encrypted (EncryptedDataFrame): The right encrypted data-frame.
  • how (str): Type of merge to be performed, one of {'left', 'right'}.
  • * left: use only keys from left frame, similar to a SQL left outer join; preserve key order.
  • * right: use only keys from right frame, similar to a SQL right outer join; preserve key order.
  • on (Optional[str]): Column name to join on. These must be found in both DataFrames. If it is None then this defaults to the intersection of the columns in both DataFrames. Default to None.
  • left_on (Optional[Union[Hashable, Sequence[Hashable]]]): Currently not supported, please keep the default value. Default to None.
  • right_on (Optional[Union[Hashable, Sequence[Hashable]]]): Currently not supported, please keep the default value. Default to None.
  • left_index (bool): Currently not supported, please keep the default value. Default to False.
  • right_index (bool): Currently not supported, please keep the default value. Default to False.
  • sort (bool): Currently not supported, please keep the default value. Default to False.
  • suffixes (Tuple[Optional[str], Optional[str]]): A length-2 sequence where each element is optionally a string indicating the suffix to add to overlapping column names in left and right respectively. Pass a value of None instead of a string to indicate that the column name from left or right should be left as-is, with no suffix. At least one of the values must not be None.. Default to ("_x", "_y").
  • copy (Optional[bool]): Currently not supported, please keep the default value. Default to None.
  • indicator (Union[bool, str]): Currently not supported, please keep the default value. Default to False.
  • validate (Optional[str]): Currently not supported, please keep the default value. Default to None.

Returns:

  • EncryptedDataFrame: The joined encrypted data-frame.