I'm looking for an advice on how to smoothen a trend line.
This is the code:
import pandas as pd
from numpy import random
#Generating the data frame
df = pd.DataFrame(data = random.randn(5,4), index = ['A','B','C','D','E'],
columns = ['W','X','Y','Z'])
df['W'] = ['10/01/2018 12:00:00','10/03/2018 13:00:00',
'10/03/2018 12:30:00','10/04/2018 12:05:00',
'10/08/2018 12:00:15']
pd.to_datetime(df['W'])
print(df.head())
#Plotting hte graph
fig, ax = plt.subplots()
df.plot(x="W", y="X", ax=ax, color='salmon', alpha=0.5, marker='o')
df.plot(x="W", y="Y", ax=ax, color='royalblue', alpha=0.4, marker='o')
This is what I get: