Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import pandas as pd
- file1_path = '/path/hoge1.csv'
- file2_path = '/path/hoge2.csv'
- file1_csv = pd.read_csv(file1_path, delimiter=',')
- file2_csv = pd.read_csv(file2_path, delimiter=',')
- file_out = '/joined-hoge.csv'
- join_key = 'domain'
- join_type = 'outer'
- with open(file_out, 'w') as output:
- pd.merge(file1_csv, file2_csv, on=join_key, how=join_type).to_csv(output, sep=',', index=False, float_format='%d')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement