title: Python: Generate 2D points / clusters
body: <p>I try to write an algorithm for clustering, now I like to create some easy 2D test cases: I like to generate points in <code>[0, 1]x[0, 1]</code> that build clusters.</p>
  
  <p>E.g. something like this:
  <a href="https://i.stack.imgur.com/e2UeU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e2UeU.png" alt="enter image description here"></a></p>
  
  <p>It would be better if the clusters have different (but random) shapes, e.g. like:<a href="https://i.stack.imgur.com/csRi9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/csRi9.png" alt="enter image description here"></a></p>
  
  <p>Is there an easy way to do this with python / numpy? Unfortunately the generation must be very efficient. I wrote some code, but the clusters always have the same shape and they are often far away from each other. Probably already a nice algorithm exists?</p>
  
  <p>Thank you</p>