A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/40638 below:

PandasArray.to_numpy mishandles na_value · Issue #40638 · pandas-dev/pandas · GitHub

Problem is here:

pandas/pandas/core/arrays/numpy_.py

Lines 358 to 364 in acacff3

result = np.asarray(self._ndarray, dtype=dtype) if (copy or na_value is not lib.no_default) and result is self._ndarray: result = result.copy() if na_value is not lib.no_default: result[self.isna()] = na_value

Since na_value is handled after the dtype conversion, calls like

arr = pd.array([pd.NA, 1], dtype="string")
arr.to_numpy(na_value=True, dtype=bool)

fail.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4