I have the following source dataframe
and would like to change values in selected columns to reciprocal. When I try to run the following script
df_bets.loc[:,'B365H':] = 1/df_bets.loc[:,'B365H':]
I get the warning:
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
Is there a better way how to do it?