From the course: Data Analysis with Python and Pandas

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Solution: Missing time series data

Solution: Missing time series data

- [Instructor] All right, everybody, our Solution Code is up on the right. Let's go ahead and dive into the notebook. All right, so this required a little bit of combination of our missing value methods as well as our date filtering. So, our initial analysis got us here. We had our date index, we had the mean of our oil series, which is 67.71, and we had this plot with gaps in it. We then wanted to take a look at our means here with forward fill, backfill, and interpolate. We can go ahead and do this with a single call to the print function. It's not super pretty, but if we're just looking for quick numbers, we get 67.671 for forward fill, we get 67.673 for backfill, and we get 67.66 for interpolate. So, all of these are very close, and so we didn't have that many missing values, so the ability of single values modified to change our overall mean is quite low in this case. And so just remember that we had a 4 cent difference from not doing anything, so calculating the mean on our…

Contents