Merging: VLOOKUP ของ Python

Python สำหรับผู้ใช้สเปรดชีต

Chris Cardillo

Data Scientist

VLOOKUP

full vlookup.png

Python สำหรับผู้ใช้สเปรดชีต

VLOOKUP - คอลัมน์คีย์

key columns no arrows.png

Python สำหรับผู้ใช้สเปรดชีต

VLOOKUP - Left Join

key columns in vlookup.png

Python สำหรับผู้ใช้สเปรดชีต

VLOOKUP - #N/A

NA lookup.png

Python สำหรับผู้ใช้สเปรดชีต

เมธอด .merge()

fruit color console.png

fruit_colors

fruit prices console.png

fruit_prices

Python สำหรับผู้ใช้สเปรดชีต

เมธอด .merge()

fruit_colors.merge(fruit_prices, on='name', how='left')

ตารางผลลัพธ์การ merge.png

Python สำหรับผู้ใช้สเปรดชีต

คอลัมน์คีย์ที่มีชื่อต่างกัน

fruit color console.png

fruit_colors

price with fruit_type column.png

fruit_prices

Python สำหรับผู้ใช้สเปรดชีต

left_on และ right_on ใน .merge()

fruit_colors.merge(fruit_prices, 
                   left_on='name', 
                   right_on='fruit_type', 
                   how='left')

การเพิ่มคอลัมน์คีย์ที่ต่างกัน.png

Python สำหรับผู้ใช้สเปรดชีต

ถึงตาคุณแล้ว!

Python สำหรับผู้ใช้สเปรดชีต

Preparing Video For Download...