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


Python MA.isMaskedArray方法代码示例

本文整理汇总了Python中MA.isMaskedArray方法的典型用法代码示例。如果您正苦于以下问题:Python MA.isMaskedArray方法的具体用法?Python MA.isMaskedArray怎么用?Python MA.isMaskedArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MA的用法示例。


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

示例1: get_store_chain

# 需要导入模块: import MA [as 别名]
# 或者: from MA import isMaskedArray [as 别名]
 def get_store_chain(self, data, mask=None):
     """
     Return a chain of generators for processing the src data,
     which can either be a list or an iterable.
     """
     multisourcecols = self.multisourcecols or self.heterosourcecols
     if multisourcecols:
         src = self._multisrc_gen(multisourcecols)
     else:
         src = iter(data)
     if MA.isMaskedArray(data) and mask is None:
         mask = data.mask()
     if mask is not None:
         src = self._mask_gen(src, mask)
     if self.is_multivalue():
         src = self._tuple_gen(src, self.ignorenone)
         if self.missingvalues:
             src = self._tuplemissing_gen(src, self.missingvalues)
     else:
         if self.calculatedby:
             src = self._calcby_gen(src, self.calculatedby, 
                                         self.calculatedargs)
         if self.missingvalues:
             src = self._missing_gen(src, self.missingvalues)
     src = self._storedata_gen(src)
     return src
开发者ID:timchurches,项目名称:NetEpi-Analysis,代码行数:28,代码来源:base.py

示例2: __setitem__

# 需要导入模块: import MA [as 别名]
# 或者: from MA import isMaskedArray [as 别名]
 def __setitem__(self, key, a):
     index = self.dict.get(key)
     if index is None:
         if MA.isMaskedArray(a):
             index = self._save_new_masked(a)
         elif type(a) == Numeric.ArrayType:
             index = self._save_new_array(a)
         elif type(a) == types.StringType:
             index = self._save_new_str(a)
         else:
             index = self._save_new_str(repr(a))
         self.dict[key] = index
         self.dict_dirty = 1
     else:
         if MA.isMaskedArray(a):
             self._save_masked(index, a)
         elif type(a) == Numeric.ArrayType:
             self._save_array(index, a)
         elif type(a) == types.StringType:
             self._save_str(index, a)
         else:
             index = self._save_str(index, repr(a))
开发者ID:timchurches,项目名称:NetEpi-Analysis,代码行数:24,代码来源:soomarray.py

示例3: summ_to_array

# 需要导入模块: import MA [as 别名]
# 或者: from MA import isMaskedArray [as 别名]
def summ_to_array(ds, measure, debug=False):
    from SOOMv0.CrossTab import CrossTab

    ct = CrossTab.from_summset(ds)
    data = ct[measure].data
    if MA.isMaskedArray(data):
        data = data.filled()    # Dealing with frequencies, so this is valid.
    data = data.astype(Numeric.Float64)
    if debug: print type(data)
    if debug: print data
    array = r.as_array(data)
    dimnames = []
    labels = []
    for axis in ct.axes:
        dimnames.append([axis.col.do_outtrans(v) for v in axis.values])
        labels.append(axis.col.label or axis.col.name)
    dimnames = r.list(*dimnames)
    dimnames = r.names__(dimnames, labels)
    array = r.dimnames__(array, dimnames)
    if debug: r.print_(array)
    return array
开发者ID:timchurches,项目名称:NetEpi-Analysis,代码行数:23,代码来源:rconv.py

示例4: take

# 需要导入模块: import MA [as 别名]
# 或者: from MA import isMaskedArray [as 别名]
 def take(self, rows):
     array = self.blob.as_array()
     if MA.isMaskedArray(array):
         return MA.take(array, rows)
     else:
         return Numeric.take(array, rows)
开发者ID:timchurches,项目名称:NetEpi-Analysis,代码行数:8,代码来源:soomarray.py


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