This is a python library providing the function zchop, which replaces numbers
that are close to zero with zero.
zchoptraverses structures such aslists and numpyarrays, returning a copy that is the same as the input except that small numbers are set to zero.zchop_mutis a mutating version ofzchopthat mutateslists and numpyarrays.
- The parts of complex numbers are treated separately.
- Non-numbers are passed unchanged.
This package is based on the Julia package ZChop.jl, which is in turn based on the Mathematica function Chop.