Python pandas returns empty correlation matrix

As Jeff mentioned in the comments, the problem resulted from my columns having the object dtype. For future reference, even if the object looks numeric, check the dtype and make sure it is numeric (e.g. do foo.astype(float)) before computing the correlation matrix.

Leave a Comment