Advertisement
darlac

error

Apr 9th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. KeyError Traceback (most recent call last)
  2. /media/DATA/arxeia/Projects/<ipython-input-14-8cdc9e94ba72> in <module>()
  3. ----> 1 df.sort([0, 1, 3]).reset_index(drop=True).groupby([0, 1, 2]).apply(func)
  4.  
  5. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in apply(self, func, *args, **kwargs)
  6. 320 func = _intercept_function(func)
  7. 321 f = lambda g: func(g, *args, **kwargs)
  8. --> 322 return self._python_apply_general(f)
  9. 323
  10. 324 def _python_apply_general(self, f):
  11.  
  12. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in _python_apply_general(self, f)
  13. 323
  14. 324 def _python_apply_general(self, f):
  15. --> 325 keys, values, mutated = self.grouper.apply(f, self.obj, self.axis)
  16. 326
  17. 327 return self._wrap_applied_output(keys, values,
  18.  
  19. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in apply(self, f, data, axis, keep_internal)
  20. 594 # group might be modified
  21.  
  22. 595 group_axes = _get_axes(group)
  23. --> 596 res = f(group)
  24. 597 if not _is_indexed_like(res, group_axes):
  25. 598 mutated = True
  26.  
  27. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in <lambda>(g)
  28. 319 """
  29. 320 func = _intercept_function(func)
  30. --> 321 f = lambda g: func(g, *args, **kwargs)
  31. 322 return self._python_apply_general(f)
  32. 323
  33.  
  34. /media/DATA/arxeia/Projects/<ipython-input-13-4d16cae39798> in func(df)
  35. 5 s.append(rw[4])
  36. 6 s.append(rw[5])
  37. ----> 7 s.append(rw[6])
  38. 8 s.append(rw[7])
  39. 9 s.append(rw[8])
  40.  
  41. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/series.pyc in __getitem__(self, key)
  42. 501 def __getitem__(self, key):
  43. 502 try:
  44. --> 503 return self.index.get_value(self, key)
  45. 504 except InvalidIndexError:
  46. 505 pass
  47.  
  48. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/index.pyc in get_value(self, series, key)
  49. 724 """
  50. 725 try:
  51. --> 726 return self._engine.get_value(series, key)
  52. 727 except KeyError, e1:
  53. 728 if len(self) > 0 and self.inferred_type == 'integer':
  54.  
  55. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/index.so in pandas.index.IndexEngine.get_value (pandas/index.c:2559)()
  56.  
  57. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/index.so in pandas.index.IndexEngine.get_value (pandas/index.c:2374)()
  58.  
  59. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/index.so in pandas.index.IndexEngine.get_loc (pandas/index.c:3111)()
  60.  
  61. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/hashtable.so in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6427)()
  62.  
  63. /usr/lib64/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/hashtable.so in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6371)()
  64.  
  65. KeyError: 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement