NumPy - Array ManipulationWhy does NumPy allow one dimension in reshape() to be -1?ATo create an empty dimensionBTo automatically calculate that dimension based on the array sizeCTo reverse the array along that dimensionDTo indicate that dimension should be removedCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand the role of -1 in reshape-1 tells NumPy to infer that dimension size automatically.Step 2: Check other optionsOptions A, B, and C do not describe the behavior of -1 in reshape.Final Answer:To automatically calculate that dimension based on the array size -> Option BQuick Check:-1 in reshape = auto dimension [OK]Quick Trick: Use -1 to let NumPy infer dimension size [OK]Common Mistakes:Thinking -1 removes or reverses dimensionAssuming -1 creates empty dimension
Master "Array Manipulation" in NumPy9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More NumPy Quizzes Aggregation Functions - np.sum() and axis parameter - Quiz 3easy Aggregation Functions - np.argmin() and np.argmax() - Quiz 5medium Aggregation Functions - np.mean() for average - Quiz 6medium Array Data Types - Float types (float16, float32, float64) - Quiz 6medium Array Operations - In-place operations for memory efficiency - Quiz 11easy Broadcasting - Scalar and array broadcasting - Quiz 10hard Creating Arrays - np.random.rand() and random arrays - Quiz 9hard Indexing and Slicing - Why indexing matters - Quiz 4medium NumPy Fundamentals - Array attributes (shape, dtype, ndim, size) - Quiz 12easy NumPy Fundamentals - Contiguous memory layout concept - Quiz 9hard