title: Python, is there a way to assign df.drop to a new variable?
body: <p>I've been practicing python for a while now and just got into pandas to start learning dataframes. I understand that df.drop() will remove a column/row based on certain requirements and makes a new df. I was wondering, is there a way to assign those dropped columns/rows to a new variable for logging purposes?</p>
  
  <pre><code>import pandas as pd
  L = ["a","b","c","d","a","a"]
  df1 = pd.DataFrame(L)
  df1.columns = ['letter']
  #print(df1)
  
  df2 = df1.drop(df1.letter == "a", axis=0)
  print(df2)
  
   letter
  2      c
  3      d
  4      a #why is this row not removed?
  5      a #why is this row not removed?
  </code></pre>
  
  <p>However, this doesn't even print a new df2 where all the rows with "a" are removed (separate problem here not sure why that is happening).</p>
  
  <p>Assigning the removed column to a new df doesn't work because it is using the initial dataframe df1. I am just unsure of how to make two dataframes, one with ONLY the removed columns and one where the removed columns are edited out.</p>
  
  <p>I would want a df3 that prints:</p>
  
  <pre><code>letter
  0      a
  4      a
  5      a
  </code></pre>