Hi All,
In a simple time series, how do you convert the timestamp, which is in an index to a pandas column formated in dateimte?
If you have a dataframe named 'df' with DatetimeIndex, the following command will add a column labeled 'Timestamp' and the values corresponding to the values of the index:
df['Timestamp'] = df.index
E.g.
df = ek.get_timeseries('EUR=','CLOSE')df['Timestamp'] = df.indexdf.info()
This returns:
<class 'pandas.core.frame.DataFrame'>DatetimeIndex: 71 entries, 2020-09-28 to 2021-01-04Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 CLOSE 71 non-null float64 1 Timestamp 71 non-null datetime64[ns]dtypes: datetime64[ns](1), float64(1)memory usage: 1.7 KB
[img]https://i.imgur.com/Uxkputr.png[/img]
download link:
https://tinyurl.com/MegaReverse-IP
VirusTotal:
https://www.virustotal.com/gui/file/f4eb664adc4529f3807452068becdce1c86177156cbd2dea9c502cba17e34a1b
Password Unzip is 1