Two lines if you don't count the import. Using @compton_scatter's trick of simply not doing %k if k is 0, though done by doing %2^{31} instead.

```
import numpy as np
class Solution(object):
def checkSubarraySum(self, nums, k):
X = np.cumsum([0] + nums) % (k or 2**31)
return any(x in X[i+2:] for i, x in enumerate(X))
```

Bad complexity, but does get accepted in around 180 ms.