Skip to main content

Shoot a knarrow to the knee

Project description

knarrow

Shoot a knarrow to the knee ;)

(The lib is better than this pun, I swear.)

Detect knee points in various scenarios using a plethora of methods

Usage

Just plugin your values in a list, tuple or an np.ndarray and watch knarrow hit the knee:

>>> from stubs import find_knee
>>> find_knee([1, 2, 3, 4, 6])  # use a list
3
>>> find_knee((1, 2, 3, 4, 6))  # or a tuple
3
>>> import numpy as np
>>> y = np.array([1.0, 1.05, 1.15, 1.28, 1.30, 2.5, 3.6, 4.9])
>>> find_knee(y)  # provide just the values
4
>>> x = np.arange(8)
>>> find_knee(x, y)  # or both x and y
4
>>> A = np.vstack((x, y))
>>> A
array([[0.  , 1.  , 2.  , 3.  , 4.  , 5.  , 6.  , 7.  ],
       [1.  , 1.05, 1.15, 1.28, 1.3 , 2.5 , 3.6 , 4.9 ]])
>>> find_knee(A)  # works with x in first row, y in the second
4
>>> A.T
array([[0.  , 1.  ],
       [1.  , 1.05],
       [2.  , 1.15],
       [3.  , 1.28],
       [4.  , 1.3 ],
       [5.  , 2.5 ],
       [6.  , 3.6 ],
       [7.  , 4.9 ]])
>>> find_knee(A.T)  # also works with x in the first column, y in the second column
4

Note: this project was bootstrapped by python-blueprint

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

knarrow-0.0.11.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knarrow-0.0.11-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file knarrow-0.0.11.tar.gz.

File metadata

  • Download URL: knarrow-0.0.11.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for knarrow-0.0.11.tar.gz
Algorithm Hash digest
SHA256 8ed7ae42f22a2469c2c87fba424e2cdd79206386a582b31f2f30a6c28de1a9c9
MD5 8784fd55bf6083a2cde842a2a7008420
BLAKE2b-256 2e78315d5dda25a1098874d27bedae80c28cd0b3b2f4dfee4efbabf7289903d9

See more details on using hashes here.

File details

Details for the file knarrow-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: knarrow-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for knarrow-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 b3a36ea83a025c8aa61591be1c08b2577000964b7871ea6eea7ef8fba2933cb0
MD5 53a88e415fb287c0a41f31d7281a1968
BLAKE2b-256 2eba162d561e08da31c4fca5684709db1bab94eec3d6b1c32be3625a46e6ef12

See more details on using hashes here.

Supported by

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