Implement Sliding Window Algorithm to Detect Spikes
welcome to DS-SE and to Data Science in general! :)

Your problem can be solved really easily in Python. Please, take a look at Pandas DataFrame class to represent your data, it makes it really convenient because of all the pre-built methods that includes.

One of its methods is pandas.DataFrame.rolling() (see here) that does exactly what you asked for: rolling (sliding) window calculations, please take a look!

Hope it helps!