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

IntegerArray + List returns ndarray · Issue #22962 · pandas-dev/pandas · GitHub

Right now, IntegerArary.__add__ calls np.asarray(other) for list-like other. When other is an actual list with missing values, we end up with a float ndarray.

In [2]: arr = pd.Series([1, None, 3], dtype='Int8').values

In [3]: arr + list(arr)
Out[3]: array([ 2., nan,  6.])

Compare with Non-NA values:

In [4]: arr = pd.Series([1, 2, 3], dtype='Int8').values

In [6]: arr + list(arr)
Out[6]: IntegerArray([2, 4, 6], dtype='Int8')

In general, an IntegerArray + ndarray[float] should be a floating point ndarray,

In [10]: arr + np.array([1., 2., 3.])
Out[10]: array([2., 4., 6.])

Do we special case missing values here?


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