title: Convert a list of data from url to csv in python
body: <p>I'm trying to convert this Breast Cancer Wisconsin data set from a list to a data frame with columns.</p>
  
  <p>Here is the data set:
  <a href="http://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data" rel="nofollow noreferrer">http://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data</a></p>
  
  <p>These are the column names:</p>
  
  <pre><code>   #  Attribute                     Domain
     -- -----------------------------------------
     1. Sample code number            id number
     2. Clump Thickness               1 - 10
     3. Uniformity of Cell Size       1 - 10
     4. Uniformity of Cell Shape      1 - 10
     5. Marginal Adhesion             1 - 10
     6. Single Epithelial Cell Size   1 - 10
     7. Bare Nuclei                   1 - 10
     8. Bland Chromatin               1 - 10
     9. Normal Nucleoli               1 - 10
    10. Mitoses                       1 - 10
    11. Class:                        (2 for benign, 4 for malignant)
  </code></pre>
  
  <p>I imported the data set into python like this</p>
  
  <p>import requests</p>
  
  <pre><code>link = "http://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data"
  f = requests.get(link)
  
  print (f.text)
  </code></pre>
  
  <p>and see the data as a list with commas:</p>
  
  <pre><code>1000025,5,1,1,1,2,1,3,1,1,2
  1002945,5,4,4,5,7,10,3,2,1,2
  1015425,3,1,1,1,2,2,3,1,1,2
  1016277,6,8,8,1,3,4,3,7,1,2
  1017023,4,1,1,3,2,1,3,1,1,2
  </code></pre>
  
  <p>I need to separate the commas into columns and add names to the columns</p>
  
  <p>I tried this but it didn't work</p>
  
  <pre><code>import requests
  import pandas as pd
  import io
  
  urlData = requests.get(f.text).content
  rawData = pd.read_csv(io.StringIO(urlData.decode('utf-8')))
  </code></pre>