当前位置: 首页>>代码示例>>Python>>正文


Python data.ArrayMath类代码示例

本文整理汇总了Python中org.meteoinfo.data.ArrayMath的典型用法代码示例。如果您正苦于以下问题:Python ArrayMath类的具体用法?Python ArrayMath怎么用?Python ArrayMath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ArrayMath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __rdiv__

 def __rdiv__(self, other):
     r = None
     if isinstance(other, MIArray):      
         r = MIArray(ArrayMath.div(other.array, self.array))
     else:
         r = MIArray(ArrayMath.div(other, self.array))
     return r
开发者ID:ccnasyq,项目名称:MeteoInfoLab,代码行数:7,代码来源:miarray.py

示例2: __mul__

 def __mul__(self, other):
     r = None
     if isinstance(other, MIArray):      
         r = MIArray(ArrayMath.mul(self.array, other.array))
     else:
         r = MIArray(ArrayMath.mul(self.array, other))
     return r
开发者ID:ccnasyq,项目名称:MeteoInfoLab,代码行数:7,代码来源:miarray.py

示例3: median

    def median(self, axis=None):
        '''
        Compute tha median along the specified axis.

        :param axis: (*int*) Axis along which the standard deviation is computed. 
            The default is to compute the standard deviation of the flattened array.
        
        returns: (*array_like*) Median result
        '''
        if axis is None:
            return ArrayMath.median(self.array)
        else:
            return MIArray(ArrayMath.median(self.array, axis))
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:13,代码来源:miarray.py

示例4: inpolygon

 def inpolygon(self, x, y, polygon):
     if isinstance(polygon, tuple):
         x_p = polygon[0]
         y_p = polygon[1]
         if isinstance(x_p, MIArray):
             x_p = x_p.aslist()
         if isinstance(y_p, MIArray):
             y_p = y_p.aslist()
         return MIArray(ArrayMath.inPolygon(self.array, x.aslist(), y.aslist(), x_p, y_p))
     else:
         if isinstance(polygon, MILayer):
             polygon = polygon.layer
         return MIArray(ArrayMath.inPolygon(self.array, x.aslist(), y.aslist(), polygon))
开发者ID:ccnasyq,项目名称:MeteoInfoLab,代码行数:13,代码来源:miarray.py

示例5: sum

    def sum(self, axis=None):
        '''
        Sum of array elements over a given axis.

        :param axis: (*int*) Axis along which the standard deviation is computed. 
            The default is to compute the standard deviation of the flattened array.
        
        returns: (*array_like*) Sum result
        '''
        if axis is None:
            return ArrayMath.sum(self.array)
        else:
            r = ArrayMath.sum(self.array, axis)
            return MIArray(r)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:14,代码来源:miarray.py

示例6: max

 def max(self, axis=None):
     '''
     Get maximum value along an axis.
     
     :param axis: (*int*) Axis along which the maximum is computed. The default is to 
         compute the maximum of the flattened array.
         
     :returns: Maximum values.
     '''
     if axis is None:
         r = ArrayMath.max(self.array)
         return r
     else:
         r = ArrayMath.max(self.array, axis)
         return MIArray(r)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:15,代码来源:miarray.py

示例7: std

 def std(self, axis=None):
     '''
     Compute the standard deviation along the specified axis.
 
     :param x: (*array_like or list*) Input values.
     :param axis: (*int*) Axis along which the standard deviation is computed. 
         The default is to compute the standard deviation of the flattened array.
     
     returns: (*array_like*) Standart deviation result.
     '''
     if axis is None:
         r = ArrayMath.std(self.array)
         return r
     else:
         r = ArrayMath.std(self.array, axis)
         return MIArray(r)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:16,代码来源:miarray.py

示例8: prod

 def prod(self):
     '''
     Return the product of array elements.
     
     :returns: (*float*) Produce value.
     '''
     return ArrayMath.prodDouble(self.array)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:7,代码来源:miarray.py

示例9: argmax

 def argmax(self, axis=None):
     '''
     Returns the indices of the minimum values along an axis.
     
     :param axis: (*int*) By default, the index is into the flattened array, otherwise 
         along the specified axis.
         
     :returns: Array of indices into the array. It has the same shape as a.shape with the 
         dimension along axis removed.
     '''
     if axis is None:
         r = ArrayMath.argMax(self.array)
         return r
     else:
         r = ArrayMath.argMax(self.array, axis)
         return MIArray(r)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:16,代码来源:miarray.py

示例10: contains_nan

 def contains_nan(self):
     '''
     Check if the array contains nan value.
     
     :returns: (*boolean*) True if contains nan, otherwise return False.
     '''
     return ArrayMath.containsNaN(self.array)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:7,代码来源:miarray.py

示例11: sign

    def sign(self):
        '''
        Returns an element-wise indication of the sign of a number.

        The sign function returns -1 if x < 0, 0 if x==0, 1 if x > 0. nan is returned for nan inputs.
        '''
        return MIArray(ArrayMath.sign(self.array))
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:7,代码来源:miarray.py

示例12: abs

 def abs(self):
     '''
     Calculate the absolute value element-wise.
     
     :returns: An array containing the absolute value of each element in x. 
         For complex input, a + ib, the absolute value is \sqrt{ a^2 + b^2 }.
     '''
     return MIArray(ArrayMath.abs(self.array))
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:8,代码来源:miarray.py

示例13: take

 def take(self, indices):
     '''
     Take elements from an array along an axis.
     
     :param indices: (*array_like*) The indices of the values to extract.
     
     :returns: (*array*) The returned array has the same type as a.
     '''
     ilist = [indices]
     r = ArrayMath.take(self.array, ilist)
     return MIArray(r)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:11,代码来源:miarray.py

示例14: transpose

 def transpose(self):
     '''
     Transpose 2-D array.
     
     :returns: Transposed array.
     '''
     if self.ndim == 1:
         return self[:]
     dim1 = 0
     dim2 = 1
     r = ArrayMath.transpose(self.asarray(), dim1, dim2)
     return MIArray(r)
开发者ID:meteoinfo,项目名称:MeteoInfoLab,代码行数:12,代码来源:miarray.py

示例15: maskout

 def maskout(self, x, y, polygon, fill_value=Double.NaN):
     if isinstance(x, MIArray):
         xl = x.aslist()
     else:
         xl = x
     if isinstance(y, MIArray):
         yl = y.aslist()
     else:
         yl = y
     if isinstance(polygon, MILayer):
         polygon = polygon.layer
     return MIArray(ArrayMath.maskout(self.array, xl, yl, polygon, fill_value))
开发者ID:ccnasyq,项目名称:MeteoInfoLab,代码行数:12,代码来源:miarray.py


注:本文中的org.meteoinfo.data.ArrayMath类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。