Skip to content

Operations

Operations

Divide

Bases: TransformerStep

Divide multiple run-to-failure cycles vertically

Source code in ceruleo/transformation/features/operations.py
class Divide(TransformerStep):
    """
    Divide multiple run-to-failure cycles vertically
    """
    def transform(self, X: List[pd.DataFrame]) -> pd.DataFrame:
        """
        Apply the division

        Parameters:
            X: List of run-to-failure cycles to divide

        Returns:
            A dataframe with the divided run-to-failure cycles
        """
        return reduce(lambda x, y: x.divide(y, fill_value=0), X)

transform(X)

Apply the division

Parameters:

Name Type Description Default
X List[DataFrame]

List of run-to-failure cycles to divide

required

Returns:

Type Description
DataFrame

A dataframe with the divided run-to-failure cycles

Source code in ceruleo/transformation/features/operations.py
def transform(self, X: List[pd.DataFrame]) -> pd.DataFrame:
    """
    Apply the division

    Parameters:
        X: List of run-to-failure cycles to divide

    Returns:
        A dataframe with the divided run-to-failure cycles
    """
    return reduce(lambda x, y: x.divide(y, fill_value=0), X)

Sum

Bases: TransformerStep

Concatenate multiple run-to-failure cycles vertically

Source code in ceruleo/transformation/features/operations.py
class Sum(TransformerStep):
    """ 
    Concatenate multiple run-to-failure cycles vertically
    """
    def transform(self, X: List[pd.DataFrame]) -> pd.DataFrame:
        """
        Apply the concatenation 

        Parameters:
            X: List of run-to-failure cycles to concatenate

        Returns:
            A dataframe with the concatenated run-to-failure cycles
        """
        return reduce(lambda x, y: x.add(y, fill_value=0), X)

transform(X)

Apply the concatenation

Parameters:

Name Type Description Default
X List[DataFrame]

List of run-to-failure cycles to concatenate

required

Returns:

Type Description
DataFrame

A dataframe with the concatenated run-to-failure cycles

Source code in ceruleo/transformation/features/operations.py
def transform(self, X: List[pd.DataFrame]) -> pd.DataFrame:
    """
    Apply the concatenation 

    Parameters:
        X: List of run-to-failure cycles to concatenate

    Returns:
        A dataframe with the concatenated run-to-failure cycles
    """
    return reduce(lambda x, y: x.add(y, fill_value=0), X)