code: def test_scipy_categorical(self):
      from scipy import sparse
  
      n_features = 10
      X, y = tm.make_categorical(
          10, n_features, n_categories=4, onehot=False
      )
      X = X.values.astype(np.float32)
      feature_types = ["c"] * n_features
  
      X[1, 3] = np.NAN
      X[2, 4] = np.NAN
      X = sparse.csr_matrix(X)
  
      Xy = xgb.DMatrix(X, y, feature_types=feature_types)
      np.testing.assert_equal(
          np.array(Xy.feature_types), np.array(feature_types)
      )
  
      X = sparse.csc_matrix(X)
  
      Xy = xgb.DMatrix(X, y, feature_types=feature_types)
      np.testing.assert_equal(
          np.array(Xy.feature_types), np.array(feature_types)
      )
  
      X = sparse.coo_matrix(X)
  
      Xy = xgb.DMatrix(X, y, feature_types=feature_types)
      np.testing.assert_equal(
          np.array(Xy.feature_types), np.array(feature_types)
      )
  
imports: import csv
  import os
  import tempfile
  import warnings
  import numpy
  import pytest
  import scipy.sparse
  from hypothesis import given, settings, strategies
  from scipy.sparse import csr_matrix, rand
  import xgboost
  from xgboost import testing
  from xgboost.core import DataSplitMode
  from xgboost.testing.data import np_dtypes, run_base_margin_info
label_desc: Use image node_id 15 for calling the TestDMatrix obj's underlying member method code with example usage: obj.test_scipy_categorical() without return types