Requête avancée : exploitation des relations entre les tables

Introduction à l'importation de données en Python

Hugo Bowne-Anderson

Data Scientist at DataCamp

Les tables sont liées

ch_3_5.003.png

Introduction à l'importation de données en Python

Les tables sont liées

ch_3_5.004.png

Introduction à l'importation de données en Python

Les tables sont liées

ch_3_5.005.png

Introduction à l'importation de données en Python

Joindre des tables avec JOIN

ch_3_5.007.png

Introduction à l'importation de données en Python

Joindre des tables avec JOIN

ch_3_5.008.png

Introduction à l'importation de données en Python

Joindre des tables avec JOIN

ch_3_5.009.png

Introduction à l'importation de données en Python

Joindre des tables avec JOIN

ch_3_5.010.png

Introduction à l'importation de données en Python

Joindre des tables avec JOIN

ch_3_5.011.png

Introduction à l'importation de données en Python

INNER JOIN en Python (pandas)

from sqlalchemy import create_engine
import pandas as pd
engine = create_engine('sqlite:///Northwind.sqlite')
df = pd.read_sql_query("SELECT OrderID, CompanyName FROM Orders 
INNER JOIN Customers on Orders.CustomerID = Customers.CustomerID", engine)
print(df.head())
   OrderID                CompanyName
0    10248  Vins et alcools Chevalier
1    10251       Victuailles en stock
2    10254          Chop-suey Chinese
3    10256     Wellington Importadora
4    10258               Ernst Handel
Introduction à l'importation de données en Python

Passons à la pratique !

Introduction à l'importation de données en Python

Preparing Video For Download...