Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions python/pyspark/ml/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def vector_to_array(col: Column, dtype: str = "float64") -> Column:
StructField(oldVec,ArrayType(FloatType,false),false)]
"""
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.vector_to_array(_to_java_column(col), dtype)
)
Expand Down Expand Up @@ -101,6 +102,7 @@ def array_to_vector(col: Column) -> Column:
[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)))


Expand Down