コード例 #1
0
ファイル: miarray.py プロジェクト: lileipku00/MeteoInfoLab
 def astype(self, dtype):
     if dtype == 'int' or dtype is int:
         r = MIArray(ArrayUtil.toInteger(self.array))
     elif dtype == 'float' or dtype is float:
         r = MIArray(ArrayUtil.toFloat(self.array))
     else:
         r = self
     return r
コード例 #2
0
ファイル: miarray.py プロジェクト: ccnasyq/MeteoInfoLab
 def astype(self, dtype):
     if dtype == 'int' or dtype is int:
         r = MIArray(ArrayUtil.toInteger(self.array))
     elif dtype == 'float' or dtype is float:
         r = MIArray(ArrayUtil.toFloat(self.array))
     else:
         r = self
     return r
コード例 #3
0
 def astype(self, dtype):
     '''
     Convert to another data type.
     
     :param dtype: (*string*) Data type.
     
     :returns: (*array*) Converted array.
     '''
     if dtype == 'int' or dtype is int:
         r = MIArray(ArrayUtil.toInteger(self.array))
     elif dtype == 'float' or dtype is float:
         r = MIArray(ArrayUtil.toFloat(self.array))
     elif dtype == 'boolean' or dtype is bool:
         r = MIArray(ArrayUtil.toBoolean(self.array))
     else:
         r = self
     return r
コード例 #4
0
ファイル: miarray.py プロジェクト: meteoinfo/MeteoInfoLab
 def astype(self, dtype):
     '''
     Convert to another data type.
     
     :param dtype: (*string*) Data type.
     
     :returns: (*array*) Converted array.
     '''
     if dtype == 'int' or dtype is int:
         r = MIArray(ArrayUtil.toInteger(self.array))
     elif dtype == 'float' or dtype is float:
         r = MIArray(ArrayUtil.toFloat(self.array))
     elif dtype == 'boolean' or dtype == 'bool' or dtype is bool:
         r = MIArray(ArrayUtil.toBoolean(self.array))
     else:
         r = self
     return r