本文整理汇总了Python中PyFoam.Basics.SpreadsheetData.SpreadsheetData.compare方法的典型用法代码示例。如果您正苦于以下问题:Python SpreadsheetData.compare方法的具体用法?Python SpreadsheetData.compare怎么用?Python SpreadsheetData.compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyFoam.Basics.SpreadsheetData.SpreadsheetData
的用法示例。
在下文中一共展示了SpreadsheetData.compare方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSpreadsheetDataCompare4c
# 需要导入模块: from PyFoam.Basics.SpreadsheetData import SpreadsheetData [as 别名]
# 或者: from PyFoam.Basics.SpreadsheetData.SpreadsheetData import compare [as 别名]
def testSpreadsheetDataCompare4c(self):
sp=SpreadsheetData(data=[[i*0.5,math.sin(i)] for i in range(10)],names=['t','val'])
sp2=SpreadsheetData(data=[[i*0.5,math.sin(i)+0.5] for i in range(10)],names=['t','val'])
diff1=sp.compare(sp2,"val")
diff2=sp2.compare(sp,"val")
self.assertAlmostEqual(diff1["max"],diff2["max"])
self.assertAlmostEqual(diff1["average"],diff2["average"])
self.assertAlmostEqual(diff1["wAverage"],diff2["wAverage"])
self.assertAlmostEqual(diff1["average"],diff1["wAverage"])
示例2: testSpreadsheetDataCompare4f
# 需要导入模块: from PyFoam.Basics.SpreadsheetData import SpreadsheetData [as 别名]
# 或者: from PyFoam.Basics.SpreadsheetData.SpreadsheetData import compare [as 别名]
def testSpreadsheetDataCompare4f(self):
sp=SpreadsheetData(data=[[i*0.5,i*0.5] for i in range(10)],names=['t','val'])
sp2=SpreadsheetData(data=[[i*0.5-0.25,i*0.5-0.25] for i in range(10)],names=['t','val'])
diff3=sp.compare(sp2,"val",common=True)
diff4=sp2.compare(sp,"val",common=True)
self.assertAlmostEqual(diff3["max"],diff4["max"])
self.assertAlmostEqual(diff3["average"],diff4["average"])
self.assertAlmostEqual(diff3["wAverage"],diff4["wAverage"])
self.assertAlmostEqual(diff3["average"],diff3["wAverage"])
self.assertAlmostEqual(diff4["average"],diff4["wAverage"])
示例3: testSpreadsheetDataCompare3
# 需要导入模块: from PyFoam.Basics.SpreadsheetData import SpreadsheetData [as 别名]
# 或者: from PyFoam.Basics.SpreadsheetData.SpreadsheetData import compare [as 别名]
def testSpreadsheetDataCompare3(self):
sp=SpreadsheetData(data=data6,names=names3)
sp2=SpreadsheetData(data=data7,names=names4)
diff1=sp.compare(sp2,"val")
self.assertAlmostEqual(diff1["max"],0)
self.assertAlmostEqual(diff1["average"],0)
self.assertAlmostEqual(diff1["wAverage"],0)
diff2=sp2.compare(sp,"val")
self.assertAlmostEqual(diff2["max"],0.5)
self.assertAlmostEqual(diff2["average"],0.09090909)
self.assertAlmostEqual(diff2["wAverage"],0.05)
示例4: testSpreadsheetDataCompare2
# 需要导入模块: from PyFoam.Basics.SpreadsheetData import SpreadsheetData [as 别名]
# 或者: from PyFoam.Basics.SpreadsheetData.SpreadsheetData import compare [as 别名]
def testSpreadsheetDataCompare2(self):
sp=SpreadsheetData(data=data3,names=names3)
sp2=SpreadsheetData(data=data5,names=names4)
diff1=sp.compare(sp2,"val")
self.assertAlmostEqual(diff1["max"],0.25)
self.assertAlmostEqual(diff1["average"],0.25)
self.assertAlmostEqual(diff1["wAverage"],0.25)
diff2=sp2.compare(sp,"val")
self.assertAlmostEqual(diff2["max"],9.25)
self.assertAlmostEqual(diff2["average"],1.0681818181)
self.assertAlmostEqual(diff2["wAverage"],0.7)
示例5: testSpreadsheetDataCompare1
# 需要导入模块: from PyFoam.Basics.SpreadsheetData import SpreadsheetData [as 别名]
# 或者: from PyFoam.Basics.SpreadsheetData.SpreadsheetData import compare [as 别名]
def testSpreadsheetDataCompare1(self):
sp=SpreadsheetData(data=data3,names=names3)
sp2=SpreadsheetData(data=data4,names=names4)
diff1=sp.compare(sp2,"val")
self.assertAlmostEqual(diff1["max"],1)
self.assertAlmostEqual(diff1["average"],1)
self.assertAlmostEqual(diff1["wAverage"],1)
diff2=sp2.compare(sp,"val")
self.assertEqual(diff1["max"],diff2["max"])
self.assertEqual(diff1["average"],diff2["average"])
self.assertEqual(diff1["wAverage"],diff2["wAverage"])
diff3=sp.compare(sp,"val")
self.assertAlmostEqual(diff3["max"],0)
self.assertAlmostEqual(diff3["average"],0)
self.assertAlmostEqual(diff3["wAverage"],0)
示例6: testSpreadsheetDataCompare6
# 需要导入模块: from PyFoam.Basics.SpreadsheetData import SpreadsheetData [as 别名]
# 或者: from PyFoam.Basics.SpreadsheetData.SpreadsheetData import compare [as 别名]
def testSpreadsheetDataCompare6(self):
sp=SpreadsheetData(data=[[i*0.5,1] for i in range(10)],names=['t','val'])
sp2=SpreadsheetData(data=[[i*0.5+10,2] for i in range(10)],names=['t','val'])
diff1=sp.compare(sp2,"val")
diff2=sp2.compare(sp,"val")
self.assertAlmostEqual(diff1["max"],1)
self.assertAlmostEqual(diff1["average"],1)
self.assertAlmostEqual(diff1["wAverage"],1)
self.assertAlmostEqual(diff2["max"],1)
self.assertAlmostEqual(diff2["average"],1)
self.assertAlmostEqual(diff2["wAverage"],1)
diff1=sp.compare(sp2,"val",common=True)
diff2=sp2.compare(sp,"val",common=True)
self.assertEqual(diff1["max"],None)
self.assertEqual(diff1["average"],None)
self.assertEqual(diff1["wAverage"],None)
self.assertEqual(diff2["max"],None)
self.assertEqual(diff2["average"],None)
self.assertEqual(diff2["wAverage"],None)
示例7: testSpreadsheetDataCompare5
# 需要导入模块: from PyFoam.Basics.SpreadsheetData import SpreadsheetData [as 别名]
# 或者: from PyFoam.Basics.SpreadsheetData.SpreadsheetData import compare [as 别名]
def testSpreadsheetDataCompare5(self):
sp=SpreadsheetData(data=[[i*0.5,1] for i in range(10)],names=['t','val'])
diff=sp.compare(sp,"val")
self.assertAlmostEqual(diff["max"],0)
self.assertAlmostEqual(diff["average"],0)
self.assertAlmostEqual(diff["wAverage"],0)