map function in python , when mapping for x^3 for large numbers giving me negative values

  dictionary, python

I am trying to map the function for x^3 for range of 1 to 10^5 , but it is returning negative values .

import numpy as np

import datetime

s= list(np.arange(1,10**4))

t1= datetime.datetime.now()

s1= (list(map(lambda x:x**3,s)))

s2= (list(map(lambda x:x**2,s)))

set1= set(s1)

set2= set(s2)

print(min(s1),min(s2), min(s))

my output is :

-2147398523 1 1

Source: Python Questions

LEAVE A COMMENT