From 988871bb7942a47be3f6130021f77ac7d85db4dc Mon Sep 17 00:00:00 2001 From: Josh Falkiner Date: Tue, 10 Sep 2024 07:01:59 +0200 Subject: [PATCH] replace numpy.bool with bool --- convoys/multi.py | 2 +- convoys/regression.py | 2 +- test_convoys.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/convoys/multi.py b/convoys/multi.py index 04ea2e9..8a223bb 100644 --- a/convoys/multi.py +++ b/convoys/multi.py @@ -25,7 +25,7 @@ def fit(self, G, B, T): G = numpy.array(G, dtype=numpy.int) n, = G.shape self._n_groups = max(G) + 1 - X = numpy.zeros((n, self._n_groups), dtype=numpy.bool) + X = numpy.zeros((n, self._n_groups), dtype=bool) for i, group in enumerate(G): X[i,group] = 1 self.base_model.fit(X, B, T) diff --git a/convoys/regression.py b/convoys/regression.py index 04bfd92..a67c1c6 100644 --- a/convoys/regression.py +++ b/convoys/regression.py @@ -344,7 +344,7 @@ def rvs(self, x, n_curves=1, n_samples=1, T=None): T = numpy.zeros((n_curves, n_samples)) else: assert T.shape == (n_curves, n_samples) - B = numpy.zeros((n_curves, n_samples), dtype=numpy.bool) + B = numpy.zeros((n_curves, n_samples), dtype=bool) C = numpy.zeros((n_curves, n_samples)) params = self.params['samples'] for i, j in enumerate(numpy.random.randint(len(params['k']), diff --git a/test_convoys.py b/test_convoys.py index 27d42e5..67bb4a6 100644 --- a/test_convoys.py +++ b/test_convoys.py @@ -344,7 +344,7 @@ def test_convert_dataframe_created_at_nan(n=1000): df.loc[df.index[0], 'created'] = None unit, groups, (G, B, T) = convoys.utils.get_arrays(df) assert numpy.issubdtype(G.dtype, numpy.integer) - assert numpy.issubdtype(B.dtype, numpy.bool_) + assert numpy.issubdtype(B.dtype, bool) assert numpy.issubdtype(T.dtype, numpy.number)