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.9.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.9-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: knarrow-0.0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 65bc0c407a6501e42d94acaf8a55ef0572959c4834ec2a85d2d0a64c06a857f2
MD5 5390a8dc8484784ba794c86dbe11010a
BLAKE2b-256 21cc4058ea3e888f47dbfd50b0b977f286364822060420087c22d6d78b0a16d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: knarrow-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 82d56668929aa1a0569f19272817adbef0a4d5b83f7ca20545834af10f00cfbd
MD5 af513de033ed7de23e83bb3f1319f501
BLAKE2b-256 1542304f4dac81cae830fd1f1629b7b031a596acc84b6920bb1b67d63168dc88

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