Data types#
pandas
generally inherits its types system from NumPy. Below, we consider some features exclusive to pandas, and options for processing pandas series/data frames specific to particular data types.
Date & time#
Pandas provides an option for specifying a time zone for a datetime object.
The following table lists features of the Pandas design that allow you to work with datetime and timedelta objects.
Function / Method |
Description |
---|---|
|
Convert strings, numbers, etc. to |
|
Create a range of dates with fixed frequency |
|
Like |
|
Convert strings or numbers to |
|
Create a range of timedeltas |
|
Accessor for datetime and timedelta components (e.g. |
|
Extract just the date part (as |
|
Extract just the time part (as |
|
Localize naive datetime to a timezone |
|
Convert timezone-aware datetimes to another timezone |
|
Set time to midnight (00:00:00) |
|
Round down to nearest frequency |
|
Round up to nearest frequency |
|
Round to nearest frequency |
|
Format datetime as string using |
|
Get total seconds from timedelta |
|
Extract days or seconds from timedelta |
|
Resample time series data |
|
Change frequency without resampling |
|
Shift data in time |
|
Calculate timedelta difference between rows |
|
Specialized index types for time-aware indexing and slicing |
|
Useful to enable datetime indexing/resampling |
|
Rolling operations over time-based windows |
Check details in: