# # seaborn pratical
# In[19]:
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# In[ ]:
# sns.lineplot(
# x=None,
# y=None,
# hue=None,
# size=None,
# style=None,
# data=None,
# palette=None,
# hue_order=None,
# hue_norm=None,
# sizes=None,
# size_order=None,
# size_norm=None,
# dashes=True,
# markers=None,
# style_order=None,
# units=None,
# estimator='mean',
# ci=95,
# n_boot=1000,
# seed=None,
# sort=True,
# err_style='band',
# err_kws=None,
# legend='brief',
# ax=None,
# **kwargs,
# )
# In[34]:
days = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
temperature= [26,52,25,55,26,45,42,5,2,45,42,45,45,9,8]
temp_df=pd.DataFrame({"days":days, "temperature":temperature})
sns.lineplot(x="days",y="temperature",data=temp_df,)
plt.show()
# In[64]:
book1=pd.read_csv("I:\JNPY\mL imp\ML Project 1\Book2.csv")
book1.head()
# In[66]:
sns.lineplot(x="4no",y="total",data=book1)
plt.show()
# In[75]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
hous.head()
# In[79]:
sns.lineplot(x="Sq.ft",y="Price",data=hous)
plt.show()
# # using hue opration
# In[83]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location")
plt.show()
# # using style opration
# In[85]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location",style="Location")
plt.show()
# # using palette opration
#
# palette is use to change the color of grah
# In[87]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location",style="Location",palette="hot")
plt.show()
# # Using markers opration
# In[88]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location",style="Location",palette="hot",markers=["o","^"])
plt.show()
# # using legend='brief' opration
# In[93]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location",style="Location",
palette="hot",markers=["o","^"],legend='brief' )
plt.show()
# In[97]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location",style="Location",
palette="hot",markers=["o","^"],legend=False)
plt.show()
# In[99]:
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location",style="Location",
palette="hot",markers=["o","^"],legend="full")
plt.show()
# In[106]:
plt.figure(figsize = (25,9))
hous=pd.read_csv("I:\JNPY\mL imp\ML Project 1\house_price.csv")
sns.lineplot(x="Sq.ft",y="Price",data=hous,hue="Location",style="Location",
palette="hot",markers=["o","^"],legend="full")
sns.set(style="whitegrid") #hite, dark, whitegrid, darkgrid, ticks
plt.show()
0 Comments