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.
Release files for nanto 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nanto-0.1.1.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nanto-0.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 14.5 kB
Release files / nanto-0.1.1.tar.gz
| Download URL | nanto-0.1.1.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0b60361babbf85e398bff53cf18437410a3e9b9eb94238759b2158b6ba1016d
|
|
BLAKE2b-256 checksum How to use checksums |
72b8539dc78f8fee541b73f7f8a17e78c8a0b841e07623df1906f0137dcc128c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Release files / nanto-0.1.1-py2.py3-none-any.whl
| Download URL | nanto-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b7f438645fefc396cce248fc98486a61608e486de1d467971147e0f059902139
|
|
BLAKE2b-256 checksum How to use checksums |
60652b00b40b2e54ec5ee9351bb9f088dd7e7171ca7c6ca4557d850c9b1a9e51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|