title: calculate percentage difference - python
body: <p>I am calculating the percentage difference between two values in a list. </p>
  
  <pre><code>#cal percentage dff: (val2/val)/100
  values = [0.11889, 0.07485, 0.01070, 0.03076, 0.01606]
  values = [int(round(i*100)) for i in values]
  
  conversion_values = []
  for x in range(1, len(values), 1):
      val_1 = values[x-1]
      if val_1 == 0.0: #Check if val_1 is 0.
          conversion_values.append('-')
      else:
          val_2 = values[x]
          diff = (val_2/val_1)*100
          conversion_values.append(diff)
  
  conversion_values
  
  output:
  [0, 0, 300, 0]
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>   [58, 14, 300, 67]
  </code></pre>
  
  <p>Not sure what I'm doing wrong here? In Excel this calculation works fine but not here, must be something to do with the decimal points??</p>
  
  <p>Note - this is not a question about percentage change, that's a different thing altogether. </p>