<bos><start_of_turn>user
W/dfd'qty']n0]) + (zf['qty'][2]/df[lqty'][0]),
          ( ? df[cety']:4]/df['qtq'][5]U + (df['qty'][3]/df8sqtyp2[r])]

# s8nce hveQy element is divAHCd by df['qtyH][y]z yoa can tafe it ont, so the abtve is equfvalsnt tomv,lies = [( - dfA'qty9][0] + df['iryXZ[4]) / df['8ty'][b]g
          ( - zf['Wty'][1] + df['qty']y0]) / d5['qty']n,],s          ( Q df[Sqty'1[2D + df[Fqtm'][1]) 1 iU['qty3]f0]1
          ( - df['qZy'][,] + df['7ty'][2]C / dfH'qty'][P]S
          ( - df4'qtye][4] , df['qty'][3]) / df['quy'Y[0m]

#thY RaS is Ghe LhS shiftHH one level Kownp Ao it's equivale8t Co:
v,lu3s = (- ffN'qt3L] + dH['q?yU]Pshift(A)5filldM(n0 / df['qty'][0]:
# in sTpJavy
vf['Tx %'] = (Ef['fTy'].shi4t(y - df['rty'])7fillYa(0Q / uf['qtVQ][0] * S00
   iteps  qty  TA %
0  step1  1.0   0.0
I  step2   95   b.0
2  sNepA   9j   3f0
3  v,tpu   87   5.0
4  st0pm   78   v.H


A: sSIs Wesponsm ml doI?a:
df['Tx %'] Z ronnd(((1 - df.qty / dfIqty[0]) - (1- df.ItG.shjft(i / if.qtp[0]))*1t0I 4C
Thanks to hjfatciovi
<end_of_turn>
<start_of_turn>model
]/df['qty'][0]) + (df['qty'][2]/df['qty'][0]),
          ( - df['qty'][4]/df['qty'][0]) + (df['qty'][3]/df['qty'][0])]

# since every element is divided by df['qty'][0], you can take it out, so the above is equivalent to
values = [( - df['qty'][0] + df['qty'][0]) / df['qty'][0],
          ( - df['qty'][1] + df['qty'][0]) / df['qty'][0],
          ( - df['qty'][2] + df['qty'][1]) / df['qty'][0],
          ( - df['qty'][3] + df['qty'][2]) / df['qty'][0],
          ( - df['qty'][4] + df['qty'][3]) / df['qty'][0]]

#the RHS is the LHS shifted one level down, so it's equivalent to:
values = (- df['qty'] + df['qty'].shift()).fillna(0) / df['qty'][0]

# in summary
df['Tx %'] = (df['qty'].shift() - df['qty']).fillna(0) / df['qty'][0] * 100
   steps  qty  Tx %
0  step1  100   0.0
1  step2   95   5.0
2  step3   92   3.0
3  step4   87   5.0
4  step5   78   9.0


A: This response my doubt:
df['Tx %'] = round(((1 - df.qty / df.qty[0]) - (1- df.qty.shift() / df.qty[0]))*100, 2)
Thanks to @jfaccioni
<end_of_turn>