I have a time-series dataset and I need to find the difference in my field for every tick.
In excel, I can accomplish this easily by writing a formula B2=A2-A1 and copying this formula down the entire B column
example:
Is there a straightforward way to do this with pandas?
I have considered apply() but looks like it can only work on 1 element of a series
My other option will be to create an Numpy array out of my column A and run a loop through it. However, that seems like a roundabout way and gets even more complicated if I need to refer elements from different
The actual Excel formula that I need to translate is =IF((A3-A2)>0, (A3-A2), A3+(4294967296-A2))