Skip to content

Commit 2a1924d

Browse files
Update src/fast_array_utils/stats/_mean_var.py
Co-authored-by: Philipp A. <flying-sheep@web.de>
1 parent 65e83a6 commit 2a1924d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/fast_array_utils/stats/_mean_var.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,11 @@ def mean_var_(
3636
from . import mean
3737

3838
if isinstance(x, np.ndarray | types.CSBase):
39-
float64 = np.float64
39+
xp = np
4040
else:
4141
import array_api_compat
4242

43-
if array_api_compat.is_array_api_obj(x):
44-
xp = array_api_compat.array_namespace(x)
45-
float64 = xp.float64
46-
else:
47-
float64 = np.float64
43+
xp = array_api_compat.array_namespace(x) if array_api_compat.is_array_api_obj(x) else np
4844

4945
if axis is not None and isinstance(x, types.CSBase):
5046
mean_, var = _sparse_mean_var(x, axis=axis)

0 commit comments

Comments
 (0)