Icon

03 Row and Column Filtering - Solution

Solution to an exercise for filtering rows and columns.

CHECK YOUR ANSWERS:
Out of the adults in the data
a. 4441 are divorced
b. 10680 are never married
c. 7908 are never married and between 20 and 40 years old
d. 4953 are with work class State-gov, Self-emp-not-inc, or Self-emp-inc










Exercise: Row Filtering1) Read the adult.csv file by executing the File Reader node2) Filter out rows where the marital status is missing3) Extract rows where - the marital status is divorced- the marital status is never married and age is between 20 and 40 (both included)- the workclass starts with "S"5) How many adults are- divorced?- never married?- never married and between 20 and 40 years old?- with work class State-gov, Self-emp-not-inc, or Self-emp-inc? Exercise: Column Filtering1) Read the adult_education.table file by executing the Table Reader node2) Exclude the "education-num" column- manually- by including only string type columns Filter out rows where the marital status is missingDivorcedWorkclass starts with "S"Never-marriedNever married and ageis between 20 and 40Read adult.csvRead adult_education.tableExclude education-nummanuallyExclude education-numby type selection Row Filter Row Filter Row Filter Row Filter Row Filter File Reader(deprecated) Table Reader(deprecated) Column Filter Column Filter Exercise: Row Filtering1) Read the adult.csv file by executing the File Reader node2) Filter out rows where the marital status is missing3) Extract rows where - the marital status is divorced- the marital status is never married and age is between 20 and 40 (both included)- the workclass starts with "S"5) How many adults are- divorced?- never married?- never married and between 20 and 40 years old?- with work class State-gov, Self-emp-not-inc, or Self-emp-inc? Exercise: Column Filtering1) Read the adult_education.table file by executing the Table Reader node2) Exclude the "education-num" column- manually- by including only string type columns Filter out rows where the marital status is missingDivorcedWorkclass starts with "S"Never-marriedNever married and ageis between 20 and 40Read adult.csvRead adult_education.tableExclude education-nummanuallyExclude education-numby type selection Row Filter Row Filter Row Filter Row Filter Row Filter File Reader(deprecated) Table Reader(deprecated) Column Filter Column Filter

Nodes

Extensions

Links