Icon

04 Numbers Strings and Rules

Exercise for data transformation.

Perform data manipulation operations with the Rule Engine, Math Formula, String Manipulation, and Column Expressions nodes.

Exercise: Numbers, Strings, and Rules1.1) Read the travel advisories data by executing the CSV Reader node below1.2) Replace the colons in the Level column by hyphen, like this: "Level 1- Exercise normal precautions"1.3) Extract the risk levels as numbers into a separate column. You can use, for example, the substr() function.1.4) Complete the tasks above with the Column Expressions node2.1) Read the population data by executing the Excel Reader node below2.2) Create a new column "Change" by substracting the population values in 2018 from the population values in 20192.3) Convert the absolute population change values into percentages: divide them by the population values in 2018 and multiply theresult by 100.2.4) Create a categorical column with two values "increasing"/"decreasing" based on whether the change is positive or negative Extract numericrisk level into a separate columnReplace :by -Create ChangecolumnConvert change topercentageAdd Direction columnbased on +/- changeThe same tasks as abovedemographics.xlsx(population)travel_advidories.csv String Manipulation String Manipulation Math Formula Math Formula Rule Engine Column Expressions Excel Reader CSV Reader Exercise: Numbers, Strings, and Rules1.1) Read the travel advisories data by executing the CSV Reader node below1.2) Replace the colons in the Level column by hyphen, like this: "Level 1- Exercise normal precautions"1.3) Extract the risk levels as numbers into a separate column. You can use, for example, the substr() function.1.4) Complete the tasks above with the Column Expressions node2.1) Read the population data by executing the Excel Reader node below2.2) Create a new column "Change" by substracting the population values in 2018 from the population values in 20192.3) Convert the absolute population change values into percentages: divide them by the population values in 2018 and multiply theresult by 100.2.4) Create a categorical column with two values "increasing"/"decreasing" based on whether the change is positive or negative Extract numericrisk level into a separate columnReplace :by -Create ChangecolumnConvert change topercentageAdd Direction columnbased on +/- changeThe same tasks as abovedemographics.xlsx(population)travel_advidories.csv String Manipulation String Manipulation Math Formula Math Formula Rule Engine Column Expressions Excel Reader CSV Reader

Nodes

Extensions

Links