Beispiel #1
0
    def properties_for(self, index):
        """
        Returns a list of properties, such that each entry in the list corresponds
        to the element of the index given.

        Example:
        let properties: 'one':[1,2,3,4], 'two':[3,5,6]

        >>> properties_for([2,3,5])
        [['one'], ['one', 'two'], ['two']]
        """
        return vectorize(lambda i: [prop for prop in self.iterproperties() if i in self[prop]], otypes=[list])(index)
Beispiel #2
0
    def properties_for(self, index):
        """
        Returns a list of properties, such that each entry in the list corresponds
        to the element of the index given.

        Example:
        let properties: 'one':[1,2,3,4], 'two':[3,5,6]

        >>> properties_for([2,3,5])
        [['one'], ['one', 'two'], ['two']]
        """
        return vectorize(
            lambda i: [prop for prop in self.properties() if i in self[prop]],
            otypes=[list])(index)
 def __init__(self, **kwargs):
     super(betabinom_gen, self).__init__(**kwargs)
     self._sf = vectorize(self._sf_single, otypes='d')
     self._sf.nin = self.numargs + 1