I have written this code to sequentially drive subsets of a DataFrame (df) and set the last value of variable "last" to nan in each subsets(df_orig). the problem is when I let the last value of "last" to nan in df_orig it change the same value in df and so in next df_origs the nans repeats, any clue?
thanks,
df=pd.read_csv('df.csv')
for j in range(num):
start_time=j
end_time=train_candles+j
df_orig = df.iloc[start_time:end_time,:]
df_orig.iloc[-1, df_orig.columns.get_loc('last')] = np.nan