Python Transform

Hardik Chheda Updated by Hardik Chheda

Tellius provides you to use Python option to: 

  • Cleanse your data of invalid, missing, or inaccurate values
  • Modified your dataset according to your business goals and analysis
  • Enhanced your dataset as needed with data from other datasets

Following are some of the examples to help you get started:

def transform(dataframe):
    # use 8 spaces for indentation
       resultDataframe = dataframe.where(dataframe[‘Payment_Type’] == ‘Visa’)
       return resultDataframe
def transform(dataframe):
    # use 8 spaces for indentation
       resultDataframe = dataframe.where(dataframe[‘workclass’] == ‘Private’)
       return resultDataframe
def transform(dataframe):
    # use 8 spaces for indentation
       resultDataframe = dataframe.withColumn(‘Total’,dataframe.Qty_Sold)
       return resultDataframe
  1. On the dataset Edit page, click the Python icon.
  2. On the Python dialog box, select the required Python framework.
  3. Click the Create New button to create a new query.
  4. Enter the name of your Python code.
  5. Enter the Python code that you want to apply and click the Validate button to test the code.
    Tellius validates the entered Python code and displays the appropriate message.
  6. Click the Save button to save the Python code.
  7. Click the Apply button to apply the Python code to the dataset.

How did we do?

SQL Transform

Create Hierarchies

Contact