import numpy as np a = np.load("pitch_aug_dict1.npy", allow_pickle=True).item() b = np.load("pitch_aug_dict2.npy", allow_pickle=True).item() #with open('val_dict2.txt','a') as file0: #print( a ,file=file0) a.update(b) np.save('merge.npy',a)