Calculating Moving Averages in Python: A Comprehensive Guide