title: How to use window functions in PySpark?
body: <p>I'm trying to use some windows functions (<code>ntile</code> and <code>percentRank</code>) for a data frame but I don't know how to use them. </p>
  
  <p>Can anyone help me with this please? In the <a href="http://spark.apache.org/docs/latest/api/python/pyspark.sql.html?highlight=ntile#pyspark.sql.functions.ntile" rel="noreferrer">Python API documentation</a> there are no examples about it. </p>
  
  <p>Specifically, I'm trying to get quantiles of a numeric field in my data frame. </p>
  
  <p>I'm using spark 1.4.0.</p>