# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3.8.12 ('kaggle')
#     language: python
#     name: python3
# ---

import os
import pandas
import gc
import tqdm
import numpy
import time

root = '../resource/csv/'
class table:
    
    start = time.time()
    transaction = pandas.read_csv(os.path.join(root, "transactions_train.csv"), dtype={'article_id':str})
    submission = pandas.read_csv(os.path.join(root, "sample_submission.csv"))
    article = pandas.read_csv(os.path.join(root, "articles.csv"))
    customer = pandas.read_csv(os.path.join(root, "customers.csv"))
    end = time.time()
    print('elapsed {} time'.format(end-start))
    pass



print('unique {} [customer_id] in transaction table'.format(table.transaction['customer_id'].nunique()))

len(set.difference(set(table.submission['customer_id']), set(table.transaction['customer_id'])))

len(set.difference(set(table.transaction['customer_id']), set(table.submission['customer_id'])))

intersection = set.intersection(set(table.submission['customer_id']), set(table.transaction['customer_id']))
len(intersection)

table.transaction.loc[[i in intersection for i in table.transaction['customer_id']]]

StarcoderdataJupyterScriptsDedupFiltered