python - How to show percentage change? - Stack Overflow
https://stackoverflow.com/questions/73265000/how-to-show-percentage-change
Aug 07, 2022 · How to show percentage change? PS_data = data [4:11,1] PNS_data = data [4:11,2] PRS_data = data [4:11,3] PRNS_data = data [4:11,4] def change (a,b): answer = np.diff (PS_data) / PS_data [0] * 100 return answer print (change (PS_data,0)) This is the code but it only gives me the correct answer for the first percentage change. If i change the '0 ...
DA: 9 PA: 57 MOZ Rank: 66 Up or Down: Up