python LongArraySequence
Long is one of the data type of python. long() function is used to produce data of long type. long stores 4 bytes of data compared to int datatype which stores 2 bytes of data. Generally when we initialize an array with sequence of numbers then the array's dtype returns that array as int datatype by default but not long datatype. Python's long integer type is not a native numpy type, so you will have to use the object data type. The elements of an numpy array with object type can be any python objects. E.g.,
In [1]: x = np.array([1L, 2L, 3L], dtype=object)
In [2]: type(x[0])
Out[3]: long
Get Answers For Free
Most questions answered within 1 hours.