From e512ad9f01a2b7dae17f6533c1d16bd6b3823c0f Mon Sep 17 00:00:00 2001
From: Nilesh Patra <nilesh@nileshpatra.info>
Date: Thu, 19 Jan 2023 08:37:59 +0530
Subject: [PATCH] BUG: Fix build/tests with numpy 1.24

Closes #423
---
 bottleneck/slow/move.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bottleneck/slow/move.py b/bottleneck/slow/move.py
index 222b6ca84..0aa06f141 100644
--- a/bottleneck/slow/move.py
+++ b/bottleneck/slow/move.py
@@ -232,8 +232,9 @@ def lastrank(a, axis=-1):
         # At least one dimension has length 0
         shape = list(a.shape)
         shape.pop(axis)
-        r = np.empty(shape, dtype=a.dtype)
+        r = np.empty(shape, dtype=float)
         r.fill(np.nan)
+        r = r.astype(a.dtype)
         if (r.ndim == 0) and (r.size == 1):
             r = np.nan
         return r
