def __getitem__(self,key):
        """Emulate __getitem__ method"""
        
        try:
            return self.table[key]
        except KeyError,e:
            if type(key)==tuple:
                if len(key)==2:
                    try:
                        rowix=self.rownames.index(key[0])
                        return self.table[key[1]][rowix]
                    except:
                        raise Exception("Reference error")
                elif len(key)==1:
                    try:
                        rowix=self.rownames.index(key[0])
                    except ValueError:
                        raise Exception("No such a row name exists,%s" %key[0])
                    return [self.table[col][rowix] for col in self.colnames]
            else:
                raise KeyError,e
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/DataFrame.__getitem__/original