From 02c475ff41f6f773a363f5c89dc6933e0fb38e00 Mon Sep 17 00:00:00 2001 From: jayceslesar Date: Sun, 19 Mar 2023 11:16:27 -0400 Subject: [PATCH] convert to numpy arrays --- tsdownsample/downsampling_interface.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tsdownsample/downsampling_interface.py b/tsdownsample/downsampling_interface.py index 9883ed9..e733514 100644 --- a/tsdownsample/downsampling_interface.py +++ b/tsdownsample/downsampling_interface.py @@ -50,6 +50,12 @@ def _check_valid_downsample_args( "downsample() takes 1 or 2 positional arguments but " f"{len(args)} were given" ) + + if x is not None and not isinstance(x, np.ndarray): + x = np.array(x) + if not isinstance(y, np.ndarray): + y = np.array(y) + # y must be 1D array if y.ndim != 1: raise ValueError("y must be 1D array")