class_docstr: Test both vector operations and MLlib algorithms with SciPy sparse matrices,
  if SciPy is available.
class_docstr_tok: ["Test","both","vector","operations","and","MLlib","algorithms","with","SciPy","sparse","matrices",",","if","SciPy","is","available","."]
docstr: Create a column SciPy matrix from a dictionary of values
code: def scipy_matrix(self, size, values):
      """Create a column SciPy matrix from a dictionary of values"""
      from scipy.sparse import lil_matrix
  
      lil = lil_matrix((size, 1))
      for key, value in values.items():
          lil[key, 0] = value
      return lil
  
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 SciPyTests obj's underlying member method code with example usage: obj.scipy_matrix(size, values) and returns: lil