+ 2
Can an help Me in understanding reshape
About reshape ... not so clear with it
13 odpowiedzi
+ 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.
+ 3
Jayakrishna🇮🇳 ...o thanx for telling this... .
+ 2
Vaibhav Singh ok now... clear
0
reshape where , about which one?
Question is not clear..
0
wait ,telling
0
At lesson 8.1
Changing the shape. .not clear with the whole topic...
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..
0
Python
Maths Operations with numpy
0
Hi, Anushka : THE CODER !
You can take a look at this:
https://code.sololearn.com/cWxr0XBhT8vV/?ref=app
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..
0
ya thanx a lot
0
To ..# per ..
And to #jayakrishna
😊
0
You're welcome.. Anushka : THE CODER
info: To mention name here, type @ and select name..