code: def test_from_data_2x2():
      df = pd.DataFrame(
          [[1, 1, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 0]]
      ).T
      e = np.asarray([[1, 2], [4, 1]])
  
      # Test pandas
      tab1 = ctab.Table2x2.from_data(df, shift_zeros=False)
      assert_equal(tab1.table, e)
  
      # Test ndarray
      tab1 = ctab.Table2x2.from_data(np.asarray(df), shift_zeros=False)
      assert_equal(tab1.table, e)
  
imports: import os
  import warnings
  import numpy
  import statsmodels.stats.contingency_tables
  import pandas
  from numpy.testing import assert_allclose, assert_equal
  import statsmodels.api
label_desc: Use image node_id 14 for calling a global function with example usage: test_from_data_2x2() without return types