使用 Matplotlib 畫基本圖表

Python 中級

Hugo Bowne-Anderson

Data Scientist at DataCamp

使用 Matplotlib 畫基本圖表

  • 視覺化

長條圖圖示

  • 資料結構

程式碼圖示

  • 控制結構

  • 案例研究

Python 中級

資料視覺化

  • 資料分析中很重要

    • 探索資料
    • 彙整洞見

Python 中級

1 來源:GapMinder,Wealth and Health of Nations
Python 中級

1 來源:GapMinder,Wealth and Health of Nations
Python 中級

1 來源:GapMinder,Wealth and Health of Nations
Python 中級

Matplotlib

import matplotlib.pyplot as plt

year = [1950, 1970, 1990, 2010]
pop = [2.519, 3.692, 5.263, 6.972]
plt.plot(year, pop)
plt.show()

Python 中級

Matplotlib

Python 中級

Matplotlib

Python 中級

散佈圖

import matplotlib.pyplot as plt
year = [1950, 1970, 1990, 2010]
pop = [2.519, 3.692, 5.263, 6.972]
plt.plot(year, pop)
plt.show()
Python 中級

散佈圖

import matplotlib.pyplot as plt
year = [1950, 1970, 1990, 2010]
pop = [2.519, 3.692, 5.263, 6.972]
plt.scatter(year, pop)
plt.show()

Python 中級

一起來練習吧!

Python 中級

Preparing Video For Download...