[SciPy-User] scipy.stats.pearsonr returns exactly 0.0

Warren Weckesser warren.weckesser@gmail....
Mon Feb 4 06:20:46 CST 2013


On 2/4/13, Andreas Hilboll <lists@hilboll.de> wrote:
> Hi,
>
> in a situation where scipy.stats.spearmanr and numpy.corrcoef[0,1]
> return sensible results, scipy.stats.pearsonr returns exactly 0.0.
>
> Are there situations where this is to be expected? I have sanitized my
> input arrays for nans before calling the correlation methods:
>
>     tmpdata1 = data[key1].data[:, x, y]
>     tmpdata2 = data[key2].data[:, x, y]
>     tmpidx = True - (np.isnan(tmpdata1) | np.isnan(tmpdata2))
>     tmpdata1, tmpdata2 = tmpdata1[tmpidx], tmpdata2[tmpidx]
>
> The results I get is:
>
> sp.stats.linregress: 0.09.../.....
> sp.stats.spearmanr:  0.331...
> np.corrcoef:         0.2574...
> sp.stats.pearsonr:   0.0 (exactly)
>
> I'm a bit worried that pearsonr is exactly 0.00. Any ideas?
>


Can you provide your data?

Warren


> Cheers,
> Andreas.
>
> --
> Andreas Hilboll
> PhD Student
>
> Institute of Environmental Physics
> University of Bremen
>
> U3145
> Otto-Hahn-Allee 1
> D-28359 Bremen
> Germany
>
> +49(0)421 218 62133 (phone)
> +49(0)421 218 98 62133 (fax)
> http://www.iup.uni-bremen.de/~hilboll
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list