Join Dan Gookin for an in-depth discussion in this video Introduction, part of Code Clinic: C.
(machine noises) - [Instructor] Hello and welcome to the first problem in the Code Clinic series. This problem is about calculating statistics from a dataset. It's easy stuff, but presents a good example of how different languages accomplish common tasks. Our authors will start with weather data captured from Lake Pend Oreille in northern Idaho. We have almost 20 megabytes of data from the years 2012 through 2015, that data is available in the folder with other exercise files.
Each observation in the data includes several variables: date, time, air-temperature, barometric pressure, dew point, and others, and the data is straight-forward. Likewise, the problem is simple. Write a function that accepts a beginning date and time, and an ending date and time. Inclusive of those dates and times, return the coefficient of the slope of the barometric pressure. A rising slope indicates an increasing barometric pressure, which typically means fair and sunny weather ahead.
A falling slope indicates a decreasing barometric pressure, which typically means stormy weather. We're only asking our authors for the coefficient, but some may choose to generate a graph of the results as well. So, that's our first challenge: pull statistics from a data set. Perhaps you ought to pause this video and create a solution of your own. How would you solve the problem? In the next videos, we'll see one approach to solving this.