Data Heatmap

[1]:
import pandas as pd
from data_describe import data_heatmap
[2]:
from sklearn.datasets import load_wine
data = load_wine()
df = pd.DataFrame(data.data, columns=list(data.feature_names))
df['target'] = data.target

Basic heatmap

[3]:
data_heatmap(df)
<AxesSubplot:title={'center':'Data Heatmap'}, xlabel='Record #', ylabel='Variable'>
[3]:
Heatmap Widget showing standardized values.
../_images/examples_data_heatmap_4_2.svg

Missing values only

[4]:
# Create missing values
df['hue'] = df['hue'].map(lambda x: None if x < 1.05 else x)
df['magnesium'] = df['magnesium'].map(lambda x: None if x%2 ==0 else x)
[5]:
data_heatmap(df, missing=True)
&lt;AxesSubplot:title={&#39;center&#39;:&#39;Data Heatmap&#39;}, xlabel=&#39;Record #&#39;, ylabel=&#39;Variable&#39;&gt;
[5]:
Heatmap Widget showing missing values.
../_images/examples_data_heatmap_7_2.svg

Interactive (Plotly)

[6]:
data_heatmap(df, viz_backend="plotly")
&lt;AxesSubplot:title={&#39;center&#39;:&#39;Data Heatmap&#39;}, xlabel=&#39;Record #&#39;, ylabel=&#39;Variable&#39;&gt;
[6]:
Heatmap Widget showing standardized values.
../_images/examples_data_heatmap_9_2.svg
[7]:
data_heatmap(df, viz_backend="plotly", missing=True)
&lt;AxesSubplot:title={&#39;center&#39;:&#39;Data Heatmap&#39;}, xlabel=&#39;Record #&#39;, ylabel=&#39;Variable&#39;&gt;
[7]:
Heatmap Widget showing missing values.
../_images/examples_data_heatmap_10_2.svg