Calculating the Simple Moving Average in Python