Skip to content

Commit

Permalink
refact(#3): refactor variable typo
Browse files Browse the repository at this point in the history
  • Loading branch information
fedepacher committed Jun 9, 2023
1 parent 9252c5d commit b1b1cc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def get_count_movies_month(self, month=''):
'noviembre': '11', 'diciembre': '12'}

if month.lower() in valid_months:
condition = self._df_movies['release_date'].dt.strftime('%m') == valid_months.get(month.lower())
variable = valid_months.get(month.lower())
condition = self._df_movies['release_date'].dt.strftime('%m') == variable
return {'month': month, 'amount': self._df_movies[condition]["title"].count()}

return {'message': f'Month not exists: {month}'}
Expand Down Expand Up @@ -85,7 +86,8 @@ def get_votes_title(self, title=''):
df_aux = self._df_movies['title'].str.lower()
index = df_aux[df_aux == title.lower()].index
if len(index.values) > 0:
df_aux = self._df_movies.iloc[index][['title', 'release_year', 'vote_count', 'vote_average']]
df_aux = self._df_movies.iloc[index][['title', 'release_year', 'vote_count',
'vote_average']]
if df_aux["vote_count"].values[0] >= 2000:
return {'title': df_aux["title"].values[0],
'year': df_aux["release_year"].values[0],
Expand Down

0 comments on commit b1b1cc6

Please sign in to comment.