O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Strengths of relationships in multiple variables with heatmaps

A heatmap is a graphical representation of data wherein values within a matrix are represented by colors. This is an effective means to show relationships of values that are measured at the intersection of two variables.

A common scenario is to have the values in the matrix normalized to 0.0 through 1.0 and have the intersections between a row and column represent the correlation between the two variables. Values with less correlation (0.0) are the darkest and those with the highest correlation (1.0) are white.

Heatmaps are easily created with pandas and matplotlib using the .imshow() function:

Heatmaps will also be revisited to demonstrate correlations in the next chapter. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required