Can anyone please help me to understand that from where does Numpy's array function infers data type.
I understand it basically infers from the kind of value that has been assigned to the array.
For Example:
> data = [1,2,3,4]
> arr = np.array(data)
So in the above lines the "arr" will have the dtype('int64') or dtype('int32').
What I am trying to understand is how does it decides whether to give it a int64 or a int32?
I understand that it might be a trivial question but I am just trying to understand that how does it work as I was recently asked this in an interview.