You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
358 B

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))