Handling date objects in Python
Time series is data that is sampled at certain intervals over time, for example, recording the speed of a car every second. Given such data, we can easily estimate either the distance traveled (by summing the observations and dividing the sum by 3,600) or acceleration of the car (by calculating the differences between two consecutive observations). Managing time series data with pandas is straightforward.
Getting ready
To execute this recipe, you will need pandas, NumPy, and Matplotlib. No other prerequisites are necessary.
How to do it…
From the web archive, we cleaned up and transformed two datasets: water flow for the American River (http://www.theamericanriver.com) and for the Columbia River (http://www.ecy.wa.gov/programs/wr/cwp/cwpfactmap.html ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access