code: def array_to_vector(col: Column) -> Column:
      """
      Converts a column of array of numeric type into a column of pyspark.ml.linalg.DenseVector
      instances
  
      .. versionadded:: 3.1.0
  
      .. versionchanged:: 3.5.0
          Supports Spark Connect.
  
      Parameters
      ----------
      col : :py:class:`pyspark.sql.Column` or str
          Input column
  
      Returns
      -------
      :py:class:`pyspark.sql.Column`
          The converted column of dense vectors.
  
      Examples
      --------
      >>> from pyspark.ml.functions import array_to_vector
      >>> df1 = spark.createDataFrame([([1.5, 2.5],),], schema='v1 array<double>')
      >>> df1.select(array_to_vector('v1').alias('vec1')).collect()
      [Row(vec1=DenseVector([1.5, 2.5]))]
      >>> df2 = spark.createDataFrame([([1.5, 3.5],),], schema='v1 array<float>')
      >>> df2.select(array_to_vector('v1').alias('vec1')).collect()
      [Row(vec1=DenseVector([1.5, 3.5]))]
      >>> df3 = spark.createDataFrame([([1, 3],),], schema='v1 array<int>')
      >>> df3.select(array_to_vector('v1').alias('vec1')).collect()
      [Row(vec1=DenseVector([1.0, 3.0]))]
      """
      sc = SparkContext._active_spark_context
      assert sc is not None and sc._jvm is not None
      return Column(
          sc._jvm.org.apache.spark.ml.functions.array_to_vector(
              _to_java_column(col)
          )
      )
  
file_path: spark/python/pyspark/ml/functions.py
imports: from __future__ import annotations
  import inspect
  import uuid
  from typing import Any, Callable, Iterator, List, Mapping, TYPE_CHECKING, Tuple, Union, Optional
  import numpy
  from pyspark import SparkContext
  from pyspark.sql.functions import pandas_udf
  from pyspark.sql.column import Column, _to_java_column
  from pyspark.sql.types import ArrayType, ByteType, DataType, DoubleType, FloatType, IntegerType, LongType, ShortType, StringType, StructType
  from pyspark.ml.util import try_remote_functions
label_desc: Use image node_id 2 for calling a global function with example usage: array_to_vector(col) and returns: Column