Skip to content

Instantly share code, notes, and snippets.

@springcoil
Created April 29, 2013 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save springcoil/5480336 to your computer and use it in GitHub Desktop.
Save springcoil/5480336 to your computer and use it in GitHub Desktop.
Python Traceback error, from Ipython code. Basically I attempted to replicate by writing myself the Sean J.Taylor code.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-34-180a07193cfb> in <module>()
21 for eval_name, evaluation in evaluations.iteritems():
22 for year in range(2002, 2013):
---> 23 metric = evaluation(ranker, year)
24 results.append({
25 'rank': name,
<ipython-input-34-180a07193cfb> in <lambda>(rank, year)
14 'predict_postseason': eval_postseason_prediction,
15 'espn_similarity8': lambda rank, year: eval_espn_similarity(rank, year, 8),
---> 16 'espn_similarity17': lambda rank, year: eval_espn_similarity(rank, year, 17)
17 }
18
<ipython-input-28-427ec555c118> in eval_espn_similarity(rank_func, year, week)
16 week8 = games[(games['SEAS'] == year)*(games['WEEK'] <= week)]
17 ours = rank_to_vector(rank_func(week8))
---> 18 theirs = rank_to_vector(espn_rankings[str(year)][str(week+1)])
19
20 return sps.kendalltau(ours, theirs)[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment