NumPy Basics
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдХреЛрдб рдХрд╛ рдкрд░рд┐рдгрд╛рдо рдХреНрдпрд╛ рд╣реИ ?
What will be output for the following code ?
import numpy as np
ary = np.array( [1, 2, 3, 5, 8 ] )
ary = ary + 1
print (ary [1] )
x рдХрд╛ рдбреЗрдЯрд╛рдЯрд╛рдЗрдк рдХреНрдпрд╛ рд╣реИ?
What is the datatype of x ?
import numpy as np
a = np.array( [1, 2, 3, 4 ] )
x = a.tolist()
NumPy рдкреИрдХреЗрдЬ рдореЗрдВ eye( ) рдлрд╝рдВрдХреНрд╢рди рдХреНрдпрд╛ рд▓реМрдЯрд╛рддрд╛ рд╣реИ?
What does the eye( ) function in the NumPy package return ?
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдХреЛрдб рдХреЗ рд▓рд┐рдП рдЖрдЙрдЯрдкреБрдЯ рдХреНрдпрд╛ рд╣реЛрдЧрд╛?
What will be output for the following code ?
import numpy as np
a = np.array([[1,2,3],[0,1,4]])
print (a.size)
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдХреЛрдб рдХреЗ рд▓рд┐рдП рдЖрдЙрдЯрдкреБрдЯ рдХреНрдпрд╛ рд╣реЛрдЧрд╛?
What is the output of the following code ?
import numpy as np
a = np.array([1,2,3])
print(a.ndim)
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдХреЛрдб рдХреЗ рд▓рд┐рдП рдЖрдЙрдЯрдкреБрдЯ рдХреНрдпрд╛ рд╣реЛрдЧрд╛?
What will be output for the following code ?
import numpy as np
a = np.array([[[1,2,3,5,8]]])
print (a.ndim)
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдХреЛрдб рдХреЗ рд▓рд┐рдП рдЖрдЙрдЯрдкреБрдЯ рдХреНрдпрд╛ рд╣реЛрдЧрд╛?
What will be output for the following code ?
import numpy as np
a = np.array( [2, 3, 4, 5] )
print(a.dtype)