This is the function in question. It calculates the Pearson correlation coefficient for p1 and p2, which is supposed to be a number between -1 and 1.
When I use this
Well it took me a minute to read over the code but it seems if you change your input data to floats it will work