wesm/pandas — Issue #544: DOC basics: last ipython code example broke
Author: twiecki
Created: 2011-12-26 10:38:44+00:00
State: open

Under Console Output Formatting:

In [134]: set_eng_float_format(precision=3, use_eng_prefix=True)

In [135]: df[0]/1.e3
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/home/wesm/code/pandas/doc/ in ()
----> 1 df[0]/1.e3
/home/wesm/code/pandas/pandas/core/frame.pyc in __getitem__(self, key)
1055 return self._getitem_multilevel(key)
1056 else:
-> 1057 return self._get_item_cache(key)
1058
1059 def _getitem_array(self, key):
/home/wesm/code/pandas/pandas/core/generic.pyc in _get_item_cache(self, item)
280 return cache[item]
281 except Exception:
--> 282 values = self._data.get(item)
283 res = self._box_item_values(item, values)
284 cache[item] = res
/home/wesm/code/pandas/pandas/core/internals.pyc in get(self, item)
557
558 def get(self, item):
--> 559 _, block = self._find_block(item)
560 return block.get(item)
561
/home/wesm/code/pandas/pandas/core/internals.pyc in _find_block(self, item)
633
634 def _find_block(self, item):
--> 635 self._check_have(item)
636 for i, block in enumerate(self.blocks):
637 if item in block:
/home/wesm/code/pandas/pandas/core/internals.pyc in _check_have(self, item)
640 def _check_have(self, item):
641 if item not in self.items:
--> 642 raise KeyError('no item named %s' % str(item))
643
644 def reindex_axis(self, new_axis, method=None, axis=0):
KeyError: 'no item named 0'

In [136]: df[0]/1.e6
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/home/wesm/code/pandas/doc/ in ()
----> 1 df[0]/1.e6
/home/wesm/code/pandas/pandas/core/frame.pyc in __getitem__(self, key)
1055 return self._getitem_multilevel(key)
1056 else:
-> 1057 return self._get_item_cache(key)
1058
1059 def _getitem_array(self, key):
/home/wesm/code/pandas/pandas/core/generic.pyc in _get_item_cache(self, item)
280 return cache[item]
281 except Exception:
--> 282 values = self._data.get(item)
283 res = self._box_item_values(item, values)
284 cache[item] = res
/home/wesm/code/pandas/pandas/core/internals.pyc in get(self, item)
557
558 def get(self, item):
--> 559 _, block = self._find_block(item)
560 return block.get(item)
561
/home/wesm/code/pandas/pandas/core/internals.pyc in _find_block(self, item)
633
634 def _find_block(self, item):
--> 635 self._check_have(item)
636 for i, block in enumerate(self.blocks):
637 if item in block:
/home/wesm/code/pandas/pandas/core/internals.pyc in _check_have(self, item)
640 def _check_have(self, item):
641 if item not in self.items:
--> 642 raise KeyError('no item named %s' % str(item))
643
644 def reindex_axis(self, new_axis, method=None, axis=0):
KeyError: 'no item named 0'