nanto makes working with values that might be NaN safer and easier
Project description
nanto
nanto makes working with values that might be NaN safer and easier
Free software: MIT license
Documentation: https://nanto.readthedocs.io.
from nanto import isanan, nantonone, nantozero
isanan(7.0) # False
isanan('string') # False
isanan(None) # False
isanan(float('nan')) # True
nanto(float('nan'), 'fallback') # returns 'fallback'
nanto(1.7, 'fallback') # returns 1.7
nanto(float('inf'), 'fallback') # returns inf
nanto(None, 'fallback') # returns None
nanto('hello', 'fallback') # returns 'hello'
nantonone(float('nan')) # returns None
nantonone(1.7) # returns 1.7
nantonone(float('inf')) # returns inf
nantonone(None) # returns None
nantonone('hello') # returns 'hello'
nantozero(float('nan')) # returns 0
nantozero(1.7) # returns 1.7
nantozero(float('inf')) # returns inf
nantozero(None) # returns None
nantozero('hello') # returns 'hello'
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.0.0 (2022-02-22)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nanto-0.1.1.tar.gz
(10.2 kB
view hashes)
Built Distribution
Close
Hashes for nanto-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f438645fefc396cce248fc98486a61608e486de1d467971147e0f059902139 |
|
MD5 | bb6e6e3f6c2a1f40f82a96ad30b1a45c |
|
BLAKE2b-256 | 60652b00b40b2e54ec5ee9351bb9f088dd7e7171ca7c6ca4557d850c9b1a9e51 |