📜  numpy datetime64 获取日期 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:21.097000             🧑  作者: Mango

代码示例1
dates = np.arange(np.datetime64('2000-01-01'), np.datetime64('2010-01-01'))
years = dates.astype('datetime64[Y]').astype(int) + 1970
months = dates.astype('datetime64[M]').astype(int) % 12 + 1
days = dates - dates.astype('datetime64[M]') + 1