Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

ndarray python

# First mode, buffer is None:
>>> np.ndarray(shape=(2,2), dtype=float, order='F')
array([[0.0e+000, 0.0e+000], # random
       [     nan, 2.5e-323]])

#Second mode:
>>> np.ndarray((2,), buffer=np.array([1,2,3]),
           offset=np.int_().itemsize,
           dtype=int) # offset = 1*itemsize, i.e. skip first element
array([2, 3])
Source by numpy.org #
 
PREVIOUS NEXT
Tagged: #ndarray #python
ADD COMMENT
Topic
Name
4+8 =