title: Unable to load csv file into Dataframe using Surprise in Python
body: <h2>The Scenario</h2>
  
  <p>The Dataset is to be imported which consists has considerable <code>NaN</code> values in it. For same I'm using SurPRISE package (written by Nicholas Hug) in Python rather than using Pandas. Reason being the Method of predicting NaN values is good with mentioned package.</p>
  
  <h2>The Problem</h2>
  
  <p>Dataset <strong>post_df1.csv</strong> is as mentioned below:</p>
  
  <pre><code>       uid     iid       rat
  1    303.0   785.0  3.000000
  2    291.0  1042.0  4.000000
  3    234.0  1184.0  2.000000
  4    102.0   768.0  2.000000
  5    181.0  1081.0  1.000000
  ...
  194  944.0  110.0       NaN
  195  944.0  111.0       NaN
  196  944.0  112.0       NaN
  197  944.0  113.0       NaN
  198  944.0  114.0  5.000000
  199  944.0  115.0  5.000000
  </code></pre>
  
  <p>Importing it using SurPRISE</p>
  
  <pre><code>reader = Reader(line_format="user item rating", sep='\t', rating_scale=(1, 5))
  df = Dataset.load_from_file('post_df1.csv', reader=reader)
  </code></pre>
  
  <p>returns error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;input&gt;", line 3, in &lt;module&gt;
    File "/home/x/.local/lib/python2.7/site-packages/surprise/dataset.py", line 173, in load_from_file
      return DatasetAutoFolds(ratings_file=file_path, reader=reader)
    File "/home/x/.local/lib/python2.7/site-packages/surprise/dataset.py", line 306, in __init__
      self.raw_ratings = self.read_ratings(self.ratings_file)
    File "/home/x/.local/lib/python2.7/site-packages/surprise/dataset.py", line 205, in read_ratings
      itertools.islice(f, self.reader.skip_lines, None)]
    File "/home/x/.local/lib/python2.7/site-packages/surprise/dataset.py", line 455, in parse_line
      return uid, iid, float(r) + self.offset, timestamp
  ValueError: could not convert string to float: 
  </code></pre>
  
  <p>I'm unable to figure out, where's the String! since <strong>post_df1.csv</strong> when read using Pandas, returns this:</p>
  
  <pre><code>post_df1.dtypes
  
  uid    float64
  iid    float64
  rat    float64
  dtype: object
  </code></pre>
  
  <h2>Questions</h2>
  
  <ol>
  <li>What is the possibility that when reading it using this package might treat entire data as string?</li>
  <li>I noticed in Error, that float has an offset and timestamp as return value in Dataset.py. How can I limit it upto <em>uid, iid, rat / float</em> only?</li>
  </ol>
  
  <blockquote>
    <p>return uid, iid, float(r) + self.offset, timestamp
     3. List item</p>
  </blockquote>
  
  <h2>References</h2>
  
  <p><a href="http://surprise.readthedocs.io/en/stable/" rel="nofollow noreferrer">Suprise Package Docs</a></p>
  
  <h2>EDIT #1</h2>
  
  <p>So, here's how the <strong>post_df1</strong> &amp; <strong>post_df2</strong> are formed. Also for <strong>post_df1</strong> I tried to take values from row 1 onwards, in case 0th row is header.</p>
  
  <pre><code># PRE PROCESSED CLUSTER 0 -- Named to POST DataFrame1
  if flag1 is 1:
      print pre_df01
      post_df1 = pre_df01.iloc[1:, :]
  elif flag1 is 2:
      print pre_df02
      post_df1 = pre_df02.iloc[1:, :]
  elif flag1 is 3:
      print pre_df03
      post_df1 = pre_df03.iloc[1:, :]
  
  # PRE PROCESSED CLUSTER 1 -- Named to POST DataFrame2
  if flag2 is 1:
      print pre_df11
      post_df2 = pre_df11
  elif flag2 is 2:
      print pre_df12
      post_df2 = pre_df12
  elif flag2 is 3:
      print pre_df13
      post_df2 = pre_df13
  </code></pre>
  
  <p>Here, I've already tried removing header and index to avoid any string type in it.</p>
  
  <pre><code># EXPORT TO CSV &amp; LOAD AGAIN IN PROGRAM
  post_df1.to_csv("post_df1.csv", sep='\t', index=False, header=False)
  post_df2.to_csv("post_df2.csv", sep='\t', index=False, header=False)
  </code></pre>
  
  <p>Since, importing is issue in code, I looked into csv file using Spreadsheet, here's how it looks
  <a href="https://i.stack.imgur.com/8H1zF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8H1zF.png" alt="post_df1.csv in LibreOffice Calc"></a>
  Clearly it is without Headers.</p>