Scalar

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

Scalar can contain strings, ints, floats.

Although it is possible to generate Scalars with the function calls or object construction specified below, the recommended way is to use the methods defined on SystemDSContext.

class systemds.operator.Scalar(sds_context, operation: str, unnamed_input_nodes: Iterable[DAGNode | str | int | float | bool] = None, named_input_nodes: Dict[str, DAGNode | str | int | float | bool] = None, assign: bool = False)
__init__(sds_context, operation: str, unnamed_input_nodes: Iterable[DAGNode | str | int | float | bool] = None, named_input_nodes: Dict[str, DAGNode | str | int | float | bool] = None, assign: bool = False) Scalar

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

  • is_python_local_data – if the data is local in python e.g. Numpy arrays that this operation node returns multiple values. If set remember to set the output_types value as well.

abs() Scalar

Calculate absolute.

Returns:

Scalar representing operation

acos() Scalar

Calculate arccos.

Returns:

Scalar representing operation

asin() Scalar

Calculate arcsin.

Returns:

Scalar representing operation

atan() Scalar

Calculate arctan.

Returns:

Scalar representing operation

ceil() Scalar

Return the ceiling of the input, element-wise.

Returns:

Scalar representing operation

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)

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

cos() Scalar

Calculate cos.

Returns:

Scalar representing operation

cosh() Scalar

Calculate cos.

Returns:

Scalar representing operation

exp() Scalar

Calculate exponential.

Returns:

Scalar representing operation

floor() Scalar

Return the floor of the input, element-wise.

Returns:

Scalar representing operation

isInf() Scalar

Computes a boolean indicator matrix of the same shape as the input, indicating where Inf (positive or negative infinity) values are located. :return: the OperationNode representing this operation

isNA() Scalar

Computes a boolean indicator matrix of the same shape as the input, indicating where NA (not available) values are located. Currently, NA is only capturing NaN values.

Returns:

the OperationNode representing this operation

isNaN() Scalar

Computes a boolean indicator matrix of the same shape as the input, indicating where NaN (not a number) values are located.

Returns:

the OperationNode representing this operation

log() Scalar

Calculate logarithm.

Returns:

Scalar representing operation

pass_python_data_to_prepared_script(sds, var_name: str, prepared_script: 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

sign() Scalar

Returns a the signs of the input, where 1 represents positive, 0 represents zero, and -1 represents negative.

Returns:

Scalar representing operation

sin() Scalar

Calculate sin.

Returns:

Scalar representing operation

sinh() Scalar

Calculate sin.

Returns:

Scalar representing operation

sqrt() Scalar

Calculate square root.

Returns:

Scalar representing operation

tan() Scalar

Calculate tan.

Returns:

Scalar representing operation

tanh() Scalar

Calculate tan.

Returns:

Scalar representing operation

to_string(**kwargs: Dict[str, DAGNode | str | int | float | bool]) Scalar

Converts the input to a string representation. :return: Scalar containing the string.