Pandas int8 overflow: Why small dtypes wrap around silently

Pandas int8 overflow: Why small dtypes wrap around silently

If your dtype is too small, operations on your Python Pandas series will fail:

s = Series([10, 20, 30], dtype='int8')
s + 100

Returns:

0 110
1 120
2 -126 # 🤯
dtype: int8

This does give an error:

s + 500
OverflowError: Python integer 500 out of bounds for int8