Hi I am wondering how to transpose a RowMatrix in PySpark.
data = [(MLLibVectors.dense([1.0, 2.0]), ), (MLLibVectors.dense([3.0, 4.0]), )]
df=sqlContext.createDataFrame(data, ["features"])
features=df.select("features").rdd.map(lambda row: row[0])
mat=RowMatrix(features)
print mat.rows.first()
#[1.0,2.0]
mat=mat.Transpose()
print mat.rows.first()
#[1.0,3.0]
Anyone implement this in Python? I've seen similar posts but everything is in Scala. Thanks.