22#from uncertainties import ufloat
33import numpy as np
44import matplotlib .pyplot as plt
5+ from math import ceil
56
67
78# Parameters
89TheCsvInQuestion = "HillsboroughCoFL_DistToHurricaneShelters_x120_a250000m2_1764089128.077461.csv"
9- percentile_specificity = 100
10+ percentile_spec = 100
1011plt .figure (figsize = (15 ,10 ))
1112
1213
1819 #line_distance = ufloat(row["Distance"],row["uDist"])
1920 #print(line_distance)
2021
21- percentiles_to_calc = np .linspace (0 , 100 , percentile_specificity + 1 )
22- dist_percentiles = np .percentile (distances ,percentiles_to_calc )
23- plt .plot (np .array (percentiles_to_calc ),np .array (dist_percentiles ),label = TheCsvInQuestion )
22+ thepercentiles = np .linspace (0 , 100 , percentile_spec + 1 )
23+ thepercentiles_major = np .linspace (0 , 100 , 4 + 1 )
24+ percent_data = np .percentile (distances ,thepercentiles )
25+ percent_major_data = np .percentile (distances ,thepercentiles_major )
26+ plt .plot (np .array (thepercentiles ),np .array (percent_data ),label = TheCsvInQuestion )
27+ plt .scatter (np .array (thepercentiles_major ),np .array (percent_major_data ),label = "0th, 25th, 50th, 75th, and 100th percentiles" )
2428plt .title ("Percentiles of the Distances from land locations throughout Hillsborough County, FL." )
2529plt .xlabel ("Percentile" )
2630plt .ylabel ("Distance (miles)" )
2731plt .legend ()
28- plt .show ()
32+ plt .show ()
33+
34+ print ("0th percentile:" ,percent_data [0 ])
35+ print ("25th percentile:" , percent_data [ceil (percentile_spec * 0.25 )])
36+ print ("50th percentile:" , percent_data [ceil (percentile_spec * 0.50 )])
37+ print ("75th percentile:" , percent_data [ceil (percentile_spec * 0.75 )])
38+ print ("100th percentile:" , percent_data [ceil (percentile_spec )])
0 commit comments