I have a double
-typed column in a dataframe that holds the class label for a Random Forest training set.
I would like to manually attach metadata to the column so that I don't have to pass the dataframe into a StringIndexer
as suggested in another question.
The easiest method of doing this seems to be by using the as
method of Column
.
However, this method is not available in Python.
Is there an easy workaround?
If there is no easy workaround and the best approach is a Python port of as
, then why is the method not ported in Python?
Is there a difficult technical reason and not simply because it conflicts with the as
keyword in Python and that no one has volunteered to port it?
I looked at the source code and found that the alias
method in Python internally calls the as
method in Scala.