From 1c60e875e8a2f03c6bc0ae60e5ffec377f49d4ef Mon Sep 17 00:00:00 2001 From: Thibault Barnouin Date: Tue, 16 Jul 2024 11:40:40 +0200 Subject: [PATCH] np.mat to np.asmatrix for Numpy 2.0 --- package/lib/reduction.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/lib/reduction.py b/package/lib/reduction.py index 2b6f736..a9ce0f1 100755 --- a/package/lib/reduction.py +++ b/package/lib/reduction.py @@ -217,9 +217,9 @@ def bin_ndarray(ndarray, new_shape, operation="sum"): elif operation.lower() in ["mean", "average", "avg"]: ndarray = ndarray.mean(-1 * (i + 1)) else: - row_comp = np.mat(get_row_compressor(ndarray.shape[0], new_shape[0], operation)) - col_comp = np.mat(get_column_compressor(ndarray.shape[1], new_shape[1], operation)) - ndarray = np.array(row_comp * np.mat(ndarray) * col_comp) + row_comp = np.asmatrix(get_row_compressor(ndarray.shape[0], new_shape[0], operation)) + col_comp = np.asmatrix(get_column_compressor(ndarray.shape[1], new_shape[1], operation)) + ndarray = np.array(row_comp * np.asmatrix(ndarray) * col_comp) return ndarray