let's say I have a room and a dataframe(/timeseries) df, which has minutely timestamps in one column df['timestamp'] and entries and exits for each minute in the other two columns df['entries'] & df['exits'] (those may be 0).
Now I want to create a fourth column, which tells me how much people there are inside the room df['count'].
When I try
df['count'] = 0
df['count'] = df.apply(lambda x: x['count'].shift(periods=1) + x['entries'] - x['exits'], axis=1)
I get an "AtributeError: 'int' object has no attribute 'shift'"
Could anyone please tell me what I'm doing wrong?
Kind regards