code: def test_indexed_row_matrix_from_dataframe(self):
      from pyspark.errors import IllegalArgumentException
  
      df = self.spark.createDataFrame([Row(int(0), Vectors.dense(1))])
      matrix = IndexedRowMatrix(df)
      self.assertEqual(matrix.numRows(), 1)
      self.assertEqual(matrix.numCols(), 1)
      with self.assertRaises(IllegalArgumentException):
          IndexedRowMatrix(df.drop("_1"))
  
imports: import array
  import unittest
  from numpy import array, array_equal, zeros, arange, tile, ones, inf
  import pyspark.ml.linalg
  from pyspark.serializers import CPickleSerializer
  from pyspark.mllib.linalg import Vector, SparseVector, DenseVector, VectorUDT, _convert_to_vector, DenseMatrix, SparseMatrix, Vectors, Matrices, MatrixUDT
  from pyspark.mllib.linalg.distributed import RowMatrix, IndexedRowMatrix, IndexedRow
  from pyspark.mllib.regression import LabeledPoint
  from pyspark.sql import Row
  from pyspark.testing.mllibutils import MLlibTestCase
  from pyspark.testing.utils import have_scipy
label_desc: Use image node_id 5 for calling the VectorUDTTests obj's underlying member method code with example usage: obj.test_indexed_row_matrix_from_dataframe() without return types