crop#

atompy.crop(x, y, lower=-inf, upper=inf)[source]#

Return x,y data where lower <= x < upper.

Parameters:
x, yarray_like

The x and y data

lowerfloat, default -np.inf

lower limit, inclusive

upperfloat, default +np.inf

upper limit, exclusive

Returns:
new_xndarray

cropped x-data

new_yndarray

cropped y-data

Examples

>>> import atompy as ap
>>> import numpy as np
>>> x = y = np.arange(6)
>>> x, y
(array([0, 1, 2, 3, 4, 5]), array([0, 1, 2, 3, 4, 5]))
>>> ap.crop(x, y, 1, 4)
(array([1, 2, 3]), array([1, 2, 3]))