Skip to content

Commit

Permalink
🐛 Dictionary keys not changed in all places
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldokun committed Feb 24, 2024
1 parent b407144 commit 48b74cc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions extracao/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,16 @@ def log(self) -> Dict[str, pd.Series]:
def fill_missing_coords(self) -> None:
"""Fill the missing coordinates with the central coordinates of the city from IBGE"""
rows = self.log['empty_coords']
rows &= self.log['city_and_uf_normalized']
rows &= self.log['city_normalized']
self.log.update({'filled_city_coords': rows})
self.df.loc[rows, 'Latitude'] = self.df.loc[rows, 'Latitude_IBGE']
self.df.loc[rows, 'Longitude'] = self.df.loc[rows, 'Longitude_IBGE']

def normalize_location_names(self) -> None:
rows = self.df['Latitude_IBGE'].notna()
rows &= self.df['Longitude_IBGE'].notna()
self.log.update({'city_and_uf_normalized': rows})
self.log.update({'city_normalized': rows})
self.df.loc[rows, 'Município'] = self.df.loc[rows, 'Município_IBGE']
self.df.loc[rows, 'UF'] = self.df.loc[rows, 'UF_IBGE']

def drop_rows_without_location_info(self) -> None:
rows = self.log['both']
Expand Down

0 comments on commit 48b74cc

Please sign in to comment.