title: Reshape very large dataframe
body: <p>I am trying to reshape a very large dataframe df1 to df2 but due its size I am getting a memory error:</p>
  
  <pre><code>dict1 = [{'12/21/18': 0,'12/22/18': 0,'12/23/18': 1,'12/24/18': 1},
   {'12/21/18': 1,'12/22/18': 1,'12/23/18': 0,'12/24/18': 1},
   {'12/21/18': 0,'12/22/18': 1,'12/23/18': 0,'12/24/18': 0},
   {'12/21/18': 1,'12/22/18': 0,'12/23/18': 1,'12/24/18': 1}]
   df1 = pd.DataFrame(dict1, index= ['AAPL','CSCO','GE','MSFT' ])
  
   dict2 = [{'Ticker': 'AAPL','Date': '12/23/18'},
   {'Ticker': 'AAPL','Date': '12/24/18'},
   {'Ticker': 'CSCO','Date': '12/22/18'},
   {'Ticker': 'CSCO','Date': '12/24/18'},
   {'Ticker': 'GE',  'Date': '12/22/18'},
   {'Ticker': 'MSFT','Date': '12/24/18'}]
   df2 = pd.DataFrame(dict2) 
  </code></pre>
  
  <p>This is what I have tried so far:</p>
  
  <pre><code>df1.index.name = 'Ticker' 
  df2 = df1.reset_index().melt(id_vars='Ticker',var_name='Date') 
  
  df2 = df2[df2.value == 1].set_index('Ticker').filter(['Date','Ticker']).sort_index()
  </code></pre>
  
  <p>but it only works for the small example. Is there a way to do this in small individual chunks?</p>