SMA4
SMA4
Experiment no: 4
Aim: Exploratory Data Analysis and visualization of Social Media Data for business.
Theory:
Exploratory data analysis (EDA) is used by data scientists to analyze and investigate data sets and summarize their main
characteristics, often employing data visualization methods. It helps determine how best to manipulate data sources to get
the answers you need, making it easier for data scientists to discover patterns, spot anomalies, test a hypothesis, or check
assumptions.
TextBlob is a Python (2 and 3) library for processing textual data. It provides a simple API for diving into common
natural language processing (NLP) tasks such as part-of-speech tagging, noun phrase extraction, sentiment analysis,
classification, translation, and more.
Word Clouds came out to be a game-changer visualization technique for understanding and determining patterns and
evolving trends. Whether to discover the political agendas of aspiring election candidates of a country or to analyze the
customer reviews on the recently launched product, one can get a visual representation by plotting the Word Cloud.
df1=df1.drop_duplicates("renderedContent") df1.shape
df1.head df1.date.value_counts()
#Heat Map for missing Values plt.figure(figsize=(17, 5))
sns.heatmap(df1.isnull(), cbar=True, yticklabels=False) plt.xlabel("Column_Name", size=14, weight="bold")
plt.title("Places of missing values in column",size=17) plt.show()
import plotly.graph_objects as go
Top_Location_Of_tweet= df1['place'].value_counts().head (10) print(Top_Location_Of_tweet)
def get_subjectivity(text):
return TextBlob(text).sentiment.subjectivity def get_polarity(text):
return TextBlob(text).sentiment.polarity
df1['subjectivity']=df1[ 'renderedContent'].apply(get_subjectivity)
df1[ 'polarity' ]=df1[ 'renderedContent'].apply(get_polarity) df1.head()
2. Sentiment Analysis
df_positive=textblob_df[textblob_df['textblob_sentiment']=='positive' ]
df_very_positive=df_positive[df_positive['likeCount']>0] df_very_positive.head()
df_negative=textblob_df[textblob_df['textblob_sentiment']=='Negative' ] df_negative
df_neutral=textblob_df[textblob_df['textblob_sentiment']=='Neutral' ] df_neutral
Exploratory data analysis helps to get data which is cleaned and meaningful. Twitter data is explored using textblob
package and visualization by using wordcloud package of python.
R1 R2 R3
DOP DOS Conduction File Record Viva Voice Total Signature
5 Marks 5 Marks 5 Marks 15 Marks
R1 R2 R3
DOP DOS Conduction File Record Viva Voice Total Signature
5 Marks 5 Marks 5 Marks 15 Marks