Movatterモバイル変換


[0]ホーム

URL:


Open In App
Next Article:
Flatten a Matrix in Python using NumPy
Next article icon

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 :

Python
# Python program explaining# numpy.ndarray.resize() function# importing numpy as geekimportnumpyasgeekarr=geek.array([[0,1],[2,3]])# this function change the shape and size# of the array & return Nonegfg=arr.resize((2,1))print(gfg)

Output :

None

Code #2 :

Python
# Python program explaining# numpy.ndarray.resize() function# importing numpy as geekimportnumpyasgeekarr=geek.array([[0,1],[2,3]],order='F')# this function change the shape and size# of the array & return Nonegfg=arr.resize((2,1))print(gfg)

Output :

None

Improve

Similar Reads

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood ourCookie Policy &Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences

[8]ページ先頭

©2009-2025 Movatter.jp