title: How to create a python dataset from a local csv file?
body: <p>I have a <code>csv</code> file and am trying to create a dataset to use with <code>scikit-learn</code>.</p>
  
  <p>Loaded these packages:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import pandas as pd
  import numpy as np
  from sklearn import datasets, linear_model
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>sales = pd.read_csv("sales.csv") 
  dataset = np.loadtxt(sales, delimiter=",")
  </code></pre>
  
  <p>And it gave me this error: </p>
  
  <blockquote>
    <p>AttributeError: 'DataFrame' object has no attribute 'endswith'</p>
  </blockquote>
  
  <p>Please help! I am having no luck finding out how to create a dataset from a <code>csv</code> file. </p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>To clarify -- 
  I'm try to follow this procedure <a href="http://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html" rel="nofollow noreferrer">http://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html</a>, except I want to use my own data. I want to figure how to turn a csv into a python dataset, if that's even possible.</p>