Pandas Time Series

Date and Time Data

Dates and Times in Python

Dates and Times in NumPy

Dates and Times in NumPy

NumPy Time Resolution Codes

Code Meaning Relative Time Span Absolute Time Span
Y Year ± 9.2e18 years [9.2e18 BC, 9.2e18 AD]
M Month ± 7.6e17 years [7.6e17 BC, 7.6e17 AD]
W Week ± 1.7e17 years [1.7e17 BC, 1.7e17 AD]
D Day ± 2.5e16 years [2.5e16 BC, 2.5e16 AD]
h Hour ± 1.0e15 years [1.0e15 BC, 1.0e15 AD]
m Minute ± 1.7e13 years [1.7e13 BC, 1.7e13 AD]
s Second ± 2.9e12 years [ 2.9e9 BC, 2.9e9 AD]
ms Millisecond ± 2.9e9 years [ 2.9e6 BC, 2.9e6 AD]
us Microsecond ± 2.9e6 years [290301 BC, 294241 AD]
ns Nanosecond ± 292 years [ 1678 AD, 2262 AD]
ps Picosecond ± 106 days [ 1969 AD, 1970 AD]
fs Femtosecond ± 2.6 hours [ 1969 AD, 1970 AD]
as Attosecond ± 9.2 seconds [ 1969 AD, 1970 AD]

Dates and Times in Pandas

Dates and Times in Pandas

Pandas Time Series: Indexing by Time

Pandas Time Series: Indexing by Time

Pandas Time Series Data Structures

Pandas Time Series Data Structures

Pandas Time Series Data Structures

Pandas Time Series Data Structures

Regular Sequences

Regular Sequences

Frequencies and Offsets

Code Description Code Description
D Calendar day BD Business day
W Weekly
M Month end BM Business month end
Q Quarter end BQ Business quarter end
A Year end BA Business year end
H Hours BH Business hours
T Minutes
S Seconds
L Milliseconds
U Microseconds
N nanoseconds

Frequencies and Offsets (Continued)

Frequencies and Offsets Examples

Resampling, Shifting, and Windowing