Repository: dask/dask

Issue:
repeated cumsum on dataframe returns the results of the first cumsum
reproduce with 
```python
import pandas as pd
import dask.dataframe as ddf

df = pd.DataFrame(dict(a=list('aabbcc')),
                  index=pd.date_range(start='20100101', periods=6))
df['ones']=1
df['twos']=2

dadf = ddf.from_pandas(df, npartitions=3)
dadf['onescs']=dadf.ones.cumsum()
dadf['twoscs']=dadf.twos.cumsum()
print dadf.compute()
```
which yields
```
            a  ones  twos  onescs  twoscs
2010-01-01  a     1     2       1       1
2010-01-02  a     1     2       2       2
2010-01-03  b     1     2       3       3
2010-01-04  b     1     2       4       4
2010-01-05  c     1     2       5       5
2010-01-06  c     1     2       6       6
```

Pandas itself works correctly:
```python
df['onescs']=df.ones.cumsum()
df['twoscs']=df.twos.cumsum()
print df
```
which yields
```
            a  ones  twos  onescs  twoscs
2010-01-01  a     1     2       1       2
2010-01-02  a     1     2       2       4
2010-01-03  b     1     2       3       6
2010-01-04  b     1     2       4       8
2010-01-05  c     1     2       5      10
2010-01-06  c     1     2       6      12
```


Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1360,27 +1360,29 @@ def describe(self, split_every=False):
 
         return new_dd_object(dsk, name, num._meta, divisions=[None, None])
 
-    def _cum_agg(self, token, chunk, aggregate, axis, skipna=True,
+    def _cum_agg(self, op_name, chunk, aggregate, axis, skipna=True,
                  chunk_kwargs=None):
         """ Wrapper for cumulative operation """
 
         axis = self._validate_axis(axis)
 
         if axis == 1:
-            name = '{0}{1}(axis=1)'.format(self._token_prefix, token)
+            name = '{0}{1}(axis=1)'.format(self._token_prefix, op_name)
             return self.map_partitions(chunk, token=name, **chunk_kwargs)
         else:
             # cumulate each partitions
-            name1 = '{0}{1}-map'.format(self._token_prefix, token)
+            name1 = '{0}{1}-map'.format(self._token_prefix, op_name)
             cumpart = map_partitions(chunk, self, token=name1, meta=self,
                                      **chunk_kwargs)
 
-            name2 = '{0}{1}-take-last'.format(self._token_prefix, token)
+            name2 = '{0}{1}-take-last'.format(self._token_prefix, op_name)
             cumlast = map_partitions(_take_last, cumpart, skipna,
                                      meta=pd.Series([]), token=name2)
 
-            name = '{0}{1}'.format(self._token_prefix, token)
-            cname = '{0}{1}-cum-last'.format(self._token_prefix, token)
+            suffix = tokenize(self)
+            name = '{0}{1}-{2}'.format(self._token_prefix, op_name, suffix)
+            cname = '{0}{1}-cum-last-{2}'.format(self._token_prefix, op_name,
+                                                 suffix)
 
             # aggregate cumulated partisions and its previous last element
             dask = {}


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -2823,3 +2823,18 @@ def test_bool():
     for cond in conditions:
         with pytest.raises(ValueError):
             bool(cond)
+
+
+def test_cumulative_multiple_columns():
+    # GH 3037
+    df = pd.DataFrame(np.random.randn(100, 5), columns=list('abcde'))
+    ddf = dd.from_pandas(df, 5)
+
+    for d in [ddf, df]:
+        for c in df.columns:
+            d[c + 'cs'] = d[c].cumsum()
+            d[c + 'cmin'] = d[c].cummin()
+            d[c + 'cmax'] = d[c].cummax()
+            d[c + 'cp'] = d[c].cumprod()
+
+    assert_eq(ddf, df)