:arg places: given number of decimal places (``default=7``) :type places: :class:`int` :rtype: :class:`bool` """ equality = True for i in range(3): for j in range(3): equality = equality and round(abs(m2[i][j] - m1[i][j]), places) == 0 return equality def is_special_orthogonal(m): """ Return *True* if the matrix can be considered as a special orthogonal matrix. .. seealso:: :class:`matrices.SpecialOrthogonalMatrix3D` """ if round(det(m) - 1.0, 7) == 0 and almostequal(inverse(m), transpose(m)): return True else: return False if __name__ == '__main__': #pragma: no cover import DrixUtilities.Runner as Runner Runner.Runner().run(runFunction=None)
__license__ = "GPL v3" # Standard library modules. # Third party modules. import numpy as np from scipy.stats import f_oneway # Local modules. from mathtools.stats.analysis import probplot_residuals from matplotlibtools.figurewx import show # Globals and constants variables. s1 = np.array([575, 542, 530, 539, 570]) s2 = np.array([565, 593, 590, 579, 610]) s3 = np.array([600, 651, 610, 637, 629]) s4 = np.array([725, 700, 715, 685, 710]) def example3_1(): f, p = f_oneway(s1, s2, s3, s4) print "F = %e, p-value = %e" % (f, p) def figure3_4(): fig = probplot_residuals(s1, s2, s3, s4) show(fig) if __name__ == '__main__': #pragma: no cover import DrixUtilities.Runner as Runner Runner.Runner().run(runFunction=figure3_4)