class_docstr: This class defines tests for the to_matrix() and to_matrix_with_info() utility
  functions.
docstr: Make sure that we can convert a categorical-only Pandas matrix.
docstr_tok: ["Make","sure","that","we","can","convert","a","categorical-only","Pandas","matrix","."]
code: def testCategoricalOnly(self):
      """
      Make sure that we can convert a categorical-only Pandas matrix.
      """
      d = pd.DataFrame({"A": ["a", "b", "c", "a"]})
      d["A"] = d["A"].astype("category")  # Convert to categorical.
  
      m, _, dims = to_matrix_with_info(d, np.double)
  
      self.assertTrue(isinstance(m, np.ndarray))
      self.assertEqual(m.dtype, np.dtype(np.double))
  
      self.assertEqual(dims.shape[0], 1)
      self.assertEqual(dims[0], 1)
  
      self.assertEqual(m.shape[0], 4)
      self.assertEqual(m.shape[1], 1)
      self.assertEqual(m[0], m[3])
      self.assertTrue(m[0] != m[1])
      self.assertTrue(m[1] != m[2])
      self.assertTrue(m[0] != m[2])
  
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 7 for calling the TestToMatrixWithInfo obj's underlying member method code with example usage: obj.testCategoricalOnly() without return types