Skip to main content

nanto makes working with values that might be NaN safer and easier

Project description

nanto

https://img.shields.io/pypi/v/nanto.svg https://img.shields.io/travis/mmore500/nanto.svg Documentation Status

nanto makes working with values that might be NaN safer and easier

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


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 details)

Uploaded Source

Built Distribution

nanto-0.1.1-py2.py3-none-any.whl (4.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nanto-0.1.1.tar.gz.

File metadata

  • Download URL: nanto-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for nanto-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d0b60361babbf85e398bff53cf18437410a3e9b9eb94238759b2158b6ba1016d
MD5 73e0f9f4e79f83798ddd9caf86fc9add
BLAKE2b-256 72b8539dc78f8fee541b73f7f8a17e78c8a0b841e07623df1906f0137dcc128c

See more details on using hashes here.

File details

Details for the file nanto-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: nanto-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for nanto-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b7f438645fefc396cce248fc98486a61608e486de1d467971147e0f059902139
MD5 bb6e6e3f6c2a1f40f82a96ad30b1a45c
BLAKE2b-256 60652b00b40b2e54ec5ee9351bb9f088dd7e7171ca7c6ca4557d850c9b1a9e51

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page