title: How to read xlsx or xls files as spark dataframe
body: <p>Can anyone let me know without converting xlsx or xls files how can we read them as a spark dataframe </p>
  
  <p>I have already tried to read with pandas and then tried to convert to spark dataframe but got the error and the error is </p>
  
  <p>Error:</p>
  
  <pre><code>Cannot merge type &lt;class 'pyspark.sql.types.DoubleType'&gt; and &lt;class 'pyspark.sql.types.StringType'&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import pandas
  import os
  df = pandas.read_excel('/dbfs/FileStore/tables/BSE.xlsx', sheet_name='Sheet1',inferSchema='')
  sdf = spark.createDataFrame(df)
  </code></pre>