title: How to read csv
body: <p>I have a data stored in the csv file like below format</p>
  
  <pre><code>892,3,"Kelly, Mr. James",male,34.5,0,0,330911,7.8292,,Q
  893,3,"Wilkes, Mrs. James (Ellen Needs)",female,47,1,0,363272,7,,S
  894,2,"Myles, Mr. Thomas Francis",male,62,0,0,240276,9.6875,,Q
  895,3,"Wirz, Mr. Albert",male,27,0,0,315154,8.6625,,S
  896,3,"Hirvonen, Mrs. Alexander (Helga E Lindqvist)",female,22,1,1,3101298,12.2875,,S
  897,3,"Svensson, Mr. Johan Cervin",male,14,0,0,7538,9.225,,S
  </code></pre>
  
  <p>Data type for each <strong>column</strong></p>
  
  <pre><code>1. int        6. int
  2. int        7. int
  3. String     8. float
  4. String     9. float
  5. float      10.String
                11.String
  </code></pre>
  
  <p>first column which starts with <em>892, 893, ... 897</em> should be stored in <code>int</code> format in <code>array</code>. Third column like <em>"Wilkes, Mrs. James (Ellen Needs)"</em> should be stored in <code>string</code> type. But, the third column is in <code>string</code> format but the length of character is <strong>not</strong> fixed, i.e. I don't know max length of character stored in this column</p>
  
  <p><strong>I have done:</strong></p>
  
  <pre><code> csv_file_object = csv.reader(open('trainData.csv', 'rb'))
   header = csv_file_object.next()
  
   data=[]
   for row in csv_file_object:
      data.append(row)
      data = np.array(data)
  </code></pre>
  
  <p>but, above code reads <strong>all the column</strong> as <code>string</code> but many of them are <strong>not in <code>string</code> format</strong>, and stored the information in <code>string</code> format. On the other hand, if I did with <code>genfromtxt</code>, the third column is problem because it includes comma inside double-quota.</p>
  
  <p>I hope to store each column with its own data type i.e. first column should be stored as <code>int</code> type.</p>
  
  <p><strong>My expected array:</strong></p>
  
  <pre><code>892 3 "Kelly, Mr. James" male 34.5 0 0 330911 7.8292 NaN Q
  893 3 "Wilkes, Mrs. James (Ellen Needs)" female 47 1 0 363272 7 NaN S
  894 2 "Myles, Mr. Thomas Francis" male 62 0 0 240276 9.6875 NaN Q
  895 3 "Wirz, Mr. Albert" male 27 0 0 315154 8.6625 NaN S
  896 3 "Hirvonen, Mrs. Alexander (Helga E Lindqvist)" female 22 1 1 3101298 12.2875 NaN S
  897 3 "Svensson, Mr. Johan Cervin" male 14 0 0 7538 9.225 S
  </code></pre>
  
  <p>As you see, if data is not available, <code>NaN</code> or its derivant should be put.</p>
  
  <p>What should I read csv file?</p>