File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 77df = pd .read_csv ("weather_data.csv" )
88data = df [df ['month' ] == month ].reset_index (drop = True ) # Filter for January only and reindex
99temperatures = data ["air_temperature" ]
10- precipitations = data ["precipitation" ]
11- num_measurements = len (precipitations )
10+ precipitation = data ["precipitation" ]
11+ num_measurements = len (precipitation )
1212
1313# compute statistics
1414temp_mean = sum (temperatures ) / num_measurements
15- precip_mean = sum (precipitations ) / num_measurements
15+ precip_mean = sum (precipitation ) / num_measurements
1616
1717# plot temperature
1818plt .figure ()
2424
2525# plot precipitation
2626plt .figure ()
27- plt .plot (precipitations , "b-" )
27+ plt .plot (precipitation , "b-" )
2828plt .axhline (y = precip_mean , color = "b" , linestyle = "--" )
2929plt .savefig (f"month-{ month } _precipitation.png" )
3030plt .show ()
You can’t perform that action at this time.
0 commit comments