Word count: 'Column' object is not callable
<pre><code>from pyspark.sql.functions import split, explode

sheshakespeareDF = sqlContext.read.text(fileName).select(removePunctuation(col('value')))

shakespeareDF.show(15, truncate=False)
</code></pre>

<p>The dataframe looks like this:</p>

<p><a href="https://i.stack.imgur.com/3pAy9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3pAy9.png" alt="enter image description here"></a></p>

<pre><code>ss = split(shakespeareDF.sentence," ")
shakeWordsDFa =explode(ss)

shakeWordsDF_S=sqlContext.createDataFrame(shakeWordsDFa,'word')
</code></pre>

<p>Any idea what am I doing wrong? Tip says <code>Column is not iterable</code>.</p>

<p>What should I do? I just want to change <code>shakeWordsDFa</code> to dataframe and rename.  </p>