File: gotchas.rst

package info (click to toggle)
pywavelets 0.2.0-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,584 kB
  • sloc: ansic: 3,357; python: 1,843; makefile: 143
file content (25 lines) | stat: -rw-r--r-- 584 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.. _reg-gotchas:

.. currentmodule:: pywt


=======
Gotchas
=======

PyWavelets utilizes ``NumPy`` under the hood. That's why handling the data
containing ``None`` values can be surprising. ``None`` values are converted to
'not a number' (``numpy.NaN``) values:

    >>> import numpy, pywt
    >>> x = [None, None]
    >>> mode = 'sym'
    >>> wavelet = 'db1'
    >>> cA, cD = pywt.dwt(x, wavelet, mode)
    >>> numpy.all(numpy.isnan(cA))
    True
    >>> numpy.all(numpy.isnan(cD))
    True
    >>> rec = pywt.idwt(cA, cD, wavelet, mode)
    >>> numpy.all(numpy.isnan(rec))
    True