Which of the following statements about arrays in Python is correct?
What is the time complexity of accessing an element by index in an array?
1 Crore+ students have signed up on EduRev. Have you? Download the App |
In Python, arrays can be created using which of the following modules?
Which of the following is an advantage of using arrays in Python?
What will be the output of the following code?
my_array = [1, 2, 3, 4, 5]
print(my_array[2])
What will be the output of the following code?
my_array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print(my_array[1][2])
What will be the output of the following code?
import numpy as np
my_array = np.array([1, 2, 3, 4, 5])
print(my_array[3])
What will be the output of the following code?
import numpy as np
my_array = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
print(my_array[2][1])
What will be the output of the following code?
import numpy as np
my_array = np.array([1, 2, 3, 4, 5])
new_array = my_array.copy()
new_array[2] = 10
print(my_array[2])
Given a 2D array matrix, how can we access all the elements of the first row in Python using a loop?
Which of the following methods can be used to find the maximum element in a 2D array matrix using numpy?
Given a 2D array matrix, how can we obtain the transpose of the matrix in Python using numpy?
Which of the following numpy functions can be used to concatenate two arrays vertically?
Given an array arr, how can we pass it as an argument to a function my_function in Python?