Seaborn Lineplot Method
Machine Learning courses with 100+ Real-time projects Start Now!!
Program 1
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# days=[1,2,3,4,5,6,7,8,9,10]
# ind_temp=[34.4,41.4,45.4,24.4,34.4,36.2,44.4,33.2,28.7,33.5]
# # Using matplot
# plt.plot(days,ind_temp)
# plt.xlabel("Days")
# plt.ylabel("Temprature")
# plt.title("Indore Temprature")
# plt.show()
# USING SEABORN
days=[1,2,3,4,5,6,7,8,9,10]
ind_temp=[34.4,41.4,45.4,24.4,34.4,36.2,44.4,33.2,28.7,33.5]
df=pd.DataFrame({"Days":days,"Temperature":ind_temp})
#print(df)
sns.lineplot(x="Days",y="Temperature",data=df)
plt.show()
Program 2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
mydf=pd.read_excel("D://MLFile/employee.xlsx")
#print(mydf)
sns.lineplot(x=mydf['experience'],y=mydf['salary'],data=mydf)
plt.title("Salary Graph of Employee")
plt.xlabel("Exprience")
plt.ylabel("Days")
plt.show()
Did you like our efforts? If Yes, please give DataFlair 5 Stars on Google

