minor improvements

This commit is contained in:
Andras Schmelczer 2024-04-28 21:26:46 +01:00
parent 6353ae7f78
commit 703019c4cd
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
8 changed files with 123 additions and 214 deletions

View file

@ -0,0 +1,13 @@
import numpy as np
def pdf_transfer_1d(pX: np.ndarray, pY: np.ndarray) -> np.ndarray:
PX = np.cumsum(pX + np.finfo(float).eps)
PX /= PX[-1]
PY = np.cumsum(pY + np.finfo(float).eps)
PY /= PY[-1]
f = np.interp(PX, PY, np.arange(len(pX)))
return f