class_docstr: This class tests the basic functionality of the Python bindings.
class_docstr_tok: ["This","class","tests","the","basic","functionality","of","the","Python","bindings","."]
docstr: Test that we can pass a matrix with some categorical features.
docstr_tok: ["Test","that","we","can","pass","a","matrix","with","some","categorical","features","."]
code: def testMatrixAndInfoPandas(self):
      """
      Test that we can pass a matrix with some categorical features.
      """
      x = pd.DataFrame(np.random.rand(10, 4), columns=list("abcd"))
      x["e"] = pd.Series(
          ["a", "b", "c", "d", "a", "b", "e", "c", "a", "b"],
          dtype="category",
      )
      z = x.copy(deep=True)
  
      output = test_python_binding(
          string_in="hello",
          int_in=12,
          double_in=4.0,
          mat_req_in=[[1.0]],
          col_req_in=[1.0],
          matrix_and_info_in=z,
      )
  
      self.assertEqual(output["matrix_and_info_out"].shape[0], 10)
      self.assertEqual(output["matrix_and_info_out"].shape[1], 5)
  
      cols = list("abcde")
  
      for i in range(4):
          for j in range(10):
              self.assertEqual(
                  output["matrix_and_info_out"][j, i], z[cols[i]][j] * 2
              )
  
      for j in range(10):
          self.assertEqual(
              output["matrix_and_info_out"][j, 4], z[cols[4]][j]
          )
  
imports: import unittest
  import pandas
  import numpy
  import copy
  from mlpack.test_python_binding import test_python_binding
label_desc: Use image node_id 37 for calling the TestPythonBinding obj's underlying member method code with example usage: obj.testMatrixAndInfoPandas() without return types