Function collection for handling integers with NaNs.
Project description
intnan
Integer data types lack special values for -inf
, inf
and NaN
. Especially
NaN
as an indication for missing data would be useful in many scientific contexts.
Of course there is numpy.ma.MaskedArray
around for the very same reason. Nevertheless,
it might sometimes be annoying to carry a separate mask array around. And in those cases,
using a set of numpy
-compatible functions for the same job will do just fine.
This package provides such an implementation for several standard numpy
functions, that
treat integer arrays in such a way, that the lowest negative integer resembles NaN
.
The library provides an implementation using only standard numpy
functions and
another implementation using numba
, for functions that allow major speed gains.
The numba
implementation is automatically selected, when it is available for import.
functions
The following list of functions is provided by intnan
.
- nanval(x)
- isnan(x)
- fix_invalid(x, copy=True, fill_value=0)
- asfloat(x)
- anynan(x)
- allnan(x)
- nanmax(x)
- nanmin(x)
- nanmaximum(x, y)
- nanminimum(x, y)
- nansum(x)
- nanprod(x)
- nancumsum(x)
- nanmean(x)
- nanvar(x, ddof=0)
- nanstd(x, ddof=0)
- nanequal(x, y)
- nanclose(x, y, delta=sys.float_info.epsilon)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file intnan-0.2.1.tar.gz
.
File metadata
- Download URL: intnan-0.2.1.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47a49b1aaf47925fec01e2a44efde3c8c85ddbb44e57d119b8b24b47f2bf87b7 |
|
MD5 | 9a86d56a8be0b22b96b92bb5e5f43153 |
|
BLAKE2b-256 | 34549e31ef0f73224d07647f3a3704ca6a56492757ce66cff046a3631084723e |
File details
Details for the file intnan-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: intnan-0.2.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e96e304c79f05cc0e6e848a77cd2fadc9e4b86aed9d286c621458752079966f |
|
MD5 | 07a780db6ae903e1cae852bbd455edb6 |
|
BLAKE2b-256 | a33007f4668568d300fe5d9e0230879d8268af4a627462d773b81d6d8b059c8a |