title: Apply StringIndexer to change columns in a PySpark Dataframe
body: <p>I am new to pyspark. I want to apply StringIndexer to change the value of the column to index.
  I checked this post:
  <a href="https://stackoverflow.com/questions/36942233/apply-stringindexer-to-several-columns-in-a-pyspark-dataframe">Apply StringIndexer to several columns in a PySpark Dataframe</a></p>
  
  <p>This solution will create a new column rather than updating the input column. Is there a way to update the currrent column? I tried to use the same name for input and output, but it does not work.</p>
  
  <pre><code>label_stringIdx = StringIndexer(inputCol ="WindGustDir", outputCol = "WindGustDir_index")
  </code></pre>