11 January 2026

#NumPy


Key Concepts


S.No Topic Sub Topic
1 NumPy Installation, Import, ndarray, dimensions, shape, size, dtype, ndim
2 Array Creation array(), zeros(), ones(), empty(), full(), arange(), linspace()
3 Array Data Types int, float, bool, complex, string, object, astype()
4 Array Indexing Positive indexing, negative indexing, slicing, multidimensional indexing, row/column access, step slicing, assignment
5 Boolean Indexing Boolean arrays, conditions, multiple conditions, where(), nonzero(), filtering, conditional replacement
6 Fancy Indexing Integer indexing, index arrays, row selection, column selection, combined indexing, advanced assignment, copy behavior
7 Array Shape reshape(), shape, resize(), ravel(), flatten(), squeeze(), expand_dims()
8 Array Joining concatenate(), stack(), hstack(), vstack(), dstack(), column_stack(), split()
9 Array Transformation transpose(), T, swapaxes(), moveaxis(), flip(), rot90(), roll()
10 Broadcasting Broadcasting rules, scalar broadcasting, vector broadcasting, matrix broadcasting, incompatible shapes, broadcast_to()
11 Mathematical Operations Addition, subtraction, multiplication, division, power, modulus, absolute values
12 Statistical Operations sum(), mean(), median(), std(), var(), min(), max()
13 Axis Operations axis=0, axis=1, multidimensional axes, aggregation, keepdims, axis debugging
14 Universal Functions sqrt(), exp(), log(), sin(), cos(), round(), floor(), ceil()
15 Aggregation & Searching argmin(), argmax(), unique(), sort(), argsort(), searchsorted(), count_nonzero()
16 Sorting & Selection sort(), argsort(), partition(), argpartition(), top-K selection, ranking
17 Random Numbers default_rng(), random integers, random floats, normal distribution, uniform distribution, random choice
18 Probability Distributions Normal, binomial, Poisson, exponential, uniform, multinomial, sampling
19 Linear Algebra dot(), matmul(), @, matrix multiplication, transpose, inverse, determinant
20 Advanced Linear Algebra Eigenvalues, eigenvectors, norms, rank, solve equations, matrix decomposition
21 Memory & Views Views, copies, shallow copy, deep copy, memory layout, strides, contiguous arrays
22 Vectorization Vectorized operations, loops vs vectorization, ufuncs, broadcasting, bulk operations
23 Missing & Special Values NaN, Inf, isnan(), isinf(), isfinite(), nanmean(), nanmedian()
24 File Operations loadtxt(), savetxt(), genfromtxt(), .npy, .npz, save(), load()
25 Structured Arrays Structured dtype, fields, records, record arrays, field access, sorting, filtering
26 NumPy for Data Science Data preprocessing, normalization, standardization, feature arrays, numerical transformations
27 NumPy for Machine Learning Feature matrix, target vector, train/test arrays, distance calculations, normalization, one-hot representation
28 NumPy for AI Embeddings, cosine similarity, vector operations, batch processing, tensor-like operations, similarity matrices
29 Performance Optimization Vectorization, memory usage, dtype optimization, broadcasting, views, profiling, unnecessary copies
30 Expert Project Data preprocessing, statistical analysis, matrix operations, similarity search, ML preprocessing, end-to-end NumPy project

Interview question

