Icon

04 Data Transformation - Solution

Solution to an exercise for transforming data.

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

CHECK YOUR ANSWERS:
The ID 177 in the data has
a. work status full-time
b. native country United States
c. year of birth 1955












Exercise: Data Transformation1) Read the adult.csv file by executing the CSV Reader node2) Create a new column "work-status" with the value "full-time" if the weekly workinghours are >=40 and "part-time" otherwise3) Replace the hyphen in "United-States" by a space character in the "native-country"column4) Create a new column "year-of-birth" by substracting the age number from 1994,which is the year when the data were collected 5) OPTIONAL: Replicate the tasks 3 & 4 with the Column Expressions node6) Take a look at the first row in the data table (ID 177) after completing the datatransformation operations. What is the work status, native country, and year of birth ofthis person? Create work statuscolumnReplace "-"by "" in the nativecountry columnyear-of-birthcolumnComplete the same tasks as aboveRead adult.csv Rule Engine String Manipulation Math Formula Column Expressions CSV Reader Exercise: Data Transformation1) Read the adult.csv file by executing the CSV Reader node2) Create a new column "work-status" with the value "full-time" if the weekly workinghours are >=40 and "part-time" otherwise3) Replace the hyphen in "United-States" by a space character in the "native-country"column4) Create a new column "year-of-birth" by substracting the age number from 1994,which is the year when the data were collected 5) OPTIONAL: Replicate the tasks 3 & 4 with the Column Expressions node6) Take a look at the first row in the data table (ID 177) after completing the datatransformation operations. What is the work status, native country, and year of birth ofthis person? Create work statuscolumnReplace "-"by "" in the nativecountry columnyear-of-birthcolumnComplete the same tasks as aboveRead adult.csv Rule Engine String Manipulation Math Formula Column Expressions CSV Reader

Nodes

Extensions

Links