Professional Documents
Culture Documents
3 Facebook Data Reaction of Pakistani People
3 Facebook Data Reaction of Pakistani People
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df=pd.read_csv("/kaggle/input/daramas-data/ARY.csv",encoding='cp1252')
df.head()
df.Posts.fillna("No posts",inplace=True)
df.head()
len(df)
df["char"]=df["Posts"].apply(len)
df.head()
df1=df.fillna(2)
df1.head()
import wordcloud
from wordcloud import WordCloud
mycloud = WordCloud(background_color="white").generate(str(df1))
plt.imshow(mycloud)
df_sort_by_likes=df1.sort_values(["Likes"],ascending=False)
df_sort_by_likes
sns.barplot(x="Posts",y="Likes",data=df1)
g=df1["Likes"].max()
h=df1["Likes"].min()
i=df1["Likes"].mean()
print(g)
print(h)
print(i)
plt.boxplot(df1.Likes)
plt.show()
df_sort_by_comments=df1.sort_values(["Comments"],ascending=False)
df_sort_by_comments
sns.barplot(x="Posts",y="Comments",data=df1)
gg=df["Comments"].max()
hh=df["Comments"].min()
ii=df["Comments"].mean()
print(gg)
print(hh)
print(ii)
df_sort_by_shares=df1.sort_values(["Shares"],ascending=False)
df_sort_by_shares
sns.barplot(x="Posts",y="Shares",data=df1)
ggg=df1["Shares"].max()
hhh=df1["Shares"].min()
iii=df1["Shares"].mean()
print(ggg)
print(hhh)
print(iii)