본문 바로가기

Data Science/Data Visualization

[05. Etcetera Chart] 009. Heat Map

728x90

밀도에 따라 색상을 달리하여 시각화한 차트이다.

 

import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np

if __name__ == '__main__':
    df = pd.DataFrame(np.random.random((5,5)), columns=['a', 'b', 'c', 'd', 'e'])
print(df)
    sns.heatmap(df)
    plt.show()


결과 값
       a         b         c         d         e
0  0.087655  0.427545  0.743457  0.864916  0.374516
1  0.235498  0.689074  0.487793  0.522156  0.678673
2  0.084710  0.313334  0.605814  0.955031  0.398501
3  0.684323  0.674611  0.129794  0.618308  0.375868
4  0.389495  0.069244  0.735744  0.866972  0.658019

 

728x90