NumPy Practice

Array creation, broadcasting, and vectorized numerical computing.

Problem List

StatusProblemDifficulty
1. Import NumPyEasy
2. NumPy VersionEasy
3. Null Vector of Size 10Easy
4. Memory Size of an ArrayEasy
5. Documentation of np.addEasy
6. Null Vector, Fifth Value 1Easy
7. Range Vector 10–49Easy
8. Reverse a VectorEasy
9. 3×3 Matrix 0–8Easy
10. Indices of Non-Zero ElementsEasy
11. Identity MatrixEasy
12. 3×3×3 Random ArrayEasy
13. Min and MaxEasy
14. Mean ValueEasy
15. 1 on Border, 0 InsideEasy
16. Add a Zero BorderEasy
17. NaN Expression ResultsEasy
18. Values Below the DiagonalEasy
19. Checkerboard PatternEasy
20. Unravel 100th IndexEasy
21. Checkerboard with tile()Easy
22. Normalize a MatrixEasy
23. RGBA dtype SizeEasy
24. Matrix ProductEasy
25. Negate Elements 3–8Easy
26. Builtin sum vs np.sumEasy
27. Which Expressions Are Legal?Easy
28. Results of Edge ExpressionsEasy
29. Round Away From ZeroEasy
30. Common ValuesEasy
31. Ignore NumPy WarningsEasy
32. sqrt(-1) vs emath.sqrt(-1)Easy
33. Yesterday and TomorrowEasy
34. Dates in July 2016Medium
35. Compute ((A+B)*(-A/2))Medium
36. Integer PartMedium
37. Rows Ranging 0–4Medium
38. Build Array from GeneratorEasy
39. Vector 0–1 Both ExcludedMedium
40. Sort a VectorMedium
41. Sum with add.reduceMedium
42. Are Two Arrays Equal?Medium
43. Make an Array Read-OnlyMedium
44. Cartesian to PolarMedium
45. Replace Max with 0Medium
46. Coordinate GridMedium
47. Cauchy Matrix DeterminantMedium
48. Min/Max of int8Medium
49. Full Array as StringMedium
50. Closest Value to a ScalarMedium
51. Position + Color StructMedium
52. Point-by-Point DistancesMedium
53. Float32 to Int32 In PlaceMedium
54. Parse a Messy CSVMedium
55. Enumerate a 2D ArrayMedium
56. 2D Gaussian ArrayMedium
57. Place p Elements RandomlyMedium
58. Subtract Row MeansMedium
59. Sort by nth ColumnMedium
60. Has Null Columns?Medium
61. Nearest ValueMedium
62. Sum via IteratorMedium
63. Array with a NameMedium
64. Add 1 at Indexed PositionsHard
65. Accumulate by Index ListHard
66. Count Unique ColorsMedium
67. Sum Over Last Two AxesHard
68. Means of SubsetsHard
69. Diagonal of a Dot ProductHard
70. Interleave 3 ZerosHard
71. Multiply (5,5,3) by (5,5)Hard
72. Swap Two RowsHard
73. Unique Triangle SegmentsHard
74. Invert a bincountHard
75. Sliding Window AverageHard
76. Rolling Windows (shift by 1)Hard
77. Negate Float Array In PlaceHard
78. Distance Point to LinesHard
79. Distance Points to LinesHard
80. Centered Subpart with FillHard
81. Generate Shifted RowsHard
82. Matrix RankHard
83. Most Frequent ValueMedium
84. All Contiguous 3×3 BlocksHard
85. Make a Matrix SymmetricHard
86. Sum of p Matrix ProductsHard
87. Block-Sum (4×4 blocks)Hard
88. Game of Life StepHard
89. n Largest ValuesHard
90. Cartesian ProductHard
91. Record Array from ArrayHard
92. Cube Each ElementHard
93. Rows Containing Each Row of BHard
94. Rows with Unequal ValuesHard
95. Ints to Binary MatrixHard
96. Extract Unique RowsHard
97. Outer Product with einsumHard
98. Equidistant Path SamplingHard
99. Multinomial RowsHard
100. Bootstrap Confidence IntervalHard
101. Full Array Like a PrototypeEasy
102. Reproducible Random Integers (Generator API)Easy
103. Binomial Draws (Generator API)Medium
104. Save and Load a .npy ArrayEasy
105. Save Multiple Named Arrays with savezMedium
106. Selective CSV ImportMedium
107. Impute Missing Values with the Column MeanMedium
108. Delete Rows and ColumnsEasy
109. Sort Rows by a Given ColumnEasy
110. Locate Elements Matching a ConditionEasy
111. Stack Two Vectors as RowsEasy
112. Concatenate Two Vectors End-to-EndEasy
113. Stack Two Matrices Along a New AxisMedium
114. Count Occurrences of Each Unique ValueEasy
115. Index of First Occurrence of Each Unique ValueEasy
116. Weighted AverageEasy
117. Correlation Matrix Between RowsMedium
118. Histogram Bin CountsEasy
119. Peak-to-Peak Range per RowEasy
120. Strip Prefixes and Map Categories to CodesMedium