<jupyter_start><jupyter_text>data_07 (indicators 02) adjustment  1. Imports<jupyter_code>import pandas as pd
import numpy as np
import os<jupyter_output><empty_output><jupyter_text>2. Load dataframe<jupyter_code>input_path_indicators_2 = os.path.join(os.getcwd(), '..', 'sprint_01_data_collection', 'data_07')
input_file_indicators_2 = 'data_07_brazil_indicators.csv'
df_indicators_2 = pd.read_csv(os.path.join(input_path_indicators_2, input_file_indicators_2)).drop('Unnamed: 0', axis=1)
df_indicators_2.head()<jupyter_output><empty_output><jupyter_text>3. split states from cities<jupyter_code>try:
    df_indicators_2['Municipio'] = df_indicators_2['Territorialidade'].apply(lambda city: city.split('(')[0].rstrip(' '))
    df_indicators_2['Estado'] = df_indicators_2['Territorialidade'].apply(lambda city: city.split('(')[1].replace(')', ''))
    df_indicators_2.drop('Territorialidade', axis=1, inplace=True)

except KeyError:
    print('Territorialidade had already been removed')
    
df_indicators_2.head()<jupyter_output>Territorialidade had already been removed<jupyter_text>4. Save<jupyter_code>output_path = os.path.join(os.getcwd(), 'output')
output_file = 'output_04_data_07_brazil_indicators_02_with_states_and_cities.csv'
df_indicators_2.to_csv(os.path.join(output_path, output_file))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13383458646616542, 'fraction_numerical': 0.02857142857142857, 'mean_word_length': 9.648, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '116621', 'license': 'MIT', 'n_tokens_mistral': 541, 'n_tokens_neox': 523, 'n_words': 62, 'path': 'sprint_03_data_analysis/data_analysis_03_data_07.ipynb', 'repo_name': 'lgdc-ufpa/covid-19-and-malaria', 'size': '1330'}