- What is NumPy in Python primarily used for ?
- Web development
- Data visualization
- Scientific computing and data analysis
- Machine learning algorithms
- Which of the following data structure is a core component of NumPy ?
- List
- Dictionary
- Tuple
- ndarray (N-dimensional array)
- How can you create a 1D array in NumPy ?
- numpy.array([1, 2, 3])
- numpy.ndarray(1, 2, 3)
- numpy.list([1, 2, 3])
- numpy.array(1, 2, 3)
- Solve the given code ?
import numpy as n
a= n.array([1,2,3])
b= n.array([1,2,3])
c=a+b
print(c)
- [2,4,6]
- [1,2,3]
- [1,2,3]
- [2 4 6]
- What will be output of following code ?
import numpy as n
nb=n.arange(4)
print(nb)
- [0 1 2 3]
- [0 1 2 3 4]
- [0, 1, 2, 3]
- None of the above
- What will be the output of following code ?
import numpy as n
print(n.minimum([2,3,4],[1,5,2]))
- [1 2 5]
- [1 5 2]
- [2 3 4]
- [1 3 2]
- Solve the given code :
import numpy as np
a=np.array([1,2,1,5,8])
b=np.array([0,1,5,4,2])
c=a+b
c=c*a
print(c[2])
- 6
- 10
- 0
- None of above
- What are the attributes of numpy array ?
- shape, dtype, ndim
- object, type, list
- objects, non, vectorization
- Unicode and shape
- how can we check all fucntion in numpy ?
- import numpy
print(dir(numpy))
- import numpy
print(info(numpy))
- import numpy
print((numpy.list))
- None of the above
- Which NumPy function is used to create an array filled with zeros ?
- empty()
- zeros()
- ones()
- copy()
- The primary purpose of the copy() function in NumPy is to :
- Create an empty array
- Create an array with ones
- Duplicate an existing array with its data
- Create an array with zeros
- What is the output of following code ?
import numpy as np
a=np.array([12,22,33,44])
print(a.dtype)
- int
- integer
- int32
- None of above
- Can we convert tuple in array ?
- Yes
- No
- Can't say
- May be
- What will be the output of following code ?
import numpy as np
arr = np.array([[1, 2, 3, 4],[45, 64, 47, 48]])
print(arr.shape)
- (3, 4)
- (4, 4)
- (2, 4)
- (4, 2)
- What will be output for the following code ?
import numpy as np
a = np.array([[1,2,3],[0,1,4],[11,22,33]])
print (a.size)
- 1
- 3
- 4
- 9