# How to use test_compare_matrices method in avocado

Best Python code snippet using avocado_python

test_util.py

Source:test_util.py

`...94 [False, True, False],95 0.03,96 pd.DataFrame([['f1', 'f2', '+', 0.03, 0.01, 0.05],97 ['f2', 'f1', '-', 0.04, 0.02, 0.06]]))])98def test_compare_matrices(pvals, sigs, cutoff, exp):99 df = compare_matrices(pvals, sigs, cutoff=cutoff)100 pd.util.testing.assert_frame_equal(df, exp)101@pytest.mark.parametrize(102 'arrs, ascending, exps',103 [((np.array([1, 2, 1, 3, 1, 4, 1, 5, 1, 6]),104 np.array([6, 5, 3, 4, 4, 9, 7, 1, 8, 9])),105 True,106 (np.array([1, 1, 1, 1, 1, 2, 3, 4, 5, 6]),107 np.array([3, 4, 6, 7, 8, 5, 4, 9, 1, 9]))),108 ((np.array([1, 6, 0, 1, 3, 1, 4, 1, 5, 1, 2, 0]),109 np.array([6, 5, 2, 3, 4, 4, 9, 7, 1, 8, 9, 7])),110 [True, False],111 (np.array([0, 0, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6]),112 np.array([7, 2, 8, 7, 6, 4, 3, 9, 4, 9, 1, 5]))),...`

test_data_structures.py

Source:test_data_structures.py

`...21 lists of values where some algorithm fails.22 """23 self.assertEqual(data_structures.geometric_mean(xrange(1, 180)),24 67.1555819421869)25 def test_compare_matrices(self):26 """27 Verify the correct value is produced when comparing matrices.28 """29 # Note that first row contains header in first column, while the30 # second contains only values (for testing purposes)31 matrix1 = [["header", 51.7, 60], [1, 0, 0]]32 matrix2 = [["header", 57.2, 54], [2, 51, 0]]33 self.assertEqual(data_structures.compare_matrices(matrix1, matrix2),34 ([["header", '+10.6382978723', -10.0], ['+100.0',35 'error_51/0', '.']], 3, 1, 5))36 def test_lazy_property(self):37 """38 Verify the value is initialized lazily with the correct value39 """...`

## Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.