#solution code for Codecademy "Clean US Census Data" challenge.
import pandas as pd
import numpy as np
import matplotlib.pyplot as pyplot
import codecademylib3_seaborn
import glob
#Use glob to grab multiple CSV files
temp_df = glob.glob("states*.csv")
temp_list = []
#Append the CSV files into a temporary list
for myfile in temp_df:
data = pd.read_csv(myfile)
temp_list.append(data)
#Concatenate the files within the list to create a dataframe with the needed data.
us_census = pd.concat(temp_list)
This file has been truncated. show original