I think this is how it should be done.
```py
rec = (pywt.upcoef('a', cA, 'db2', take=n) +
       pywt.upcoef('d', cD, 'db2', take=n))
```