Home /
Expert Answers /
Computer Science /
python-using-panda-task-3-dataset-manipulation-the-dataset-is-kind-of-messy-for-example-inst-pa125
(Solved):
Python using Panda
Task 3: Dataset Manipulation: - The dataset is kind of messy. For example, inst ...
Python using Panda
Task 3: Dataset Manipulation: - The dataset is kind of messy. For example, instead of just having "White" and "Asian" for the race column, the dataset has "1. White" and "3. Asian", which is undesirable in our case. Your next sub-task is learning how to use the "apply" function to clean up all the messy entries in the "sex", "race", "education", "jobclass" and "health_ins" columns. For example, we want to transform "1. Male" -> "Male", "3. Some College" \( > \) "Some College", etc. There are several ways to do this and you can try whatever methods that work. One of them is the frame now should look like the one below. \( \left(0.25^{*} 4\right. \) columns \( =1 \) point)
Solution: Data cleaning is very important method to clean unwanted characters before its analysis. In the given task, there are unwanted characters ('.', '1' ) in the strings of the columns of dataframe that needs to be removed. For carrying out this