在 Python 建立資料庫引擎

Python 資料匯入入門

Hugo Bowne-Anderson

Data Scientist at DataCamp

建立資料庫引擎

  • SQLite 資料庫
    • 快速且簡單
  • SQLAlchemy
    • 可搭配多種關聯式資料庫管理系統
from sqlalchemy import create_engine
engine = create_engine('sqlite:///Northwind.sqlite')
Python 資料匯入入門

取得資料表名稱

from sqlalchemy import create_engine
engine = create_engine('sqlite:///Northwind.sqlite')
table_names = engine.table_names()
print(table_names)
['Categories', 'Customers', 'EmployeeTerritories',
'Employees', 'Order Details', 'Orders', 'Products',
'Region', 'Shippers', 'Suppliers', 'Territories']
Python 資料匯入入門

一起來練習吧!

Python 資料匯入入門

Preparing Video For Download...