Data analysis with python and Pandas - Calculate Moving average of time series Tutorial 8

preview_player
Показать описание
Visit complete course on Data Science with Python :

For All other visit my udemy profile at :

This video will explain how to calculate moving average of time series data with python pandas library rolling function.

# # Calculate Moving average of Time series data

# # 1, 4, 7, 9, 2, 4, 6, 7, 8

# ## (NAN+1)/2 (1+4)/2 (4+7)/2 (7+9)/2 (9+2)/2

# In[4]:

import pandas as pd

# In[7]:

data1 = {'data':[1, 4, 7, 9, 2, 4, 6, 7, 8]}

# In[8]:

data1

# In[9]:

df = pd.DataFrame(data1)

# In[10]:

df

# In[12]:

df1

# In[13]:

# In[14]:

Рекомендации по теме
Комментарии
Автор

Going gradually and this will help the beginner. Awesome! Really liked the way you are explaining

kavitha-
Автор

How to do this function throughout the loop

harshsaxena
Автор

What if I were to only calculate the mean of every 3 data ? Example: (Mean of 0, 1, 2), (Mean of, 3,4,5), (Mean of 6, 7, 8). What should i write in my code to obtain this mean values throughout the whole dataset?
Thank you

YOWHATZ
welcome to shbcf.ru