ValueError: not enough values to unpack (expected 2, got 1

Hi there,

I am using following section of the section,but it seems I am having incorrect dimension , I am expecting 1080, 1920 dim instead I am getting following output which is unexpected.

np.shape(r1x)

(1080,)

np.shape(c1x)

(1920,)

u_i = currframe[np.shape(r1x), np.shape(c1x)]

# u_i = currframe[r1x,c1x] right way to implement code, but there’s a syntax error
# IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (1080,) (1920,)

array([87], dtype=uint8)

Hi the problem lies in what you are trying to unpack…
from the error its like its expecting a 2D array but its getting a 1D array
a simple demo is…

players = ('messi', 'cristiano')

player_1 , player_2 = ('messi', 'cristiano')

print(player_1)
print(players[1])

in the 2nd scenario which is what you are kind of experiencing

player_1 , player_2 , player_3 = ('messi', 'cristiano')

if i was to print print(player_3) I’ll get ValueError: not enough values to unpack (expected 3, got 2)

Then if you demo the correct method to make the necessary change, I 'II be pleased.
Thank you!