Correlation coefficient if inputs are the same?

17 Views Asked by At

I'm using Pearson product-moment correlation in Python to calculate how "similar" are the two inputs of the same length. The closer the correlation value to 1.0 the better.

However, when the inputs are completely the same, the above Python function returns "Not A Number". I need something more "user-friendly" than the NaN.

Would it be mathematically justified to say the correlation between those two inputs is -infinite?