title: Pyspark : How to replace value each row with value in array
body: <p>I will change number in column date with value in monthList array. </p>
  
  <p><strong>monthList array</strong></p>
  
  <p><code>monthList = ["None","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
  </code></p>
  
  <p><strong>pyspark code</strong></p>
  
  <pre><code>d = df.select(col('InvoiceDate'),col('TotalSales')/1000000).groupBy(month('InvoiceDate')).sum()
  d = d.select(col('month(InvoiceDate)').alias('date'),col('sum((TotalSales / 1000000))').alias('value')).orderBy('date')
  d = d.select(col('date'),round(col('value'),2).alias('value'))
  d.show()
  </code></pre>
  
  <p><strong>result</strong></p>
  
  <pre><code>+----+-----+
  |date|value|
  +----+-----+
  |   1|19.75|
  |   2|15.51|
  |   3|20.66|
  +----+-----+
  </code></pre>
  
  <p>I will try this but it not working. It's error <code>'DataFrame' object has no attribute 'apply'</code></p>
  
  <pre><code>d.date = d.select('date').apply(lambda x: monthList[x]) 
  </code></pre>
  
  <p>Thank you for your helping.</p>