Graphics Programs Reference
In-Depth Information
past_header = True
continue
try:
full_fips = row[1] + row[2]
rate = float( row[5].strip() )
unemployment[full_fips] = rate
rates_only.append(rate)
except:
pass
Then you can sort the array, and find the quartiles.
# Quartiles
rates_only.sort()
q1_index = int( 0.25 * len(rates_only) )
q1 = rates_only[q1_index] # 6.9
q2_index = int( 0.5 * len(rates_only) )
q2 = rates_only[q2_index] # 8.7
q3_index = int( 0.75 * len(rates_only) )
q3 = rates_only[q3_index] # 10.8
FIGurE 8-19 Unemployment rates divided by quartiles
Search WWH ::




Custom Search