basketball_reference icon indicating copy to clipboard operation
basketball_reference copied to clipboard

IndexError w/ current season

Open dlman opened this issue 7 years ago • 3 comments

When trying to run with the current season:

Traceback (most recent call last):
  File "match_generator.py", line 31, in <module>
    main(args.league, args.seasons)
  File "match_generator.py", line 22, in main
    b_ref.crawl_season()
  File "/Users/dl/nba/basketball_reference/base.py", line 333, in crawl_season
    self._gen_matches_codes()
  File "/Users/dl/nba/basketball_reference/nba.py", line 120, in _gen_matches_codes
    self._gen_month_codes(url)
  File "/Users/dl/nba/basketball_reference/nba.py", line 129, in _gen_month_codes
    reg_season, post_season = seasons[0], None
IndexError: list index out of range

dlman avatar May 18 '17 00:05 dlman

I'm encountering the same issue for this season. Did you ever identify/resolve the issue?

wildbill9188 avatar Jan 05 '18 16:01 wildbill9188

Was there ever any resolution for this problem?

Cavalic avatar Feb 20 '18 23:02 Cavalic

Similar to the issue raised w the 2011-2012 lockout season, you need to change the months in the nba.py file (line 117) to reflect those in which games have actually been played this season. My method at least

wildbill9188 avatar Feb 21 '18 03:02 wildbill9188