From 47f905b2cf1bce289381b854efb31f8ce5a25264 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:27:42 +0100 Subject: [PATCH] compat --- narwhals/_pandas_like/series.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/narwhals/_pandas_like/series.py b/narwhals/_pandas_like/series.py index fa5b4050f..f02a86aea 100644 --- a/narwhals/_pandas_like/series.py +++ b/narwhals/_pandas_like/series.py @@ -373,7 +373,8 @@ def to_numpy(self) -> Any: has_missing = self._series.isna().any() if has_missing and str(self._series.dtype) in PANDAS_TO_NUMPY_DTYPE_MISSING: return self._series.to_numpy( - dtype=PANDAS_TO_NUMPY_DTYPE_MISSING[str(self._series.dtype)] + dtype=PANDAS_TO_NUMPY_DTYPE_MISSING[str(self._series.dtype)], + na_value=float("nan"), ) if ( not has_missing