<jupyter_start><jupyter_text>Load and merge logs<jupyter_code>bpi_path = '../data/bpi-challenge-2014/' 

df_interaction = pd.read_csv(bpi_path + 'Detail_Interaction.csv', sep=';', low_memory=False)
df_incident_activity = pd.read_csv(bpi_path + 'Detail_Incident_Activity.csv', sep=';', low_memory=False)
df_incident = pd.read_csv(bpi_path + 'Detail_Incident.csv', sep=';', low_memory=False)

# cleaning bad reading
df_incident = df_incident.dropna(axis=0, how='all')
df_incident = df_incident.dropna(axis=1, how='all')
df = df_incident.merge(df_incident_activity, how='left', left_on='Incident ID', right_on='Incident ID')
columns = ['Incident ID', 'IncidentActivity_Type', 'DateStamp', 'Assignment Group']
rename_columns = {
    'Incident ID':'case_id',
    'IncidentActivity_Type':'activity',
    'DateStamp':'timestamp',
    'Assignment Group':'resource'
}
df = df[columns].rename(columns=rename_columns)
destiny_path = '../data/bpi-incident-process/incident-process.csv'
df.to_csv(destiny_path, index=False)<jupyter_output><empty_output><jupyter_text>Checking dataframe<jupyter_code>df = pd.read_csv(destiny_path, low_memory=False)
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15252784918594686, 'fraction_numerical': 0.005141388174807198, 'mean_word_length': 8.344, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '474530', 'license': 'MIT', 'n_tokens_mistral': 448, 'n_tokens_neox': 433, 'n_words': 60, 'path': 'notebooks/0-fpn-exploratory-analysis.ipynb', 'repo_name': 'francnascimento/usp-processing-mining', 'size': '1167'}