Icon

04 Data Transformation

Exercise for transforming data.

Perform data transformations with the Rule Engine, Math Formula, and String Manipulation nodes, or alternatively, with the Column Expressions node.










Exercise: Data Transformation1) Read the telco-customer-churn.csv file by executing the CSV Reader node2) Create a new column "MonthlyChargeCategory" with the value "<50" if the MonthlyCharge is <50, with the value ">100" if the MonthlyCharge is >100 otherwise "50-100"3) Create a new column "NumMonths" with the value of 1 for "Monthly", 12 for "One year" and 24 for "Two year" from the "Contract" column.4) Replace "Month-to-month" as "Monthly" in the "Contract" column5) Create a new column "ContractCost" by multiplying the MonthlyCharge with NumMonths.6) OPTIONAL: Replicate the tasks 3 & 4 with the Column Expressions node telco-customer-churn.csvcreate " MonthlyChargeCategory" columnreplace "Month-to-month" w/ "Monthly"create "ContractCost"columnreplace "Month-to-month" w/ "Monthly"and create "ContractCost" columncreate "NumMonths"columnCSV Reader Rule Engine String Manipulation Math Formula MISSING ColumnExpressions Rule Engine Exercise: Data Transformation1) Read the telco-customer-churn.csv file by executing the CSV Reader node2) Create a new column "MonthlyChargeCategory" with the value "<50" if the MonthlyCharge is <50, with the value ">100" if the MonthlyCharge is >100 otherwise "50-100"3) Create a new column "NumMonths" with the value of 1 for "Monthly", 12 for "One year" and 24 for "Two year" from the "Contract" column.4) Replace "Month-to-month" as "Monthly" in the "Contract" column5) Create a new column "ContractCost" by multiplying the MonthlyCharge with NumMonths.6) OPTIONAL: Replicate the tasks 3 & 4 with the Column Expressions node telco-customer-churn.csvcreate " MonthlyChargeCategory" columnreplace "Month-to-month" w/ "Monthly"create "ContractCost"columnreplace "Month-to-month" w/ "Monthly"and create "ContractCost" columncreate "NumMonths"columnCSV Reader Rule Engine String Manipulation Math Formula MISSING ColumnExpressions Rule Engine

Nodes

Extensions

Links