text_plain_output_1.png
from collections import OrderedDict

import csv

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import csv
from collections import OrderedDict
import pandas as pd
with open('../input/documents_meta.csv', 'r') as f:
    r = csv.reader(f)
    dict2 = {row[0]: row[1:] for row in r}
with open('../input/promoted_content.csv', 'r') as f:
    r = csv.reader(f)
    dict1 = OrderedDict(((row[0], row[1:]) for row in r))
result = OrderedDict()
for d in (dict1, dict2):
    for key, value in d.items():
        result.setdefault(key, []).extend(value)
with open('ab_combined.csv', 'w') as f:
    w = csv.writer(f)
    for key, value in result.items():
        w.writerow([key] + value)
data = pd.read_csv('ab_combined.csv', low_memory=False)
data['ad_id']