Cartesian Product

The cartesian Product transform multiplies each row value of one dataset by each column of another dataset and displays the dataset with all possible ordered pairs in the output. This transform is performed with two datasets.

tags: [“Data Preparation”]

Parameters

The table gives a brief description about each parameter in Cartesian Product transform.

Name:

By default, the transform name is populated. You can also add a custom name for the transform.

Output Dataset:

The cartesian product of two datasets. (Required: True, Multiple: False)

First Input Dataset:

The first dataset of the cartesian product. (Required: True, Multiple: False)

Second Input Dataset:

The second dataset of the cartesian product. (Required: True, Multiple: False)

Sample input for Cartesian Product transform:

../../../_images/cartesianproduct_input.png

The output after running the Cartesian Product transform on the dataset appears as below:

../../../_images/cartesianproduct_output.png

How to use it in Notebook

The following is the code snippet you must use in the Jupyter Notebook editor to run the Cartesian Product transform:

template=TemplateV2.get_template_by('Cartesian Product')

recipe_Cartesian_Product= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Cartesian Product')

transform=Transform()
transform.templateId = template.id
transform.name='Cartesian Product'
transform.variables = {
'output_dataset':'cartesian_product',
'input_dataset':'only_numeric',
'input_dataset':'only_numeric'}
recipe_Cartesian_Product.add_transform(transform)
recipe_Cartesian_Product.run()

Requirements

pandas