I am currently working with pandas.DataFramethat I need to split the entire data frame by a specific value, with the exception of one row. It's easy to split the entire data frame into one value, however I would like one of the rows to be accurate. For example, if I have such a data frame as shown below:
A B C D
10000 10000 10000 10000
10000 10000 10000 10000
10000 10000 10000 10000
10000 10000 10000 10000
1 1 1 1
10000 10000 10000 10000
10000 10000 10000 10000
I want to divide all rows by a value of 1000, except for the 5th row, and I would like all the values to remain unchanged. So, the new dataframe will look like this:
A B C D
10 10 10 10
10 10 10 10
10 10 10 10
10 10 10 10
1 1 1 1
10 10 10 10
10 10 10 10
Is there an easy way to do this? I feel that I am missing something very basic. I tried using loc, iloc, mul and div, but can't get them working at the same time.