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/45151 below:

astype_nansafe from float to unsigned int with negatives · Issue #45151 · pandas-dev/pandas · GitHub

from pandas.core.dtypes.cast import astype_nansafe
import numpy as np

arr = np.arange(-3, 3).astype(np.float64)

>>> astype_nansafe(arr, np.dtype(np.uint64))
array([18446744073709551613, 18446744073709551614, 18446744073709551615,
                          0,                    1,                    2],
      dtype=uint64)

Looks like we don't do anything special here, just call ndarray.astype. I guess we should raise rather than give nonsense results?


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