1. What is NumPy and why is it used in Python?
2. What are the main advantages of NumPy over Python lists?
3. What is an ndarray in NumPy?
4. How do you install NumPy?
5. How do you import NumPy in Python?
6. What is the difference between a NumPy array and a Python list?
7. What is vectorization in NumPy?
8. Why are NumPy operations faster than Python loops?
9. What is the shape of a NumPy array?
10. What is ndim in NumPy?
11. What is the size attribute of a NumPy array?
12. What is dtype in NumPy?
13. How do you check the shape, size, and dimensions of an array?
14. How do you create a NumPy array?
15. How do you create an array of zeros?
16. How do you create an array of ones?
17. How do you create an empty NumPy array?
18. How do you create an array filled with a specific value?
19. What is the difference between np.zeros() and np.empty()?
20. How do you create an identity matrix?
21. What is the difference between np.eye() and np.identity()?
22. How do you create a sequence of numbers using NumPy?
23. What is the difference between np.arange() and np.linspace()?
24. How do you create evenly spaced values in NumPy?
25. How do you specify the data type while creating an array?
26. How do you convert a NumPy array to another dtype?
27. What is astype() in NumPy?
28. What happens when NumPy arrays contain mixed data types?
29. What are NumPy scalar types?
30. What is type promotion in NumPy?
31. How do you access elements of a NumPy array?
32. How does negative indexing work in NumPy?
33. How do you slice a one-dimensional NumPy array?
34. How do you slice a two-dimensional NumPy array?
35. How do you select a specific row from a NumPy matrix?
36. How do you select a specific column from a NumPy matrix?
37. How do you select alternate elements from an array?
38. What is boolean indexing in NumPy?
39. How do you filter elements using a condition?
40. How do you filter values greater than a specific number?
41. How do you apply multiple conditions in NumPy?
42. What is fancy indexing in NumPy?
43. What is the difference between slicing and fancy indexing?
44. How do you select multiple rows using NumPy indexing?
45. How do you select multiple columns using NumPy indexing?
46. How do you replace elements based on a condition?
47. What is np.where()?
48. What is np.nonzero()?
49. How do you find the indices of elements satisfying a condition?
50. How do you reverse a NumPy array?
51. What is reshape() in NumPy?
52. What is the difference between reshape() and resize()?
53. What is ravel() in NumPy?
54. What is flatten() in NumPy?
55. What is the difference between ravel() and flatten()?
56. What is squeeze() in NumPy?
57. What is expand_dims()?
58. How do you convert a one-dimensional array into a column vector?
59. How do you convert a one-dimensional array into a row vector?
60. What happens if the dimensions passed to reshape() are incompatible?
61. What is broadcasting in NumPy?
62. What are the rules of NumPy broadcasting?
63. Why is broadcasting useful?
64. What happens when two arrays have incompatible shapes for broadcasting?
65. How does scalar broadcasting work?
66. How does broadcasting work with two-dimensional arrays?
67. What is np.broadcast_to()?
68. What is the difference between broadcasting and copying?
69. How can broadcasting improve performance?
70. Give an example of a broadcasting error.
71. How do you concatenate NumPy arrays?
72. What is np.concatenate()?
73. What is np.stack()?
74. What is the difference between concatenate() and stack()?
75. What is np.vstack()?
76. What is np.hstack()?
77. What is np.dstack()?
78. What is np.column_stack()?
79. How do you split a NumPy array?
80. What is the difference between split(), hsplit(), and vsplit()?
81. How do you transpose a NumPy array?
82. What is the difference between transpose() and .T?
83. What is swapaxes()?
84. What is moveaxis()?
85. What is np.flip()?
86. What is np.rot90()?
87. What is np.roll()?
88. How do you swap rows and columns in NumPy?
89. How do you rotate a matrix using NumPy?
90. How do you reverse rows and columns independently?
91. How do you perform element-wise addition in NumPy?
92. How do you perform element-wise subtraction?
93. How do you perform element-wise multiplication?
94. What is the difference between * and @ in NumPy?
95. How do you perform element-wise division?
96. How do you calculate powers of NumPy arrays?
97. How do you calculate absolute values?
98. How do you calculate square roots using NumPy?
99. How do you calculate exponential values?
100. How do you calculate logarithms using NumPy?
101. What are universal functions (ufuncs) in NumPy?
102. What are the advantages of NumPy ufuncs?
103. What is np.sqrt()?
104. What is np.exp()?
105. What is np.log()?
106. What is np.sin() and np.cos()?
107. What are np.floor() and np.ceil()?
108. What is np.round()?
109. How do you perform element-wise mathematical operations efficiently?
110. How do ufuncs differ from Python functions?
111. How do you calculate the sum of an array?
112. How do you calculate the mean?
113. How do you calculate the median?
114. How do you calculate standard deviation?
115. How do you calculate variance?
116. How do you find minimum and maximum values?
117. What is the axis parameter in NumPy?
118. What does axis=0 mean?
119. What does axis=1 mean?
120. What is keepdims in NumPy aggregation?
121. What is the difference between min() and argmin()?
122. What is the difference between max() and argmax()?
123. How do you find the index of the maximum value?
124. How do you find unique values in an array?
125. What is np.unique()?
126. How do you count non-zero elements?
127. What is np.count_nonzero()?
128. How do you sort a NumPy array?
129. What is np.argsort()?
130. What is the difference between sort() and argsort()?
131. What is np.partition()?
132. What is np.argpartition()?
133. How do you find the top-K values efficiently?
134. What is np.searchsorted()?
135. How do you perform ranking using NumPy?
136. How do you generate random numbers in NumPy?
137. What is np.random.default_rng()?
138. Why is default_rng() preferred for new code?
139. How do you generate random integers?
140. How do you generate random floating-point numbers?
141. How do you generate normally distributed values?
142. How do you generate uniformly distributed values?
143. How do you randomly select elements from an array?
144. What is random seed and why is it important?
145. How do you create reproducible random results?
146. What probability distributions are available in NumPy?
147. How do you generate binomially distributed data?
148. How do you generate Poisson-distributed data?
149. How do you generate exponentially distributed data?
150. How do you generate samples from a normal distribution?
151. What is NumPy linear algebra?
152. What is np.dot()?
153. What is np.matmul()?
154. What is the difference between dot() and matmul()?
155. What is the @ operator in NumPy?
156. How do you calculate the determinant of a matrix?
157. How do you calculate the inverse of a matrix?
158. How do you solve a system of linear equations?
159. How do you calculate matrix rank?
160. What are eigenvalues and eigenvectors in NumPy?
161. What is np.linalg.norm()?
162. What is matrix decomposition?
163. What is singular value decomposition (SVD)?
164. What is QR decomposition?
165. Why is NumPy linear algebra important for machine learning?
166. What is the difference between a view and a copy?
167. How do you create an explicit copy of an array?
168. What is np.copy()?
169. Why can modifying a view modify the original array?
170. How can you determine whether two arrays share memory?
171. What are strides in NumPy?
172. What is memory layout in NumPy?
173. What is C-order memory layout?
174. What is Fortran-order memory layout?
175. Why is memory layout important for performance?
176. How do you handle NaN values in NumPy?
177. What is np.isnan()?
178. What is np.isinf()?
179. What is np.isfinite()?
180. What is the difference between mean() and nanmean()?
181. How do you replace NaN values?
182. How do you identify infinite values?
183. How do you save a NumPy array to a file?
184. What is the .npy format?
185. What is the .npz format?
186. What is the difference between np.save() and np.savetxt()?
187. How do you load a NumPy array from a file?
188. What is np.loadtxt()?
189. What is np.genfromtxt()?
190. When should you use NumPy instead of Pandas?
191. How is NumPy used in machine learning?
192. How is NumPy used for feature preprocessing?
193. How do you normalize data using NumPy?
194. How do you standardize data using NumPy?
195. How do you calculate Euclidean distance using NumPy?
196. How do you calculate cosine similarity using NumPy?
197. How can NumPy be used to process embeddings?
198. How do you optimize NumPy code for large datasets?
199. How do vectorization and broadcasting improve NumPy performance?
200. How would you design an end-to-end NumPy data-processing pipeline?

Related Topics