Frame

A Frame is represented either by an OperationNode, or the derived class Frame.

Although it is possible to generate matrices with the function calls or object construction specified below, the recommended way is to use the methods defined on SystemDSContext, to read in a frame from disk.

class systemds.operator.Frame(sds_context: SystemDSContext, operation: str, unnamed_input_nodes: Union[str, Iterable[Union[DAGNode, str, int, float, bool]]] = None, named_input_nodes: Dict[str, Union[DAGNode, str, int, float, bool]] = None, local_data: pandas.core.frame.DataFrame = None, brackets: bool = False)
__init__(sds_context: SystemDSContext, operation: str, unnamed_input_nodes: Union[str, Iterable[Union[DAGNode, str, int, float, bool]]] = None, named_input_nodes: Dict[str, Union[DAGNode, str, int, float, bool]] = None, local_data: pandas.core.frame.DataFrame = None, brackets: bool = False)Frame

Create general OperationNode

Parameters
  • sds_context – The SystemDS context for performing the operations

  • operation – The name of the DML function to execute

  • unnamed_input_nodes – inputs identified by their position, not name

  • named_input_nodes – inputs with their respective parameter name

  • output_type – type of the output in DML (double, matrix etc.)

  • is_python_local_data – if the data is local in python e.g. Numpy arrays

  • number_of_outputs – If set to other value than 1 then it is expected that this operation node returns multiple values. If set remember to set the output_types value as well.

  • output_types – The types of output in a multi output scenario. Default is None, and means every multi output is a matrix.

cbind(other) → systemds.operator.nodes.frame.Frame

Column-wise frame concatenation, by concatenating the second frame as additional columns to the first frame. :param: The other frame to bind to the right hand side. :return: The Frame containing the concatenated frames.

code_line(var_name: str, unnamed_input_vars: Sequence[str], named_input_vars: Dict[str, str]) → str

Generates the DML code line equal to the intended action of this node.

Parameters
  • var_name – Name of DML-variable this nodes result should be saved in

  • unnamed_input_vars – all strings representing the unnamed parameters

  • named_input_vars – all strings representing the named parameters (name value pairs)

Returns

the DML code line that is equal to this operation

compute(verbose: bool = False, lineage: bool = False) → pandas.core.frame.DataFrame

Get result of this operation. Builds the dml script and executes it in SystemDS, before this method is called all operations are only building the DAG without actually executing (lazy evaluation).

Parameters
  • verbose – Can be activated to print additional information such as created DML-Script

  • lineage – Can be activated to print lineage trace till this node

Returns

the output as an python builtin data type or numpy array

pass_python_data_to_prepared_script(sds, var_name: str, prepared_script: py4j.java_gateway.JavaObject) → None

Passes data from python to the prepared script object.

Parameters
  • jvm – the java virtual machine object

  • var_name – the variable name the data should get in java

  • prepared_script – the prepared script

rbind(other) → systemds.operator.nodes.frame.Frame

Row-wise frame concatenation, by concatenating the second frame as additional rows to the first frame. :param: The other frame to bind to the right hand side :return: The OperationNode containing the concatenated frames.

replace(pattern: str, replacement: str) → systemds.operator.nodes.frame.Frame

Replace all instances of string with replacement string :param: pattern the string to replace :param: replacement the string to replace with :return: The Frame containing the replaced values