I am trying to slice the array up when using the std function to only use part of it. That part being 1:t, as t is an integer that grows with each iteration of the for loop. Y is my pandas dataset and the column is 'TempK' which is specified as the column parameter. Is there a limit on much you can slice as the dataset is quite big or is it something else?
def calc_std(t, y, column):
deviationPrediction = np.std(y.loc[1:t, [column]])
return deviationPrediction
The error I receive is this:
Traceback (most recent call last): File "C:\Users\Kabla\Anaconda3\envs\condaEnv\Lib\site-packages\pandas\core\indexes\base.py", line 2657, in get_loc return self._engine.get_loc(key) KeyError: 1