This notebook should be used to debug, improve or test the log visualization maker.
In [1]:
%load_ext autoreload
%autoreload 1
In [2]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
pd.options.display.max_rows = 1000
pd.options.display.max_columns = 60
In [3]:
#utils.py is where all our custom functions live is we set an autoreload on it.
%aimport utils
from utils import *
%aimport viz_utils
from viz_utils import *
In [4]:
df_all = pd.read_excel('all data v3.xlsx', 'iLab data.txt', index_col=None, na_values=['NA'])
In [5]:
df_test = prepare_session(df_all,'L-2567b17a:120eda25685:-8000')
df_gaps = prepare_session(df_all,'L-10f11766:120ecd4f63a:-8000')
In [6]:
%aimport viz_utils
plot(df_gaps,to_plot,colors, column_to_use, function_to_use)
In [7]:
%aimport viz_utils
plot(df_test,to_plot,colors, column_to_use, function_to_use)
In [8]:
df_test2 = pd.read_excel('all_method_tester.xlsx', 'Sheet1', index_col=None, na_values=['NA'])
%autoreload
REGEX_SINGLE_VALUE_FIRST = "st\d \d(?:$|(?:\sst)|(?:\s[\-\+x/]\s[A-Z]))"
REGEX_SINGLE_VALUE_SECOND = "st\d [A-Z][\sa-z]+ [\-\+x/] \d(?:$|(?:\s?st))"
def single_value_usage(df):
usage= []
method1 = action_usage(df,'Cleaned method 1',REGEX_SINGLE_VALUE_FIRST)
usage.extend(action_usage(df,'Cleaned method 2',REGEX_SINGLE_VALUE_FIRST))
usage.extend(action_usage(df,'Cleaned method 1',REGEX_SINGLE_VALUE_SECOND))
usage.extend(action_usage(df,'Cleaned method 2',REGEX_SINGLE_VALUE_SECOND))
return clean_coords(usage)
single_value_usage(df_test2)
%aimport viz_utils
plot(df_test2,to_plot,colors, column_to_use, function_to_use)
What works
What doesn't
In [9]:
# #Using the example used for sketch.
# def export_df(df,name):
# select_df = df[["Session Id","Selection","Feedback Text","Cleaned method 1","Cleaned method 2","cases","Time_seconds","Timeshifted","Duration"]]
# writer = pd.ExcelWriter(name+'.xlsx')
# select_df.to_excel(writer,'Sheet1')
# writer.save()
#
# export_df(df_gaps,'gaps')
# export_df(df_test,'test')