0

Am I doing an ovious mistake? copyto results in; ValueError: could not broadcast input array from shape (107,77,3) into shape (108,78,3)

a = np.ones((107, 77, 3), np.float)
b = np.zeros((108,78, 3), np.float)
np.copyto( b,a)
jupidu
  • 31
  • 4
  • 1
    The arrays must be the same shape, or at least have [broadcast-compatible dimensions](https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html#general-broadcasting-rules). – MB-F Apr 25 '17 at 14:52
  • well basically I am trying to paste and RGB image to another. one image is smaller than the other. How can I paste the members of smaller array into a larger one? – jupidu Apr 25 '17 at 14:53
  • This just became an altogether different question. [Here is the answer](http://stackoverflow.com/a/7115957/3005167) – MB-F Apr 25 '17 at 14:59
  • Possible duplicate of [How to "embed" a small numpy array into a predefined block of a large numpy array?](http://stackoverflow.com/questions/7115437/how-to-embed-a-small-numpy-array-into-a-predefined-block-of-a-large-numpy-arra) – Toby Speight Apr 25 '17 at 15:29

0 Answers0