Bird
0
0

Identify the error in this code:

medium📝 Debug Q7 of 15
SciPy - Image Processing (scipy.ndimage)
Identify the error in this code:
zoomed_img = scipy.ndimage.zoom(img, zoom=0)
AZoom factor must be negative
Bzoom parameter should be a string
Cimg must be a list, not an array
DZoom factor cannot be zero
Step-by-Step Solution
Solution:
  1. Step 1: Understand zoom factor constraints

    Zoom factor must be positive and non-zero to scale the image.
  2. Step 2: Analyze given zoom=0

    Zoom factor zero means no size, which is invalid and causes error.
  3. Final Answer:

    Zoom factor cannot be zero -> Option D
  4. Quick Check:

    Zoom factor > 0 required [OK]
Quick Trick: Zoom factor must be positive and non-zero [OK]
Common Mistakes:
  • Using zero or negative zoom
  • Wrong data type for image
  • Passing string as zoom

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes