I am working on Python for Data Analysis by Wes McKinney. I encountered this code below. spx is a series consisting of datetime type data.
spx
from d