Cleaned up the math and syntax in pearsonr

Changed map and imap calls to generator comprehensions
Replaced `if den == 0:` with a try/except block
Changed some of the parenthesis for clarity