In general, you want to be thinking about vectorized operations on columns instead of operations on specific cells.
So, for example, if you had a data
column, and you wanted another column that was the same but with each value multiplied by 3, you could do this in two basic ways. The first is the "cell-by-cell" operation.
df['data_prime'] = df['data'].apply(lambda x: 3*x)
The second is the vectorized way:
df['data_prime'] = df['data'] * 3
So, column-by-column in your spreadsheet:
Count (you can add 1 to the right side if you want it to start at 1 instead of 0):
df['count'] = pandas.Series(range(len(df))
Running total:
df['running total'] = df['data'].cumsum()
Difference from a scalar (set the scalar to a particular value in your df if you want):
df['diff'] = scalar - df['data']
Moving average:
df['moving average'] = df['running total'] / df['count'].astype('float')
Basic formula from your spreadsheet:
I think you have enough to this on your own.
If statement:
df['new column'] = 0
mask = df['data column'] >= 3
df.loc[mask, 'new column'] = 1