12 lines
358 B
Python
12 lines
358 B
Python
import pandas
|
|
|
|
data = pandas.read_csv('2010census.csv')
|
|
average_per_home = data['Total Population'] / data['Total Households']
|
|
|
|
calc_average = average_per_home.mean()
|
|
real_average = data['Average Household Size'].mean()
|
|
|
|
print("Real average is:", real_average)
|
|
print("Calculated average is:", calc_average)
|
|
print("Error is:", abs(calc_average-real_average))
|