Machine Learning, Deep Learning, Cryptocurrency Investment, Algorithmic Trading, Neural Networks.
timeframe_diff = df.index[-1] - df.index[-2] timeframe = None # Define timeframe based on time difference if timeframe_diff == pd.Timedelta(minutes=1): timeframe = '1m' elif timeframe_diff == pd.Timedelta(minutes=3): timeframe = '3m' elif timeframe_diff == pd.Timedelta(minutes=5): timeframe = '5m'