title: python: How to clean the csv file
body: <p>I am a beginner user of Python and would like to clean the csv file for analysis purpose. However, I am facing the problem with the code. </p>
  
  <pre><code>def open_dataset(file_name):
      opened_file = open(file_name)
      read_file = reader(opened_file, delimiter=",")
      data = list(read_file)
  
      return data
  
  
  def column(filename):
      filename = open_dataset(filename)
  
      for row in filename:
          print(row)
  </code></pre>
  
  <p>with the code above, the output is like</p>
  
  <pre><code>['Name;Product;Sales;Country;Website']
  [';Milk;30;Germany;something.com']
  [';;;USA;']
  ['Chris;Milk;40;;']
  </code></pre>
  
  <p>I would like to have the output following:</p>
  
  <pre><code>['Name','Product','Sales','Country','Website']
  [NaN,'Milk','30','Germany','something.com']
  [NaN,NaN,NaN,'USA',NaN]
  ['Chris','Milk',40,NaN,NaN]
  </code></pre>
  
  <p>I defined a delimiter as "," but still ";" used. I don't know why it is happening. Also Even if I tried to replace the space with "NaN, but still every space is replaced by "NaN".</p>
  
  <p>Would be really appreciated if someone could give me tips</p>
  
  <p>After all, I would like to analyse each column such as percentage of "NaN" etc.</p>
  
  <p>Thank you!</p>