Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Time Series Analysis with Python Cookbook

You're reading from   Time Series Analysis with Python Cookbook Practical recipes for exploratory data analysis, data preparation, forecasting, and model evaluation

Arrow left icon
Product type Paperback
Published in Jan 2026
Publisher
ISBN-13 9781805124283
Length 98 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Tarek A. Atwan Tarek A. Atwan
Author Profile Icon Tarek A. Atwan
Tarek A. Atwan
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

1. Time Series Analysis with Python Cookbook, Second Edition: Practical recipes for exploratory data analysis, data preparation, forecasting, and model evaluation
2. Chapter 1: Getting Started with Time Series Analysis FREE CHAPTER 3. Chapter 2: Reading Time Series Data from Files 4. Chapter 3: Reading Time Series Data from Databases 5. Chapter 4: Persisting Time Series Data to Files 6. Chapter 5: Persisting Time Series Data to Databases 7. Chapter 6: Working with Date and Time in Python 8. Chapter 7: Handling Missing Data 9. Chapter 8: Outlier Detection Using Statistical Methods 10. Chapter 9: Exploratory Data Analysis and Diagnosis 11. Chapter 10: Building Univariate Time Series Models Using Statistical Methods 12. Chapter 11: Additional Statistical Modeling Techniques for Time Series 13. Chapter 12: Forecasting Using Supervised Machine Learning

Handling missing data with interpolation

Interpolation is another widely used technique for imputing missing values, particularly in time series datasets. The pandas library provides the DataFrame.interpolate() method, offering flexible and powerful options for univariate imputation.For instance, linear interpolation imputes missing data by drawing a straight line between the two points surrounding the missing value. In a time series context, this means the missing value is estimated as a linear line based on the prior (past) value and the next (future) value. On the other hand, polynomial interpolation uses a curved line to estimate missing values between two points, enabling it to capture a non-linear relationship between points.Examples of some of the interpolation methods available in pandas include the following:

  • Linear: Straight-line interpolation between points
  • Nearest: Uses the nearest available value for imputation
  • Polynomial/Quadratic: Fits a polynomial curve (e.g., quadratic...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Time Series Analysis with Python Cookbook
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon