title: Jupyter Notebook Kernal Keeps dying - low memory?
body: <p>I am trying two different lines of code that both involve computing combinations of rows of a df with 500k rows. </p>
  
  <p>I think bc of the large # of combinations, the kernal keeps dying. Is there anyway to resolve this ?</p>
  
  <p><a href="https://i.stack.imgur.com/lAOn5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lAOn5.png" alt="enter image description here"></a></p>
  
  <p>Both lines of code that crash are</p>
  
  <pre><code>pd.merge(df.assign(key=0), df.assign(key=0), on='key').drop('key', axis=1)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>index_comb = list(combinations(df.index, 2))
  </code></pre>
  
  <p>Both are different ways to achieve same desired  df but kernal fails on both.</p>
  
  <p>Would appreciate any help :/</p>
  
  <p>Update: I tried using the code in my terminal and it gives me an error of killed 9: it is using too much memory in terminal as well?</p>