title: Replace values in a column based on conditions (Max value) from multiple columns in pandas
body: <p>i have a dataset that i already filter like this</p>
  <p><a href="https://i.stack.imgur.com/M7WWr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M7WWr.png" alt="enter image description here" /></a></p>
  <p>in this selection of this dataframe, i want to replace the value of <code>&quot;max</code>&quot; and <code>&quot;critical&quot;</code> column, because the &quot;max&quot; column is wrong, it should be showing the maximum value from pollutant value on that day ('pm10', 'so2', 'co', 'o3', 'no2') and the critical column should be showing the name of the maximum poluttant on that day</p>
  <p>the desired result is :</p>
  <pre><code>tanggal stasiun                         pm10  so2   co  o3  no2 max   critical  categori
  3515    2020-12-01  DKI1 (Bunderan HI)  22    17    4   19  8   22    PM10      BAIK
  3516    2020-12-02  DKI1 (Bunderan HI)  25    18    4   28  7   28    o3        BAIK
  3518    2020-12-04  DKI1 (Bunderan HI)  39    29    8   52  17  52    o3        SEDANG
  3520    2020-12-06  DKI1 (Bunderan HI)  31    22    7   30  9   31    pm10      BAIK
  3521    2020-12-07  DKI1 (Bunderan HI)  25    22    6   18  9   25    pm10      BAIK
  </code></pre>