Mar-18-2019, 09:03 AM
date_cols = ['CLOSE', 'D_MONTH', 'OPEN']
gbl = globals()
for i in date_cols:
gbl[i] = pd.to_timedelta(min(data_frame_1[i]), unit='s') + pd.datetime(1960, 1, 1)
the output looks like this:
>OPEN
Out[520]: Timestamp('1993-02-12 00:00:00')
>CLOSE
Out[522]: Timestamp('2009-04-30 00:00:00')
>D_MONTH
Out[523]: Timestamp('2018-01-01 00:00:00')
type(OPEN)
Out[518]: pandas._libs.tslib.Timestamp
The output is a time stamp but I want an output as a dataframe like below:
Attr Min_Date
CLOSE 2009-04-30 00:00:00
OPEN 1993-02-12 00:00:00
D_MONTH 2018-01-01 00:00:00
gbl = globals()
for i in date_cols:
gbl[i] = pd.to_timedelta(min(data_frame_1[i]), unit='s') + pd.datetime(1960, 1, 1)
the output looks like this:
>OPEN
Out[520]: Timestamp('1993-02-12 00:00:00')
>CLOSE
Out[522]: Timestamp('2009-04-30 00:00:00')
>D_MONTH
Out[523]: Timestamp('2018-01-01 00:00:00')
type(OPEN)
Out[518]: pandas._libs.tslib.Timestamp
The output is a time stamp but I want an output as a dataframe like below:
Attr Min_Date
CLOSE 2009-04-30 00:00:00
OPEN 1993-02-12 00:00:00
D_MONTH 2018-01-01 00:00:00