Skip to content

Commit

Permalink
Call city names function
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePabloGFnl committed Aug 26, 2024
1 parent 6a7b5ba commit 1e236b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ class Cities:
def __init__(self, grouped_df):
self.grouped_df = grouped_df

def get_city_data(self, city_name):
if city_name not in self.grouped_df["City"].unique():
raise ValueError(f"City '{city_name}' not found in the dataset.")
city_df = self.grouped_df[self.grouped_df["City"] == city_name]
city_df = city_df.drop(["City"], axis=1)
return city_df


def apodaca(self):
df_apodaca = self.grouped_df[self.grouped_df["City"] == "Apodaca"]
df_apodaca = df_apodaca.drop(["City"], axis=1)
Expand Down

0 comments on commit 1e236b2

Please sign in to comment.