code: def num_row(self):
          
          ret = ctypes.c_ulong()
          _check_call(_LIB.XGDMatrixNumRow(self.handle,
                                           ctypes.byref(ret)))
          return ret.value
docs: Get the number of rows in the DMatrix.
  
          Returns
          -------
          number of rows : int