N = len(datay)
parseval_1 = np.sum(datay ** 2)
parseval_2_1 = np.sum(np.abs(fouriery_1) ** 2) / N
parseval_2_2 = np.sum(np.abs(fouriery_2) ** 2) / N
print(parseval_1 - parseval_2_1)
print(parseval_1 - parseval_2_2)
Parseval's theorem in Python