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

should ComplexBlock._can_hold_element/should_store check itemsize? · Issue #32878 · pandas-dev/pandas · GitHub

arr = np.arange(5).astype("c8")
ser = pd.Series(arr)
val = np.finfo(np.float64).max
val = val.astype("c16")

>>> val
(1.7976931348623157e+308+0j)

ser[0] = val

>>> ser
0             inf+0.000000e+00j
1    1.000000e+00+0.000000e+00j
2    2.000000e+00+0.000000e+00j
3    3.000000e+00+0.000000e+00j
4    4.000000e+00+0.000000e+00j
dtype: complex64

For IntBlock we check the itemsize to avoid overflows, but for FloatBlock and ComplexBlock we do not, so we get the inf here. Should we instead be upcasting?


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