nflverse / nfl_data_py

Python code for working with NFL play by play data.
MIT License
283 stars 53 forks source link

[BUG] Missing data from 2024 schedule #103

Closed slot721 closed 2 months ago

slot721 commented 2 months ago

Is there an existing issue for this?

Have you installed the latest development version of the package(s) in question?

If this is a data issue, have you tried clearing your nflverse cache?

I have cleared my nflverse cache and the issue persists.

What version of the package do you have?

0.3.2

Describe the bug

The code sample below extracts Week 2 and Week 3 fixtures in 2024.

output is attached nfl_week_2_week_3

there is an NFL game on 17 Sept: ATL vs PHI which is not in the data set And I think there might be more in future weeks.

Will this be resolved?

Thanks :)

Reprex

`import nfl_data_py as nfl
import pandas as pd
from datetime import datetime, timedelta

# Import the schedule for the 2024 season
schedule = nfl.import_schedules([2024])

# Display all unique weeks in the schedule
print("Unique weeks in the schedule:")
print(schedule['week'].unique())

# Display all unique game days in Week 2 and Week 3
print("\nUnique game days in Week 2:")
print(schedule[schedule['week'] == 2]['gameday'].unique())
print("\nUnique game days in Week 3:")
print(schedule[schedule['week'] == 3]['gameday'].unique())

# Find the date range for Week 2
week_2_start = schedule[schedule['week'] == 2]['gameday'].min()
week_2_end = schedule[schedule['week'] == 2]['gameday'].max()

print(f"\nWeek 2 date range: {week_2_start} to {week_2_end}")

# Display all games within this date range
week_2_games = schedule[
    (schedule['gameday'] >= week_2_start) & 
    (schedule['gameday'] <= week_2_end)
]

print("\nAll games within Week 2 date range:")
columns_to_display = ['week', 'gameday', 'gametime', 'away_team', 'home_team', 'stadium']
print(week_2_games[columns_to_display].sort_values(['gameday', 'gametime']).to_string(index=False))

# Check for any Tuesday games in the entire schedule
tuesday_games = schedule[schedule['gameday'].dt.dayofweek == 1]  # 1 represents Tuesday
print("\nAll Tuesday games in the schedule:")
print(tuesday_games[columns_to_display].to_string(index=False))
`

Expected Behavior

I expect a game id row to be returned

nflverse_sitrep

NA

Screenshots

No response

Additional context

No response

tanho63 commented 2 months ago

Atlanta Falcons vs Philadelphia Eagles is being played on Monday Sep 16 and is represented as the last game in week 2 in your screenshot. https://www.nfl.com/games/falcons-at-eagles-2024-reg-2

slot721 commented 2 months ago

damn! I am an idiot. thank you!

slot721 commented 2 months ago

it was timezone problem for me. Being in EU the game was expected on 17th not 16. Im sorry to waste your time

mrcaseb commented 2 months ago

Timezone strike again haha. You are probably better off working with game ids instead of dates.