In [1]:
from ahh import era
In [2]:
years = [1990, 2000, 2010]
months = [12, 1, 2]
days = [3, 4, 5]
era.time2dt(year=years, month=months, day=days, strf=None) # concatenate lists of years, months, days into a datetime array
Out[2]:
In [3]:
years = [1990, 2000, 2010]
months = [12, 1, 2]
days = [3, 4, 5]
hours = [6, 7, 8]
minutes = [9, 10, 11]
era.time2dt(year=years, month=months, day=days,
hour=hours, minute=minutes, strf=None) # can also include hours and minutes
Out[3]:
In [4]:
date_str_list = ['20170204', '20160103', '20151202']
era.time2dt(date_str_list) # can also convert list of date strings into datetime array
Out[4]:
In [5]:
date_str_list = ['2017YR_02MTH_04DAY_7Z', '2016YR_01MTH_03DAY_6Z', '2015YR_12MTH_02DAY_5Z']
era.time2dt(date_str_list, strf='%YYR_%mMTH_%dDAY_%HZ') # can also convert unusually formatted date strings
Out[5]:
In [ ]: