title: How to cluster (or group) the data from a CSV file?
body: <p>I have a three column data set in CSV, </p>
  
  <pre><code>A,B,10
  A,C,15
  A,D,21
  B,A,10
  B,C,20
  </code></pre>
  
  <p>I want to group or cluster A,B,C,D pairs based on the third column. The condition is the increment of 10. 0-10 one cluster, 11-20 another cluster and so on. Each cluster will contain pairs of A,B,C,D. Basically if the third column is in between 0 - 10 a pair will go to first cluster. A,B has 10 in third column so they go in the first cluster. I expect it to be 10-15 clusters. </p>
  
  <p>Here is how I opened CSV: </p>
  
  <pre><code>fileread = open('/data/dataset.csv', 'rU')
  readcsv = csv.reader(fileread, delimiter=',')
  
  L = list(readcsv)
  </code></pre>
  
  <p>I have created a set: </p>
  
  <pre><code>set(item[2] for item in L if (item[0]=='A' and item[1] == 'B' and item[2] &lt;= 10)
  </code></pre>
  
  <p>My basic question here is that how to check the third column and store the pairs in a cluster?</p>