Error in train data.
Trying to run a back testing . have written below code
+++
train.loc[:, 'Date'] = pd.to_datetime(train.index) # Fix here with .loc[]
train.set_index('Date', inplace=True)
+++
but getting below error.
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
could you explain why i am getting this error ?
0
2 comments
Avinash Kumar
2
Error in train data.
Python for Quant Trading
skool.com/python-for-quant-trading-9932
Community to learn python for quant finance and trading
Leaderboard (30-day)
Powered by