# -*- coding: utf-8 -*-
# @Author: Aliaksei Halachkin
# @Date:   2017-02-24 19:59:00
# @Last Modified by:   Aliaksei Halachkin
# @Last Modified time: 2017-02-28 16:52:15



import pandas as pd



train_test_sets = "..//..//training_data//trainset_v3_testset.csv"
train_set = "..//..//training_data//trainset_v3_with_attributes_and_profile_clusters.csv"


if __name__ == "__main__":
    df_train_test = pd.read_csv(train_test_sets, sep=';')
    df_train = pd.read_csv(train_set, sep=';')

    train_test_filenames = df_train_test.iloc[:, 0].tolist()
    train_filenames = df_train.iloc[:, 0].tolist()
    test_filenames = list(set(train_test_filenames).difference(train_filenames))
    class_names = []
    for filename in test_filenames:
    	class_names.append( df_train_test[df_train_test.iloc[:,0] == filename].class_name.values[0])


    df_test = pd.DataFrame(data=zip(test_filenames, class_names))
    df_test.columns = ["filename without extension {.csv .frq .jpg.}","class_name"]
    df_test.to_csv("..//..//training_data//test_set.csv", sep=';', index=False)



