Registry / data / pywavelets

pywavelets

JSON →
library1.9.0pypypi✓ verified 27d ago

PyWavelets is a free, open-source Python library for wavelet transforms. It provides 1D, 2D, and nD forward and inverse Discrete Wavelet Transforms (DWT and IDWT), Stationary Wavelet Transforms (SWT), Wavelet Packet decomposition, and Continuous Wavelet Transforms (CWT). It combines a simple high-level interface with low-level C and Cython performance and is widely used in signal processing, image compression, and noise removal. The current version is 1.9.0 and it has an active release cadence, with minor updates and new features being released regularly.

pip install PyWavelets
INSTALL
IMPORT
SIG · PYWAVELETS
P
pywavelets
datapythonv1.9.0
Install
3.9s avg
Import
303ms
Disk
98MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.310s · 98.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.9s · import 0.296s · 95MB
98MB installed
● package 98MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pywt
import pywt

This quickstart demonstrates a basic 1D Discrete Wavelet Transform (DWT) and its inverse using the 'db1' (Daubechies 1) wavelet. It shows how to decompose a signal into approximation (cA) and detail (cD) coefficients, and then reconstruct the original signal.

import pywt import numpy as np data = np.array([1, 2, 3, 4, 5, 6]) wavelet = 'db1' # Perform a single-level Discrete Wavelet Transform (DWT) cA, cD = pywt.dwt(data, wavelet) print(f"Original data: {data}") print(f"Approximation coefficients (cA): {cA}") print(f"Detail coefficients (cD): {cD}") # Perform inverse DWT to reconstruct the signal reconstructed_data = pywt.idwt(cA, cD, wavelet) print(f"Reconstructed data: {reconstructed_data}")
Debug
Known issues
breakingPyWavelets 1.9.0 dropped support for Python 3.10 and added support for Python 3.14. Ensure your Python environment meets the minimum requirement of Python >=3.11.
fix
Upgrade Python to 3.11 or newer, or downgrade PyWavelets to a compatible version if unable to upgrade Python.
affects: 1.9.0+
breakingThe minimum supported NumPy version has been updated. PyWavelets 1.9.0 explicitly requires NumPy >= 1.25.0. Using an older NumPy version will likely lead to installation or runtime errors.
fix
Update NumPy to version 1.25.0 or higher using `pip install --upgrade numpy`.
affects: 1.9.0+
breakingThe optional dependency on SciPy for FFT operations was removed in PyWavelets 1.9.0. If your application implicitly relied on SciPy being available due to PyWavelets, it might now be missing.
fix
Manually install `scipy` (e.g., `pip install scipy`) if your application or specific PyWavelets functions (like certain CWT functionalities) require it.
affects: 1.9.0+
gotchaThe image returned by `pywt.data.camera` was replaced in version 1.2.0 with a new CC0-licensed image due to licensing restrictions on the original 'cameraman' image. If your application relies on the exact pixel data of the original image, it will be different in newer versions.
fix
For commercial use, the new image is safe. If the original image is critical for non-commercial use, you must source it externally or use an older PyWavelets version.
affects: 1.2.0+
gotchaThe length of coefficient arrays returned by `pywt.dwt` depends on the chosen signal extension `mode`. For all modes except 'periodization' ('per'), `len(cA) == len(cD) == floor((len(data) + wavelet.dec_len - 1) / 2)`. For 'periodization' mode, `len(cA) == len(cD) == ceil(len(data) / 2)`. This can lead to unexpected output sizes.
fix
Always explicitly specify the `mode` parameter (e.g., `mode='symmetric'`) and consult the documentation or `pywt.dwt_coeff_len()` to predict output sizes, especially when chaining transforms or performing inverse transforms.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pywt'
The PyWavelets library is not installed in the active Python environment or is installed in a different environment.
fix
pip install PyWavelets
AttributeError: module 'pywt' has no attribute 'dwt_2d'
The function name for a 2D Discrete Wavelet Transform is `dwt2`, not `dwt_2d`.
fix
import pywt

coeffs = pywt.dwt2(data, wavelet_name)
ValueError: Invalid wavelet name 'my_wavelet'. Use pywt.wavelist() to see valid wavelet names.
The specified wavelet name does not correspond to any of the wavelets available in the PyWavelets library.
fix
import pywt

# To see available wavelets:
print(pywt.wavelist())

# Use a valid wavelet name, e.g.
coeffs = pywt.dwt(data, 'db1')
TypeError: expected an array of at least 1 dimension (got 0)
PyWavelets functions expect array-like input, but a scalar value was provided instead, leading to a NumPy dimension error.
fix
import numpy as np
import pywt

data = np.array([1, 2, 3, 4])  # Ensure data is an array
coeffs = pywt.dwt(data, 'db1')
Upgrade
Version history
1.9.0latest on PyPI · released Aug 4, 2025
Audit
Dependencies
numpyrequiredRequired for numerical array operations. PyWavelets 1.9.0 requires NumPy >= 1.25.0.
matplotliboptionalOptional dependency, required for running tests and many examples involving plotting.
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
pywavelets — pip install pywavelets · libregistry