Skip to content

Commit 97a1a46

Browse files
committed
fix: problems when opening json file withot UTC-8 format
1 parent 662e98c commit 97a1a46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ def define_cities_of_interest(json_source_file_name):
4343
A dataframe, in long format, that lists all central cities on the first column and their corresponding bordering cities on the second column.
4444
4545
"""
46-
with open(json_source_file_name, 'r') as json_source_file:
46+
with open(json_source_file_name, 'r',encoding='utf-8') as json_source_file:
4747
DICT_OF_CITIES_TO_SEARCH_FOR = json.load(json_source_file)
48-
4948
list_of_city_tuples = []
5049
for central_city, list_of_bordering_cities in DICT_OF_CITIES_TO_SEARCH_FOR.items():
5150
for bordering_city in list_of_bordering_cities:
@@ -165,6 +164,7 @@ def write_city_timeseries_on_xlsxs(df_cities_of_interest, df_nearest_measurement
165164
df_SPEI.columns = [convert_coordinates_to_negative(col) for col in df_SPEI.columns]
166165

167166
df_cities_of_interest = define_cities_of_interest('cidades.json')
167+
print(df_cities_of_interest)
168168

169169
df_cities_coordinates = find_Minas_Gerais_cities_coordinates(df_cities_of_interest, 'CoordenadasMunicipios.xlsx')
170170

0 commit comments

Comments
 (0)