Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Because "part" in your example provides an undefined array. Your Image has the width 1000, but you're indexing 1080 to 1515. There is literatally nothing there to copy. The error message is a bit odd though, I admit.

I tried it out like this:

x = np.zeros((1000,800,3)) y = np.ones((40, 435,3)) x[400:440, 180:180+435] = y

Because "part" in your example provides an undefined array. Your Image has the width 1000, but you're indexing 1080 to 1515. There is literatally nothing there to copy. The error message is a bit odd though, I admit.

I tried it out like this:

x = np.zeros((1000,800,3)) np.zeros((1000,800,3))

y = np.ones((40, 435,3)) 435,3))

x[400:440, 180:180+435] = y