I am trying to perform an operation on all columns within my pandas dataframe except one.
I first tried:
df=df[:,1:]*0.001
returned an error message. Then tried:
df=df.iloc[:,1:]*0.001
I want the operation to be performed on all columns except the first one. However, this replaces the dataframe with only the columns I have selected for the operation.
How do you select specific columns to perform operations while leaving others unaltered? I may have situations where it is not necessarily the first column to remain untouched.
Thanks.