numpy.ndarray.resize() function – Python
numpy.ndarray.resize()
function change shape and size of array in-place.
Syntax : numpy.ndarray.resize(new_shape, refcheck = True)
Parameters :
new_shape :[tuple of ints, or n ints] Shape of resized array.
refcheck :[bool, optional] If False, reference count will not be checked. Default is True.
Return : None
Code #1 :
import numpy as geek
arr = geek.array([[ 0 , 1 ], [ 2 , 3 ]])
gfg = arr.resize(( 2 , 1 ))
print (gfg)
|
Output :
None
Code #2 :
import numpy as geek
arr = geek.array([[ 0 , 1 ], [ 2 , 3 ]], order = 'F' )
gfg = arr.resize(( 2 , 1 ))
print (gfg)
|
Output :
None
Last Updated :
11 Jun, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...