2.1.5.Python for Data Visual Visualization - Pandas Built-in Data Visualization

1.使用library
import numpy as np
import pandas as pd將matplotlib的圖表直接嵌入到Notebook之中
2.資料判讀與讀取
讀取資料格式 (df1)
由於df1的資料有時間這個索引值, 因此必須指定index為0

讀取資料

讀取資料格式 (df2)
由於此資料沒有索引值, 不需指定index

讀取資料

3.Setting before plot
一般會配合Matplotlib一起使用
設定圖的大小
4.Histogram plot
將df1的資料畫成長條圖

也可以用

可以搭配filter使用, 例如
用hist比較不同性質的資料

5.Area plot
alpha為透明度參數

6.Line plot
基本用法

6.Bar plot
基本用法

stacked

7.Scatter plot
基本用法

將原始資料作為色調值的來源

將原始資料作為尺度的來源

8.Box plot
基本用法, 關於boxplot的定義可以參考此篇筆記

將兩資料的box plot畫在一起

9.Density plot
基本用法

改變線條的style (width, size)

10.Hexbin plot
基本用法

Last updated
Was this helpful?