0

I have the following source dataframe

enter image description here

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?

madmax80
  • 171
  • 1
  • 14

0 Answers0