11: Visualizations

Distribution of Publications by Author: This bar graph indicates a relatively even distribution of article publications among various authors, with some slight variations. Authors like Field Level Media and The Associated Press appear to be the most prolific, suggesting their dominant role in content creation within the dataset. This can imply a significant influence of these entities on the media landscape covered in the study.

import pandas as pd
data=pd.read_csv('main.csv')
# Checking for missing values and summarizing the data by authors
import plotly.express as px

missing_values = data.isnull().sum()
author_distribution = data['AUTHOR'].value_counts()

author_distribution
fig = px.bar(author_distribution, 
             x=author_distribution.index, 
             y=author_distribution.values, 
             labels={'x':'Author', 'y':'Count'},
             title='Distribution of Publications by Author')
fig.show()

Analyzing Temporal Trends in Article Publications: The line graph shows the number of articles published over time, highlighting noticeable spikes and troughs. These peaks may correspond to major news events or seasonal coverage spikes, suggesting a reactive nature of publications to current events. The data visualization effectively captures the dynamic nature of news cycles, offering insights into how external events drive media output ## Analyzing Temporal Trends in Article Publications

This code converts the ‘DATE’ column to datetime format and groups the data by date to count the number of articles. It then plots these counts over time using a line graph to reveal trends.

import plotly.express as px
# Convert the 'DATE' column to datetime format
data['DATE'] = pd.to_datetime(data['DATE'])

# Group by Date and count the number of articles
date_counts = data.groupby('DATE').size().reset_index(name='counts')

# Plotting using Plotly
fig = px.line(date_counts, x='DATE', y='counts', title='Temporal Trends of Articles', labels={'counts': 'Number of Articles'})
fig.update_layout(xaxis_title='Date', yaxis_title='Number of Articles')
fig.show()

Unigrams

plot_ngrams(1)

Bigrams

plot_ngrams(2)

Trigrams

plot_ngrams(3)

Quadgrams

plot_ngrams(4)