parameters: (
      data,
      missing,
      nthread,
      feature_names: FeatNamesT,
      feature_types: Optional[List[str]],
  )
return_statement: return handle, feature_names, feature_types
docstring: Initialize data from a 2-D numpy matrix.
docstring_summary: Initialize data from a 2-D numpy matrix.
docstring_tokens: Initialize data from a 2 - D numpy matrix .
function: def _from_numpy_array(
      data,
      missing,
      nthread,
      feature_names: FeatNamesT,
      feature_types: Optional[List[str]],
  ):
      """Initialize data from a 2-D numpy matrix.
  
      """
      if len(data.shape) != 2:
          raise ValueError(
              "Expecting 2 dimensional numpy.ndarray, got: ", data.shape
          )
      data, _ = _ensure_np_dtype(data, data.dtype)
      handle = ctypes.c_void_p()
      args = {
          "missing": float(missing),
          "nthread": int(nthread),
      }
      config = bytes(json.dumps(args), "utf-8")
      _check_call(
          _LIB.XGDMatrixCreateFromDense(
              _array_interface(data),
              config,
              ctypes.byref(handle),
          )
      )
      return handle, feature_names, feature_types
function_tokens: def _from_numpy_array ( data , missing , nthread , feature_names : FeatNamesT , feature_types : Optional [ List [ str ] ] , ) : if len ( data . shape ) != 2 : raise ValueError ( "Expecting 2 dimensional numpy.ndarray, got: " , data . shape ) data , _ = _ensure_np_dtype ( data , data . dtype ) handle = ctypes . c_void_p ( ) args = { "missing" : float ( missing ) , "nthread" : int ( nthread ) , } config = bytes ( json . dumps ( args ) , "utf-8" ) _check_call ( _LIB . XGDMatrixCreateFromDense ( _array_interface ( data ) , config , ctypes . byref ( handle ) , ) ) return handle , feature_names , feature_types