July 2018
Intermediate to advanced
334 pages
8h 20m
English
Invoke the drop method on DataFrame cleanedDataFrame4 as follows:
val cleanedDataFrame5 = cleanedDataFrame4.drop('label')DataFrame[Date: string, words: array<string>, stopRemoved: array<string>, ngrams: array<string>, countVect: vector, label2: double] cleanedDataFrame5.show()| Date|label| words| stopEliminated| NGrams| SparseVectorCount|label2|| 09 09 09| 0|[Latvia, downs, ...|[Latvia, downs, ...|[Latvia downs, d...|
|11 11 09 09| 1|[Why, wont, Aust...|[wont, Australia, N...|[wont Australia, Au...| +-----------+-----+--------------------+--------------------+--------------------+--------------------+------+
Next, let's add a new column called label2 in place of the dropped label column.
Read now
Unlock full access