title: Map Reduce Python 3.x- TypeError: unsupported operand type(s) for |: 'str' and 'function'
body: <p>Taking a data science class and this is the textbook example, but I can't translate it into python 3.x.</p>
  <hr />
  <pre><code>import sys
  
  def mapper():
      for line in sys.stdin:
          data = line.split(',')
          print (data[1] + ',' + data[2])
      
  def reduce():
      high = 0
  
      for line in sys.stdin:
          data = line.split(',')
          close = float(data[1].rstrip())
      
      if (close &gt; high):
          high = close
          date = data[0]
          
      print(date + ',' + str(high))
  
  path = r'C:\Users\kingj\Downloads\stocks.csv'
  
  mapper &lt; path | reduce 
  </code></pre>
  <hr />
  <p>I get this error:</p>
  <pre><code>----&gt; 2 mapper &lt; path | reduce
  
  TypeError: unsupported operand type(s) for |: 'str' and 'function'
  </code></pre>