Tanmay Sinha
Tanmay Sinha

Reputation: 1

Generate sparse vector for all the column values in spark dataframe

column1 column2
1 1
1 0
1 0
0 0

Now I want to calculate the hash or sparse vector of all the values in column1 and column2

Upvotes: 0

Views: 512

Answers (1)

pltc
pltc

Reputation: 6082

You can use VectorAssembler. It creates SparseVector by default.

Upvotes: -1

Related Questions