MCPcopy Create free account
hub / github.com/PyTTaMaster/PyTTa / _find_nearest

Function _find_nearest

pytta/_plot.py:1390–1397  ·  view source on GitHub ↗

Function to find closest frequency in frequency array. Returns closest value and position index.

(array, value)

Source from the content-addressed store, hash-verified

1388
1389
1390def _find_nearest(array, value):
1391 """
1392 Function to find closest frequency in frequency array.
1393 Returns closest value and position index.
1394 """
1395 array = np.asarray(array)
1396 idx = (np.abs(array - value)).argmin()
1397 return array[idx], idx
1398
1399
1400def _polygon_under_graph(xlist, ylist, Pmin):

Callers 1

waterfallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected