title: Skip NaN values while counting data in python Pandas
body: <p>I am using pandas to get the count of the Text type data and to find out the top 5 among the given data.</p>
  
  <p>Input file is as follows:</p>
  
  <pre><code>Gears of war 3
  Gears of war
  Assassin creed
  .......
  .......
  Crysis 2
  Gears of war3
  Sims
  </code></pre>
  
  <p>My Output is as follows:</p>
  
  <pre><code>{
      'Gears of War 3': 6,
      'Batman': 5,
      'gears of war 3': 4,
      'Rocksmith': 5,
      'nan': 32870
  }
  </code></pre>
  
  <p>I want my code to skip counting nan values in my csv file.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>data = pandas.read_csv('D:\my_file.csv')
  
  for colname, dtype in data.dtypes.to_dict().iteritems():
      if dtype == 'object':
          print colname
          count = Counter(data[colname])
          d = dict((str(k), v) for k, v in count.iteritems())
          f = dict(sorted(d.iteritems(), key=lambda item: item[1], reverse = True)[:5])
  </code></pre>