docstr: Checks for both np array and pd DataFrame.
docstr_tok: ["Checks","for","both","np","array","and","pd","DataFrame","."]
code: def test_dtypes(self) -> None:
      """Checks for both np array and pd DataFrame."""
      n_samples = 128
      n_features = 16
      for orig, x in np_dtypes(n_samples, n_features):
          m0 = xgb.QuantileDMatrix(orig)
          m1 = xgb.QuantileDMatrix(x)
          assert predictor_equal(m0, m1)
  
      # unsupported types
      for dtype in [
          np.string_,
          np.complex64,
          np.complex128,
      ]:
          X: np.ndarray = np.array(orig, dtype=dtype)
          with pytest.raises(ValueError):
              xgb.QuantileDMatrix(X)
  
imports: from typing import Any, Dict, List
  import numpy
  import pytest
  from hypothesis import given, settings, strategies
  from scipy import sparse
  import xgboost
  from xgboost.testing import IteratorForTest, make_batches, make_batches_sparse, make_categorical, make_ltr, make_sparse_regression, predictor_equal
  from xgboost.testing.data import check_inf, np_dtypes
  from xgboost.testing.data_iter import run_mixed_sparsity
label_desc: Use image node_id 12 for calling the TestQuantileDMatrix obj's underlying member method code with example usage: obj.test_dtypes() without return types