title: can't access my dataframe column on Apache Spark
body: <p>I am learning Spark and would like to know why I can't access my column, this is the command I am running:</p>
  
  <pre><code>shakespeareDF.select(explode(split(shakespeareDF.sentence, " ")).alias("word")).filter(shakespeareDF.word != "")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>shakespeareDF.select(explode(split(shakespeareDF.sentence, " ")).alias("word")).filter(shakespeareDF["word"] != "")
  </code></pre>
  
  <p>both commands gives me an <code>AttributeError: 'DataFrame' object has no attribute 'word'</code> but I don't know why.</p>
  
  <p>The funny thing is that this works <code>shakespeareDF.select(explode(split(shakespeareDF.sentence, " ")).alias("word")).filter(col("word") != "")</code></p>
  
  <p>So my question is: Why neither <code>shakespeareDF.word</code> nor <code>shakespeareDF["word"]</code> works and why <code>col("word")</code> does?</p>
  
  <p>thank you</p>