42.25. Evaluating data from a form#

A client has been testing a small form as below to gather some basic data about their client-base. They have brought their findings to you to validate the data they have gathered.

You have been provided a dataset of csv records that contain entries from the form as well as some basic visualizations.The client pointed out that some of the visualizations look incorrect but they’re unsure about how to resolve them.

%%html

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Entry Form</title>
</head>

<body>
    <h1>Please Fill out the Form (* required)</h1>
    *<label>Birth Month</label> <input type="text"> <br>
    <label>State</label> <input type="text"> <br>
    <label for="pets">Dogs or Cats?</label> 
    <select name="pets" id="pets">
        <option value="dogs">Dog</option>
        <option value="cats">Cats</option>
    </select> <br>
    <button>Submit</button>
</body>

</html>
Entry Form

Please Fill out the Form (* required)

*


42.25.1. Instructions#

Use the techniques in this section to make recommendations about the form so it captures accurate and consistent information.

import pandas as pd
import matplotlib.pyplot as plt

#Loading the dataset
path = '../../assets/data/simple-form.csv'
form_df = pd.read_csv(path)
print(form_df)
form_df['state'].value_counts().plot(kind='bar');
plt.show()
form_df['birth_month'].value_counts().plot(kind='bar');
plt.show()

42.25.2. Acknowledgments#

Thanks to Microsoft for creating the open-source course Data Science for Beginners. It inspires the majority of the content in this chapter.