title: How to match opposite values in data frame?
body: <p>I basically want to eliminate opposite amounts from an imported data frame.</p>
  
  <p>My solution was to build a new data frame ignoring the lines that combined in pairs sum zero.</p>
  
  <p>Considering the following data frame:</p>
  
  <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame([
      ['31/07/17', 43020500, 13552.65],
      ['31/07/17', 43020500, 13552.65],
      ['31/07/17', 43020500, 13552.65],
      ['31/07/17', 43020500, 13552.65],
      ['31/08/17', 43020500, 241024.48],
      ['31/08/17', 43020500, 241024.48],
      ['31/08/17', 43020500, 241024.48],
      ['31/08/17', 43020500, 241024.48],
      ['31/08/17', 43020500, 241024.48],
      ['31/08/17', 43020500, -13552.65],
      ['31/08/17', 43020500, -13552.65],
      ['31/08/17', 43020500, -13552.65],
      ['31/08/17', 43020500, -13552.65],
      ['31/08/17', 43020500, -13552.65],
      ['30/06/17', 43020500, 133540.13],
  ], columns = ['Data', 'Account','Amount']
  )
  
  df
  Out[34]: 
          Data   Account     Amount
  0   31/07/17  43020500   13552.65
  1   31/07/17  43020500   13552.65
  2   31/07/17  43020500   13552.65
  3   31/07/17  43020500   13552.65
  4   31/08/17  43020500  241024.48
  5   31/08/17  43020500  241024.48
  6   31/08/17  43020500  241024.48
  7   31/08/17  43020500  241024.48
  8   31/08/17  43020500  241024.48
  9   31/08/17  43020500  -13552.65
  10  31/08/17  43020500  -13552.65
  11  31/08/17  43020500  -13552.65
  12  31/08/17  43020500  -13552.65
  13  31/08/17  43020500  -13552.65
  14  30/06/17  43020500  133540.13
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/b66E5.png" rel="nofollow noreferrer">data frame example</a></p>
  
  <p>The expected result is a new data frame composed by Index 4 to 8, 13 and 14 but my code is not working...</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import pandas as pd
  
  pd.options.display.float_format = '{:,.2f}'.format
  
  df = pd.read_excel('ContractAssets_copy.XLSX')
  df.sort_values('Date')
  
  dfToList = df['Amount'].tolist()
  
  newdf = []
  
  def index(a_list, value):
      try:
          return a_list.index(value)
      except ValueError:
          return None
  
  for number in dfToList:
      key = index(dfToList, dfToList[number] * -1)
      if key == None:
          newdf.append(df[number])
  
  newdf
  </code></pre>
  
  <p>How do I solve the problem?</p>