ValueError: could not broadcast input array from shape (48,1876) into shape (48,)

  python

recently im studying python.

i cant solve this problem. please help me.

when i wrote like below, python shows up error

# common part for first and second codes
mel_data = []
for i in range(0,1000,1):
    npy_data = np.load(f"arena_mel/0/{i}.npy")
    mel_data.append(npy_data)

# error part
mel_npy = np.array(mel_data) 

ValueError: could not broadcast input array from shape (48,1876) into shape (48,)

but when i wrote like below, it success.

list1 = [mel_data[0], mel_data[1], mel_data[2], mel_data[3], mel_data[4]]
list1_np = np.array(list1)
list1_np.shape 

(5, 48, 1876)

what did i wrong?

Source: Python Questions

LEAVE A COMMENT