<jupyter_start><jupyter_text>load graphml and xlsx data<jupyter_code>import pandas as pd
import sys
from flowmater.graph_util import draw_graph
from flowmater.ExperimentManager import ExperimentManager
#init class
em=ExperimentManager()

#load databases
em.load_experiments("example_database/db1")
em.load_experiments("example_database/db2")

#process
em.classify_experiments()
#show
df=pd.DataFrame.from_dict(em.database).T
df
#show flowcharts
draw_graph(em.graph_list[0])
draw_graph(em.graph_list[2])
#calcualte fingerprint of florcharts
from flowmater.FlowchartFP import FlowchartFP
FFP=FlowchartFP(em.graph_list)
graph_fp_dict={num:FFP(g) for num,g in enumerate(em.graph_list)}
#merge dataframe
fp_df=pd.DataFrame.from_dict(graph_fp_dict).T
fp_df.columns=["FP_"+i for i in FFP.v_to_i.keys()]
merge_df=pd.merge(df,fp_df,left_on="graphID",right_index=True)
merge_df
#simplify database (drop columns of duplicates)
simple_cols=[]
for col in merge_df.columns:
    if len(list(merge_df[col].drop_duplicates()))>1:
        simple_cols.append(col)
        
merge_df[simple_cols]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10822898032200358, 'fraction_numerical': 0.004472271914132379, 'mean_word_length': 7.288888888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '26156', 'license': 'MIT', 'n_tokens_mistral': 422, 'n_tokens_neox': 414, 'n_words': 73, 'path': 'example.ipynb', 'repo_name': 'KanHatakeyama/flowmater', 'size': '1118'}