Skip to content

Commit

Permalink
date_parser -> date_format (kyleskom#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkgilley authored Oct 29, 2023
1 parent cd6cb22 commit 2ce22d8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def createTodaysGames(games, df, odds):
away_team_odds.append(input(away_team + ' odds: '))

# calculate days rest for both teams
dateparse = lambda x: datetime.strptime(x, '%d/%m/%Y %H:%M')
schedule_df = pd.read_csv('Data/nba-2023-UTC.csv', parse_dates=['Date'], date_parser=dateparse)
schedule_df = pd.read_csv('Data/nba-2023-UTC.csv', parse_dates=['Date'], date_format='%d/%m/%Y %H:%M')
home_games = schedule_df[(schedule_df['Home Team'] == home_team) | (schedule_df['Away Team'] == home_team)]
away_games = schedule_df[(schedule_df['Home Team'] == away_team) | (schedule_df['Away Team'] == away_team)]
previous_home_games = home_games.loc[schedule_df['Date'] <= datetime.today()].sort_values('Date',ascending=False).head(1)['Date']
Expand Down

0 comments on commit 2ce22d8

Please sign in to comment.