Question: You are to create a program in Python that performs the following using the matplotlib and pandas packages: Loads the ss13hil.csv file that contains the

You are to create a program in Python that performs the following using the matplotlib and pandas packages:

Loads the ss13hil.csv file that contains the PUMS dataset (assume it's in the current directory) and create a DataFrame object from it.

Create a figure with 2x2 subplots. The required subplots are as follows:

Upper Left Subplot - Pie chart containing the number of household records for different values of the HHL (household language) attribute. The plot should have no wedge labels, but should have a legend in the upper left corner. The pie needs to be rotated appropriately (see example figure on last page).

Upper Right Subplot - Histogram of HINCP (household income) with KDE plot superimposed (see pg 236-238 of textbook). You should use a log scale on the x-axis with log-spaced bins (HINT: use np.logspace).

Lower Left Subplot - Bar chart of Thousands of Households for each VEH (vehicles available) value (exclude NaN). Make sure to use the WGTP value to count how many households are represented by each household record and divide the sum by 1000.

Lower Right Subplot - Scatter plot of TAXP (property taxes) vs. VALP (property value). Make sure to convert TAXP into the appropriate numeric value, using the lower bound of the interval (e.g. 2 -> $1, 16 -> $700, ). Use WGTP as the size of each marker, o as the marker type, and MRGP (first mortgage payment) as the color value. Add a colorbar.

Display the figure and save it in a file called pums.png

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!