(self)
return ai
Provide the Numpy array protocol.
Provide the Numpy array protocol.
Provide the Numpy array protocol .
def array_interface(self):
        """Provide the Numpy array protocol."""
        if sys.byteorder == 'little':
            typestr = '<f8'
        elif sys.byteorder == 'big':
            typestr = '>f8'
        else:
            raise ValueError(
                "Unsupported byteorder: neither little nor big-endian")
        ai = {
            'version': 3,
            'typestr': typestr,
            'data': self.ctypes,
            }
        ai.update({'shape': (len(self), self._ndim)})
        return ai
def array_interface ( self ) : if sys . byteorder == 'little' : typestr = '<f8' elif sys . byteorder == 'big' : typestr = '>f8' else : raise ValueError ( "Unsupported byteorder: neither little nor big-endian" ) ai = { 'version' : 3 , 'typestr' : typestr , 'data' : self . ctypes , } ai . update ( { 'shape' : ( len ( self ) , self . _ndim ) } ) return ai