If beta0 is a list instead of an array, I get an error message AttributeError: 'list' object has no attribute 'ndim'
If weight_x is a Pandas series instead of an array, I get an error message TypeError:`weight_x` must be a float or an array.
Both of these are array-like and should be converted to an array beforehand.