Maciej Szymkiewicz created SPARK-10467:
------------------------------------------

             Summary: Vector is converted to tuple when extracted from Row 
using __getitem__
                 Key: SPARK-10467
                 URL: https://issues.apache.org/jira/browse/SPARK-10467
             Project: Spark
          Issue Type: Bug
          Components: ML, PySpark, SQL
    Affects Versions: 1.4.1
            Reporter: Maciej Szymkiewicz
            Priority: Minor


{code}
from pyspark.ml.feature import HashingTF

df = sqlContext.createDataFrame([(["foo", "bar"], )], ("keys", ))
transformer = HashingTF(inputCol="keys", outputCol="vec", numFeatures=5)
transformed = transformer.transform(df)
row = transformed.first()

row.vec # As expected
## SparseVector(5, {4: 2.0})

row[1]  # Returns tuple
## (0, 5, [4], [2.0]) 
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to