title: Pandas multicolumn cumsum() on a subset of rows
body: <p>I can get this to work if I do the cumsum one column at a time. However doing it together outputs NaNs.</p>
  <pre><code>df = pd.DataFrame({&quot;category&quot;: [1,2,2], &quot;value1&quot;: [10,11,12], &quot;value2&quot;: [20,21,22]})
  m = df[&quot;category&quot;] == 2
  df.loc[m, [&quot;cum_value1&quot;, &quot;cum_value2&quot;]] = df.loc[m, [&quot;value1&quot;, &quot;value2&quot;]].cumsum()
  </code></pre>