Can an help Me in understanding reshape | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can an help Me in understanding reshape

About reshape ... not so clear with it

10th May 2022, 10:29 AM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
13 Answers
+ 4
import numpy as np x=np.arange(1,12,2) # this word is made up of 2 words i.e array + range so it returns the [1,3,5,7,9,11] z= x.reshape(3,2) #it return the 2 rows and 3 columns it means when we print the z it returns the. [ [1,3] [5,7] [9,11] ] #if z= x.reshape(2,3) and print the z it returns the [ [1,3,5] [7,9,11] ] bookish language The reshape() function is used to give a new shape to an array without changing its data.
10th May 2022, 3:23 PM
Vaibhav
Vaibhav - avatar
+ 3
Jayakrishna🇮🇳 ...o thanx for telling this... .
10th May 2022, 1:13 PM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
+ 2
Vaibhav Singh ok now... clear
10th May 2022, 4:05 PM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
0
reshape where , about which one? Question is not clear..
10th May 2022, 10:35 AM
Jayakrishna 🇮🇳
0
wait ,telling
10th May 2022, 10:36 AM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
0
At lesson 8.1 Changing the shape. .not clear with the whole topic...
10th May 2022, 10:40 AM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
0
In which course? Tag the language name.. Also, you need to share the task description along with your try.. If am or others, not attempted the lesson you said ex:8.1 , then it in locked so can't see the task .. So pls share full details.. Hope you understand..
10th May 2022, 10:53 AM
Jayakrishna 🇮🇳
0
Python Maths Operations with numpy
10th May 2022, 11:01 AM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
10th May 2022, 11:29 AM
Per Bratthammar
Per Bratthammar - avatar
0
#Anushka : THE CODER there are 4+ python courses.. Am not aware of the your question where it is.. ! #adding an example, may it helps you.. import numpy as np b = np.array([[1,2,3],[4,5,6]]) print(b.shape) #(2, 3) print(b) #b is 2 x 3 matrix b = b.reshape(3,2) #but now reshaped to 3,2 matrix print(b.shape) #(3, 2) print(b) # 3 x 2 matrix #observe the outputs.... #Hope this example helps you to understand and solve your task..
10th May 2022, 11:35 AM
Jayakrishna 🇮🇳
0
ya thanx a lot
10th May 2022, 12:38 PM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
0
To ..# per .. And to #jayakrishna 😊
10th May 2022, 12:40 PM
NIVEDITA 😉✌
NIVEDITA 😉✌ - avatar
0
You're welcome.. Anushka : THE CODER info: To mention name here, type @ and select name..
10th May 2022, 12:46 PM
Jayakrishna 🇮🇳