深入 Python

Python 的資料科學入門

Hillary Green-Lerman

Lead Data Scientist, Looker

你將學到什麼

  • 如何在 DataCamp 撰寫並執行 Python 程式碼
  • 如何從試算表載入資料
  • 如何把資料變成漂亮的圖表
Python 的資料科學入門

用資料解開謎團

貝葉斯

勒索字條

Python 的資料科學入門

使用 IPython 互動殼層

console.gif

Python 的資料科學入門

使用指令碼編輯器

script.gif

Python 的資料科學入門

什麼是模組?

  • 將相關工具分組
  • 讓你容易找到特定工具的位置
  • 常見範例:
    • matplotlib
    • pandas
    • scikit-learn
    • scipy
    • nltk
Python 的資料科學入門

匯入 pandas 與 matplotlib

import pandas as pd
from matplotlib import pyplot as plt
# Pandas 載入資料
df = pd.read_csv('ransom.csv')

# Matplotlib 繪圖並顯示
plt.plot(df.letters, df.frequency)
plt.show()

簡單圖

Python 的資料科學入門

匯入模組

  • 匯入模組

    import pandas
    
  • 匯入模組並設定別名

    import pandas as pd
    
Python 的資料科學入門

一起來練習吧!

Python 的資料科學入門

Preparing Video For Download...