class_docstr: This class defines tests for the to_matrix() and to_matrix_with_info() utility
  functions.
docstr: Test that a simple pandas numeric matrix can be turned into a numpy ndarray.
docstr_tok: ["Test","that","a","simple","pandas","numeric","matrix","can","be","turned","into","a","numpy","ndarray","."]
code: def testPandasToMatrix(self):
      """
      Test that a simple pandas numeric matrix can be turned into a numpy ndarray.
      """
      d = pd.DataFrame(np.random.randn(100, 4), columns=list("abcd"))
  
      m, _ = to_matrix(d)
  
      self.assertTrue(isinstance(m, np.ndarray))
      self.assertEqual(m.shape[0], 100)
      self.assertEqual(m.shape[1], 4)
      self.assertEqual(m.dtype, np.dtype(np.double))
      colnames = list("abcd")
      for i in range(m.shape[1]):
          for j in range(m.shape[0]):
              self.assertEqual(m[j, i], d[colnames[i]][j])
  
imports: import unittest
  import pandas
  import numpy
  from mlpack.matrix_utils import to_matrix
  from mlpack.matrix_utils import to_matrix_with_info
label_desc: Use image node_id 1 for calling the TestToMatrix obj's underlying member method code with example usage: obj.testPandasToMatrix() without return types