---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-40-45b2189a6a0b> in <module>()
----> 1 dataset.groupby(['vIDa']).apply(toeach_category)
C:\Anaconda2\lib\site-packages\pandas\core\groupby.pyc in apply(self, func, *args, **kwargs)
713 # ignore SettingWithCopy here in case the user mutates
714 with option_context('mode.chained_assignment',None):
--> 715 return self._python_apply_general(f)
716
717 def _python_apply_general(self, f):
C:\Anaconda2\lib\site-packages\pandas\core\groupby.pyc in _python_apply_general(self, f)
717 def _python_apply_general(self, f):
718 keys, values, mutated = self.grouper.apply(f, self._selected_obj,
--> 719 self.axis)
720
721 return self._wrap_applied_output(keys, values,
C:\Anaconda2\lib\site-packages\pandas\core\groupby.pyc in apply(self, f, data, axis)
1404 # group might be modified
1405 group_axes = _get_axes(group)
-> 1406 res = f(group)
1407 if not _is_indexed_like(res, group_axes):
1408 mutated = True
C:\Anaconda2\lib\site-packages\pandas\core\groupby.pyc in f(g)
709 @wraps(func)
710 def f(g):
--> 711 return func(g, *args, **kwargs)
712
713 # ignore SettingWithCopy here in case the user mutates
<ipython-input-37-3096143b616e> in toeach_category(subf)
1 def toeach_category(subf):
----> 2 result = subf[['Timestamp']].applymap(percentage)
NameError: global name 'percentage' is not defined