File: gotchas.rst

package info (click to toggle)
pywavelets 1.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,680 kB
  • sloc: python: 8,849; ansic: 5,134; makefile: 93
file content (25 lines) | stat: -rw-r--r-- 590 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 = 'symmetric'
    >>> 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