Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python RuntimeWarning: overflow encountered in long_scalars

# Error:
RuntimeWarning: overflow encountered in long_scalars

# Solution:
# This error usually comes up because the data type you're using can't 
# handle the size of number you're trying to manipulate. For example,
# the largest number you can manipulate with int32 is 2147483647. 
# Depending on the size of numbers you're dealing with, setting the data
# type to int64 or float64 might solve the problem. E.g.:
numpy_array = np.array(my_list, dtype=numpy.float64)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #overflow #encountered
ADD COMMENT
Topic
Name
1+1 =