Description
I uploaded for you everything you need.
Let know if you have any question.
Unformatted Attachment Preview
Purchase answer to see full attachment
Explanation & Answer
The final submission. To run the code please use the codes word doc and change the file path for your file. Please change the same in the appendix A of the Final solution as well.
Snowfall Problem
In the given csv (lickcreek) there are three columns.
o Day – The days of a winter starting from November 1. November 1 is taken as day 0.
o Current – The snow accumulated this year till the corresponding day at the weather
station. The snow accumulated is measured in inches.
o Median – The average snow accumulated for last 50 years in the same weather
station.
Pre-Work
We have read the csv files into a pandas data-frame and used the columns of that dataframe everywhere. This is done through the loadCSVtoDF() function (Appendix A). This
function reads the csv file kept in a given location
Part I
Plotting Accumulated snowfall against day
Using the pandas data-frame we have plotted both the current year accumulation and
median accumulation against the day.
Hence, the delta accumulation for each day for both the plots give the snowfall
accumulation increase (or decrease) on that day.
Fitting, those two plots give the following figure (Figure 1).
The code used for this is present in the function plotDayvsSnowFalls(df), (Appendix A)
which uses the data-frame already crated and plots the two snowfalls.
Part II
Plotting Regression Line and
Using the pandas data-frame we have plotted both the current year accumulation and
median accumulation against the day.
Now using the
Fitting, those two plots give the following figure (Figure 2).
The code used for this is present in the function plotRegressions(df), (Appendix B) which
uses the data-frame already crated and plots the two snowfalls.
Conclusion
Comparative study of the regression lines
After this we retrieve the slope using the list which has been returned by Part II and
compare them using the python code (Appendix C).
We see that the current year has a higher slope as suggested by the figure. The difference
of the slopes is 0.036 inches / day. (Median slope = 0.262 inches / day and current year
slope = 0.298 inches / day).
Hence, it can be concluded that there is about 13.9% hi...