title: 'list' object has no attribute 'isEmpty' when I want to check if Dataframe is empty
body: <p>I create a dataframe d2 and want to apply a function to see if it is empty or not. I get the error:  <strong>'list' object has no attribute 'isEmpty'</strong></p>
  <pre><code>import pyspark
  from pyspark.sql import SparkSession
  from pyspark.sql.types import DecimalType, FloatType, StructType,StructField, StringType, IntegerType 
  from pyspark.sql.types import ArrayType, DoubleType, BooleanType
  from pyspark.sql.functions import col,array_contains, monotonically_increasing_id, when
  from pyspark.sql.window import Window as W
  from pyspark.sql import functions as F
  from pyspark.sql.types import StructType,StructField 
  from pyspark.sql.types import StringType, IntegerType, ArrayType
  from pyspark.sql.functions import round, lit
  
  
  sc = SparkSession.builder.appName('SparkByExamples.com').getOrCreate()
  
  columns2 = [&quot;Java&quot;,&quot;Python&quot;]
  data2 = [(&quot;Java&quot;, &quot;20000&quot;), (&quot;Hello&quot;, &quot;100000&quot;), (&quot;Scala&quot;, &quot;3000&quot;)]
  df2 = sc.createDataFrame(data2).toDF(*columns2)
  
  print(df2.head(1).isEmpty)
  </code></pre>
  <p>In the last line I get an error. Can someone help me?</p>