'How can i blur a MNIST dataset using opencv?

can anyone help me figure out how to apply blur to a set on the NumPy array?

I ran this and it worked on a selected array from the 60,000 arrays in the object X_train

blurimage = cv2.blur(X_train[5555], (5, 5))

...but I tried running all using a loop but I kept getting a syntax error

blurloop = cv2.blur(for x in range(X_train[0], X_train[60000]), (5, 5))

Pls, what is the best way to process all the images (numpyarray) once so i can feed it into my CNN model



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source