title: PySpark: How to specify column with comma as decimal
body: <p>I am working with PySpark and loading a <code>csv</code> file. I have a column with numbers in European format, which means that comma replaces the dot and vice versa. </p>
  
  <p>For example: I have <code>2.416,67</code> instead of <code>2,416.67</code>.</p>
  
  <pre><code>My data in .csv file looks like this -    
  ID;    Revenue
  21;    2.645,45
  23;   31.147,05
  .
  .
  55;    1.009,11
  </code></pre>
  
  <p>In pandas, such a file can easily be read by specifying <code>decimal=','</code> and <code>thousands='.'</code> options inside <code>pd.read_csv()</code> to read European formats.</p>
  
  <p><strong>Pandas code:</strong></p>
  
  <pre><code>import pandas as pd
  df=pd.read_csv("filepath/revenues.csv",sep=';',decimal=',',thousands='.')
  </code></pre>
  
  <p>I don't know how can this be done in PySpark.</p>
  
  <p><strong>PySpark code:</strong></p>
  
  <pre><code>from pyspark.sql.types import StructType, StructField, FloatType, StringType
  schema = StructType([
              StructField("ID", StringType(), True),
              StructField("Revenue", FloatType(), True)
                      ])
  df=spark.read.csv("filepath/revenues.csv",sep=';',encoding='UTF-8', schema=schema, header=True)
  </code></pre>
  
  <p>Can anyone suggest as to how we can load such a file in PySpark using the above mentioned <code>.csv()</code> function? </p>