In [2]:
%load_ext autoreload
%autoreload 2
%matplotlib inline
from join_traces_and_survey import *
In [2]:
d_survey, d_survey_in_el = load_survey_dfs()
print('Num Survey Responses:', d_survey.shape[0])
print('Num Survey Responses in EL:', d_survey_in_el.shape[0])
In [3]:
d_click_traces = pd.DataFrame(json.load(open('../../data/click_traces/rs3v3/join_data.json')))
print('Num Click Traces:', d_click_traces.shape[0])
In [4]:
# merge traces and survey data
df = join_survey_and_traces(d_survey_in_el, d_click_traces)
print('Num Responses with a trace', df.shape[0])
In [5]:
df.to_csv('../../data/responses_with_traces.tsv', sep = '\t', index = False, date_format = '%Y-%m-%d %H:%M:%S')
In [6]:
print(df.shape)
In [12]:
pd.read_csv('../../data/responses_with_traces.tsv', sep = '\t').shape
Out[12]:
In [9]:
d_sample = pd.DataFrame(json.load(open('../../data/click_traces/rs3v3/sample_data.json')))
In [10]:
d_sample.to_csv('../../data/random_trace_sample.tsv', sep = '\t', index = False, date_format = '%Y-%m-%d %H:%M:%S')