Date time Flashcards
If you want to combine columns to have dates how do you do it?
pd.read_csv(url, parse_dates = [[0,1,2]]
When the index is a date, how do you select different dates?
df. loc(‘1996-08-01’)
df. index.month == 1
If you want to convert to datetime format how do you do it?
1) parse dates when importing
2) . pd.to_datetime
Alias for year end?
A, Y
Alias for year start?
AS, YS
Alias for weekly
W
Alias for month end?
M
Alias for month start?
MS
Alias for business mont end/
BM
Alias for quarter?
Q
Alias for business quarter end
BQ
How do you get isoformat dates?
datename.isoformat()
What is the method for converting a date into a string?
strftime
How do you get the month fully written out?
strftime(‘%B’)
How do you change bits of a datetime format?
dt.replace(minutes = 12)