Skip to content

Commit

Permalink
Fixed tools import line and added 2020-2021 and 2021-2022 seasons (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksebastian17 authored Oct 20, 2022
1 parent fdf3bb8 commit 60a1ef9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Process-Data/Get_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from tqdm import tqdm

from src import tools
from src.Utils.tools import get_json_data, to_data_frame

url = 'https://stats.nba.com/stats/' \
'leaguedashteamstats?Conference=&' \
Expand All @@ -16,9 +16,9 @@
'&SeasonSegment=&SeasonType=Regular+Season&ShotClockRange=&' \
'StarterBench=&TeamID=0&TwoWay=0&VsConference=&VsDivision='

year = [2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020]
year = [2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022]
season = ["2007-08", "2008-09", "2009-10", "2010-11", "2011-12", "2012-13", "2013-14", "2014-15", "2015-16", "2016-17",
"2017-18", "2018-19", "2019-20"]
"2017-18", "2018-19", "2019-20", "2020-2021", "2021-2022"]
month = [10, 11, 12, 1, 2, 3, 4, 5, 6, 7]
days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]
Expand All @@ -35,9 +35,9 @@
end_year_pointer = year[count]
for day1 in tqdm(days):
try:
general_data = tools.get_json_data(
general_data = get_json_data(
url.format(month1, day1, begin_year_pointer, end_year_pointer, season1))
general_df = tools.to_data_frame(general_data)
general_df = to_data_frame(general_data)
general_df['Date'] = str(month1) + '-' + str(day1) + '-' + season1

directory2 = os.fsdecode('../../Team-Data')
Expand Down

0 comments on commit 60a1ef9

Please sign in to comment.