NumPy - FundamentalsWhich NumPy function creates an array filled with zeros of a given shape?Anp.zeros()Bnp.ones()Cnp.empty()Dnp.full()Check Answer
Step-by-Step SolutionSolution:Step 1: Recall functions for array creationnp.zeros() creates an array filled with zeros.Step 2: Differentiate from other functionsnp.ones() creates ones, np.empty() creates uninitialized values, np.full() fills with a specified value.Final Answer:np.zeros() -> Option AQuick Check:Zeros array function = A [OK]Quick Trick: Zeros array uses np.zeros(shape) [OK]Common Mistakes:Confusing np.ones() with np.zeros()Using np.empty() expecting zerosThinking np.full() defaults to zeros
Master "Fundamentals" in NumPy9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More NumPy Quizzes Aggregation Functions - np.sum() and axis parameter - Quiz 2easy Array Data Types - Type casting with astype() - Quiz 5medium Array Manipulation - np.expand_dims() and np.squeeze() - Quiz 4medium Array Operations - Logical operations (and, or, not) - Quiz 14medium Array Operations - Universal functions (ufuncs) - Quiz 9hard Broadcasting - 1D and 2D broadcasting - Quiz 5medium Broadcasting - Common broadcasting patterns - Quiz 13medium Creating Arrays - np.array() from Python lists - Quiz 8hard Indexing and Slicing - Slicing rows and columns - Quiz 6medium Indexing and Slicing - Indexing returns views not copies - Quiz 9hard