MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / simple_linear_interpolation

Function simple_linear_interpolation

lib/matplotlib/cbook.py:949–970  ·  view source on GitHub ↗

Resample an array with ``steps - 1`` points between original point pairs. Along each column of *a*, ``(steps - 1)`` points are introduced between each original values; the values are linearly interpolated. Parameters ---------- a : array, shape (n, ...) steps : int

(a, steps)

Source from the content-addressed store, hash-verified

947
948
949def simple_linear_interpolation(a, steps):
950 """
951 Resample an array with ``steps - 1`` points between original point pairs.
952
953 Along each column of *a*, ``(steps - 1)`` points are introduced between
954 each original values; the values are linearly interpolated.
955
956 Parameters
957 ----------
958 a : array, shape (n, ...)
959 steps : int
960
961 Returns
962 -------
963 array
964 shape ``((n - 1) * steps + 1, ...)``
965 """
966 fps = a.reshape((len(a), -1))
967 xp = np.arange(len(a)) * steps
968 x = np.arange((len(a) - 1) * steps + 1)
969 return (np.column_stack([np.interp(x, xp, fp) for fp in fps.T])
970 .reshape((len(x),) + a.shape[1:]))
971
972
973def delete_masked_points(*args):

Callers 1

interpolatedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…