import numpy as np
import pandas as pd
from datetime import datetime, timedelta
1. pd.DatetimeIndex()
In [1]: today=pd.DatetimeIndex(['2017-11-16'])
In [2]: print(today)
Out[2]: DatetimeIndex(['2017-11-16'], dtype='datetime64[ns]', freq=None)
In [3] :type(today)
Out[3]: pandas.core.indexes.datetimes.DatetimeIndex
2. Timesptamp 타입으로 날짜 설정
In [4]: today=pd.Timestamp(datetime(2017,11,16)) In [5]: today
Out[5]: Timestamp('2017-11-16 00:00:00')
import pandas as pd
from datetime import datetime, timedelta
1. pd.DatetimeIndex()
In [1]: today=pd.DatetimeIndex(['2017-11-16'])
In [2]: print(today)
Out[2]: DatetimeIndex(['2017-11-16'], dtype='datetime64[ns]', freq=None)
In [3] :type(today)
Out[3]: pandas.core.indexes.datetimes.DatetimeIndex
2. Timesptamp 타입으로 날짜 설정
In [4]: today=pd.Timestamp(datetime(2017,11,16)) In [5]: today
Out[5]: Timestamp('2017-11-16 00:00:00')
댓글
댓글 쓰기