title: PySpark: Split DataFrame into multiple DataFrames without using loop
body: <p>Hi I have a DataFrame as shown -</p>
  
  <pre><code>ID       X        Y
  
  1      1234      284
  
  1      1396      179
  
  2      8620      178
  
  3      1620      191
  
  3      8820      828
  </code></pre>
  
  <p>I want split this DataFrame into multiple DataFrames based on ID. So for this example there will be 3 DataFrames. One way to achieve it is to run filter operation in loop. However, I would like to know if it can be done in much more efficient way.</p>