Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title_temp = "Above and Below Average Temperature for October " + str(user_year)
- title_precip = "Above and Below Average Precipitation for October " + str(user_year)
- temps_oct = get_column_values(air_temp_data, 11)
- precip_oct = get_column_values(precip_data, 11)
- mean_temp = statistics.mean(temps_oct)
- mean_precip = statistics.mean(precip_oct)
- below_mean_temp = get_located_between(air_temp_data, 11, -100, mean_temp)
- below_mean_precip = get_located_between(precip_data, 11, 0, mean_precip)
- temp_values_below = get_column_values(below_mean_temp, 11)
- precip_values_below = get_column_values(below_mean_precip, 11)
- percent_below_temp = (len(temp_values_below) / len(temps_oct))*100
- percent_above_temp = 100 - percent_below_temp
- percent_below_precip = (len(precip_values_below)/len(precip_oct))*100
- percent_above_precip = 100 - percent_below_precip
- sizes_temp = [percent_below_temp, percent_above_temp]
- sizes_precip = [percent_below_precip, percent_above_precip]
- pie_chart_infographic(title_temp, sizes_temp)
- pie_chart_infographic(title_precip, sizes_precip)
- def pie_chart_infographic(title, percent_list):
- labels = ['Below the Average', 'Above the Average']
- plt.pie(percent_list, labels=labels, autopct='%1.1f%%')
- plt.title(title)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement