scientimate.downsamplexy#
x_ds, y_ds = scientimate.downsamplexy(x, y, RetainRatio)
Description#
Downsample x and y data and retain given ratio
Inputs#
- x
x data
- y
y data
- RetainRatio=0.5
- Define percentage of data to retain, value between 0 and 1Example: RetainRatio=0.8 means 80% of data are retained
Outputs#
- x_ds
Downsample x data
- y_ds
Downsample y data
Examples#
import scientimate as sm
import numpy as np
from numpy import random
rng = np.random.default_rng()
x=10*rng.random((1000,1))
y=x**2
x_ds, y_ds=sm.downsamplexy(x, y, 0.7)
rng = np.random.default_rng()
xgrid=(-90-(-91))*rng.random((1000,500))+(-91)
ygrid=xgrid**2
x_ds, y_ds=sm.downsamplexy(xgrid, ygrid, 0.3)