The error message of "ValueError: Length of passed values is 20, index implies 1" most likely comes from comparing a numpy array to a pandas series. Fix: Make both variables the same data type, so they are both a numpy array or they are both a pandas series.
Steps to reproduce:
import numpy as np
import pandas as pd
x = np.array([1, 2, 3, 4, 5])
y = pd.Series([2])
x - y