def selection(self):
        blocks = []
        for (t, l), (b, r) in zip(
            self.table._widget.GetSelectionBlockTopLeft(), self.table._widget.GetSelectionBlockBottomRight()
        ):
            blocks.append(array([self.worksheet.columns[col][t : b + 1] for col in range(l, r + 1)]))

        for (r, c) in self.table._widget.GetSelectedCells():
            blocks.append(array([[self.worksheet.columns[c][r]]]))

        return blocks
 def __call__(self, arg):
     try:
         return self.function(arg, *self.parameters)
     except (ValueError, OverflowError):
         if hasattr(arg, '__len__'):
             return array([nan]*len(arg))
         else:
             return nan
 def get_array(self):
     return array(self.columns)
 def get_selection(self):
     sel = self.table.selection(0)
     t, b, l, r = sel.topRow(), sel.bottomRow(), sel.leftCol(), sel.rightCol()
     a = array([self.worksheet[c][t:b+1] for c in range(l, r+1)])
     return a