basketball_reference icon indicating copy to clipboard operation
basketball_reference copied to clipboard

Error for season 2011-2012

Open nicofisch5 opened this issue 7 years ago • 1 comments

Hi Francisco,

When I launch the following command: python match_generator.py --league nba --seasons 2011-2012

I get the following error:

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 "/var/www/basketball_reference/base.py", line 332, in crawl_season
    self._gen_matches_codes()
  File "/var/www/basketball_reference/nba.py", line 120, in _gen_matches_codes
    self._gen_month_codes(url)
  File "/var/www/basketball_reference/nba.py", line 129, in _gen_month_codes
    reg_season, post_season = seasons[0], None
IndexError: list index out of range

I guess it is because of the lockout.

Thanks for your work. Nicolas

nicofisch5 avatar Sep 28 '17 09:09 nicofisch5

Just change the months in the nab.py file (line 117) to reflect those in which games were actually played. This is probably causing the current-season issue someone else raised.

wildbill9188 avatar Jan 09 '18 00:01 wildbill9188