title: Python Dataframe that calculate percentage change by lambda
body: <p>How could I calculate the percentage change in python dataframe with using lambda.
  The dataframe:
  <a href="https://i.stack.imgur.com/75I41.png" rel="nofollow noreferrer">raw dataframe</a></p>
  
  <p>and I would like to calculate the percentage change of volume of each row
  The result should be like:
  <a href="https://i.stack.imgur.com/s19Im.png" rel="nofollow noreferrer">result</a></p>
  
  <p>I tried that:
  df.Volume.map(lambda x: ((df.Volumne.iloc[i+1])-x)/x, i)
  but the result is not corrent. 
  how could I perform: current value - previous value or next value - current value in lambder expression?
  p.s. I know that pct.change() is the method that can easily calculate percentage change.</p>
  
  <hr>
  
  <p>after I tried shift():
  <a href="https://i.stack.imgur.com/FfLL7.png" rel="nofollow noreferrer">using shift() within lambda</a></p>