diff --git a/stumpy/core.py b/stumpy/core.py index 4f286f706..5ee2a709d 100644 --- a/stumpy/core.py +++ b/stumpy/core.py @@ -2117,8 +2117,9 @@ def _preprocess(T, copy=True): Time series or sequence copy : bool, default True - A boolean value that indicates whether the process should be done on - input `T` (False) or its copy (True). + A boolean value that indicates whether the process should be performed on + input array `T` (False) or its copy (True). If `T` is a dataframe, then the + data is always copied into a brand new array. Returns ------- @@ -2133,6 +2134,9 @@ def _preprocess(T, copy=True): T = transpose_dataframe(T) + if "pandas" in str(type(T)): + T = T.to_numpy(copy=True) + if "polars" in str(type(T)): T = T.to_numpy(writable=True) @@ -2170,8 +2174,9 @@ def preprocess( Window size copy : bool, default True - A boolean value that indicates whether the process should be done on - input `T` (False) or its copy (True). + A boolean value that indicates whether the process should be performed on + input array `T` (False) or its copy (True). If `T` is a dataframe, then the + data is always copied into a brand new array. M_T : numpy.ndarray, default None Rolling mean @@ -2233,8 +2238,9 @@ def preprocess_non_normalized(T, m, copy=True): Window size copy : bool, default True - A boolean value that indicates whether the process should be done on - input `T` (False) or its copy (True). + A boolean value that indicates whether the process should be performed on + input array `T` (False) or its copy (True). If `T` is a dataframe, then the + data is always copied into a brand new array. Returns ------- @@ -2293,8 +2299,9 @@ def preprocess_diagonal( corresponding value set to False in this boolean array. copy : bool, default True - A boolean value that indicates whether the process should be done on - input `T` (False) or its copy (True). + A boolean value that indicates whether the process should be performed on + input array `T` (False) or its copy (True). If `T` is a dataframe, then the + data is always copied into a brand new array. Returns -------