title: Pandas GroupBy and max on MultiIndex upper column level
body: <p>I'm trying to get the max of 2 columns for each row in a Pandas Multi-Column Index Dataframe.</p>
  
  <p>I've loaded multiple stock data into Pandas and I am trying to get the max of the Close and Open price for each stock and each day.</p>
  
  <p>The example I've given is a simplistic example of what I am really trying to do, so I'd appreciate it if someone can give me a solution that doesn't require to loop through each column or row and has a quick run time.</p>
  
  <pre><code># import libaries
  import pandas as pd
  import datetime
  from dateutil.relativedelta import relativedelta
  from pandas_datareader import data as pdr
  import fix_yahoo_finance as yf
  
  #declare dates
  end_date = datetime.date.today()
  start_date = end_date - relativedelta(days=3)
  
  #load stock data (this code sometimes brings an error, just rerun it and it should work within a few tries)
  yf.pdr_override()
  df = pdr.get_data_yahoo(['AAPL','FB'], start_date, end_date)
  print(df)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>              Open               Close  
                AAPL     FB        AAPL     FB
  Date
  2019-05-29    176.42   183.50    177.38   182.19
  2019-05-30    177.95   183.08    178.30   183.01
  2019-05-31    176.23   180.28    175.07   177.47
  </code></pre>
  
  <p>Desired Output:</p>
  
  <pre><code>              Open               Close              Max     
                AAPL     FB        AAPL     FB        AAPL     FB
  Date
  2019-05-29    176.42   183.50    177.38   182.19    177.38   183.50
  2019-05-30    177.95   183.08    178.30   183.01    178.30   183.08
  2019-05-31    176.23   180.28    175.07   177.47    176.23   180.28
  </code></pre>
  
  <p>Thanks in advance!</p>