title: How to identify Hot and Cold days using map reduce?
body: <p>My data looks like:</p>
  
  <pre><code>20130101  12.8   9.6
  20130102  10.1   3.8
  20130103   7.0  -2.2
  20130104  11.8  -3.7
  20130105   8.6  -1.1
  20130106  10.5   1.9
  20130107  13.4  -0.1
  20130108  16.2   1.4
  20130109  17.8  12.4
  20130110  20.0  16.2
  20130111  15.4  5.0
  </code></pre>
  
  <p>I want to edentify the dates with maximum temperature greater than 40 (A Hot Day) and minimum temperature lower than 10 (A Cold Day).
  For that I run the following code :</p>
  
  <pre><code>current_date = None
  current_temp = None
  for line in data.strip(). split('\n'):
      Mapper_data = ["%s\o%s\o%s" % (line.split('  ')[0], line.split('  ')[1],line.split('  ')[2]) ]
      for line in Mapper_data:
          line = line.strip()
          date, max_temp,min_temp = line.rsplit('\o', 2)
          try:
              max_temp = float(max_temp)
              min_temp = float(min_temp)    
         except ValueError:
              continue
         if current_date == date:
             if max_temp &gt; 40:
                  current_temp = 'Hot day'
             if min_temp&lt; 10:
                  current_temp = 'Cold day'
  
        else:
              if current_date:
                  print ('%s\t%s' % (current_date, current_temp))
              if max_temp &gt; 40:
                 current_temp = 'Hot day' 
              if min_temp&lt; 10:
                 current_temp = 'Cold day'
             current_date = date
  if current_date == date:
      print ('%s\t%s' % (current_date, current_temp))
  </code></pre>
  
  <p>I'm getting the following result:</p>
  
  <pre><code>20130101    Cold day
  20130102    Cold day
  20130103    Cold day
  20130104    Cold day
  20130105    Cold day
  20130106    Cold day
  20130107    Cold day
  20130108    Cold day
  20130109    Cold day
  20130110    Cold day
  20130111    Cold day
  </code></pre>
  
  <p>But the result I need to have is:</p>
  
  <pre><code>20130101    Cold day
  20130102    Cold day
  20130103    Cold day
  20130104    Cold day
  20130105    Cold day
  20130106    Cold day
  20130107    Cold day
  20130108    Cold day
  20130111    Cold day
  </code></pre>
  
  <p>Because 20130109 and 20130110 are neither Cold nor Hot days.</p>
  
  <p>Please if you have any idea how can I change my code to get the last result please help.</p>