flatten_dataframe_datetime_index#
API documentation for tradingstrategy.utils.df_index.flatten_dataframe_datetime_index Python function.
- flatten_dataframe_datetime_index(df)[source]#
Make sure we have a datetime index as the index for the DataFrame.
Multipair data sources may have (pair_id, timestamp) index instead of (timestamp) index
- Returns:
DataFrame copy with a timestamp-only index
- Parameters:
df (DataFrame) –
- Return type:
DataFrame