Marvel is committed to bringing great stories, characters, and experiences to fans all over the world. We strive to foster an inclusive, diverse, respectful, and safe environment for all of our fans, and we ask the same of our fan communities
is founded. Established as a joint venture between News Corporation and NBC Universal, and later Providence Equity Partners and The Walt Disney Company.
s a TV network created by Oprah Winfrey that provides top-tier TV shows by well-known creators. Stream TV dramas, reality series, docu-series and more.
is your home for all the latest celebrity, music, fashion, entertainment and African-American news
is an American film studio currently owned by the Walt Disney Studios, a division of Disney Entertainment, in turn a division of The Walt Disney Company. It is headquartered at the Fox Studio Lot in the Century City area of Los Angeles
is an American film and television production and distribution company and the namesake division of Paramount Global.
# lets import libraries
from googleapiclient.discovery import build
import pandas as pd
import seaborn as sns
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Marvel_Entertainment_channel_id = ['UCvC4D8onUfXzvjTOM-dBfEA' # Marvel Entertainment
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Marvel_Entertainment_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Marvel_Entertainment_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube, Marvel_Entertainment_channel_id)
[{'Channel_name': 'Marvel Entertainment', 'Subscribers': '20300000', 'Views': '5855379161', 'Total_videos': '8854'}]
Marvel_Entertainment_channel_statistics = get_channel_stats(youtube, Marvel_Entertainment_channel_id)
Marvel_Entertainment_channel_data =pd.DataFrame(Marvel_Entertainment_channel_statistics)
Marvel_Entertainment_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Marvel Entertainment | 20300000 | 5855379161 | 8854 |
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Hulu_Studios_channel_id = ['UCE5mQnNl8Q4H2qcv4ikaXeA' # Hulu_Studios
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Hulu_Studios_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Hulu_Studios_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube, Hulu_Studios_channel_id)
[{'Channel_name': 'Hulu', 'Subscribers': '2310000', 'Views': '784639767', 'Total_videos': '2767'}]
Hulu_Studios_channel_statistics = get_channel_stats(youtube, Hulu_Studios_channel_id)
Hulu_Studios_channel_data =pd.DataFrame(Hulu_Studios_channel_statistics)
Hulu_Studios_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Hulu | 2310000 | 784639767 | 2767 |
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
OWN_channel_id = ['UCKBnlTTgEnhIXv_c4LvvyMQ' # OWN
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, OWN_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(OWN_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube, OWN_channel_id)
[{'Channel_name': 'OWN', 'Subscribers': '5730000', 'Views': '2912620718', 'Total_videos': '19550'}]
OWN_channel_statistics = get_channel_stats(youtube, OWN_channel_id)
OWN_channel_data =pd.DataFrame(OWN_channel_statistics)
OWN_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | OWN | 5730000 | 2912620718 | 19550 |
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
BET_channel_id = ['UCKBnlTTgEnhIXv_c4LvvyMQ' # BET
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, BET_channel_id ):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(BET_channel_id )
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube, BET_channel_id)
[{'Channel_name': 'OWN', 'Subscribers': '5730000', 'Views': '2912620718', 'Total_videos': '19550'}]
BET_channel_statistics = get_channel_stats(youtube, BET_channel_id)
BET_channel_data =pd.DataFrame(BET_channel_statistics)
BET_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | BETNetworks | 4530000 | 2106379237 | 9285 |
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Century_Studios_channel_id = ['UC2-BeLxzUBSs0uSrmzWhJuQ' # 20th Century Studios
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Century_Studios_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Century_Studios_channel_id )
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube, Century_Studios_channel_id )
[{'Channel_name': '20th Century Studios', 'Subscribers': '4680000', 'Views': '2933613571', 'Total_videos': '2728'}]
channel_statistics = get_channel_stats(youtube, Century_Studios_channel_id )
Century_Studios_channel_data =pd.DataFrame(channel_statistics)
Century_Studios_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | 20th Century Studios | 4680000 | 2933613571 | 2728 |
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Paramount_Pictures_channel_id = ['UCF9imwPMSGz4Vq1NiTWCC7g' # Paramount Pictures
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Paramount_Pictures_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Paramount_Pictures_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube, Paramount_Pictures_channel_id)
[{'Channel_name': 'Paramount Pictures', 'Subscribers': '3290000', 'Views': '2506983750', 'Total_videos': '1799'}]
Paramount_Pictures_channel_statistics = get_channel_stats(youtube, Paramount_Pictures_channel_id)
Paramount_Pictures_channell_data =pd.DataFrame(channel_statistics)
Paramount_Pictures_channell_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | BETNetworks | 4530000 | 2106379237 | 9285 |
# Combine DataFrames using concat
combined_movie_studios_channels_df= pd.concat([Marvel_Entertainment_channel_data ,
Hulu_Studios_channel_data,
OWN_channel_data ,
BET_channel_data ,
Century_Studios_channel_data,
Paramount_Pictures_channell_data,
], ignore_index=True)
# Display the result
print(combined_movie_studios_channels_df)
Channel_name Subscribers Views Total_videos 0 Marvel Entertainment 20300000 5855379161 8854 1 Hulu 2310000 784639767 2767 2 OWN 5730000 2912620718 19550 3 BETNetworks 4530000 2106379237 9285 4 20th Century Studios 4680000 2933613571 2728 5 BETNetworks 4530000 2106379237 9285
# letc change the data types
combined_movie_studios_channels_df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 6 entries, 0 to 5 Data columns (total 4 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Channel_name 6 non-null object 1 Subscribers 6 non-null object 2 Views 6 non-null object 3 Total_videos 6 non-null object dtypes: object(4) memory usage: 324.0+ bytes
# lets change the datatypes to perform visualisations
combined_movie_studios_channels_df['Subscribers'] = pd.to_numeric(combined_movie_studios_channels_df['Subscribers'])
combined_movie_studios_channels_df['Views'] = pd.to_numeric(combined_movie_studios_channels_df['Views'])
combined_movie_studios_channels_df['Total_videos'] = pd.to_numeric(combined_movie_studios_channels_df['Total_videos'])
# letsconirm if the datatypes has changed
combined_movie_studios_channels_df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 6 entries, 0 to 5 Data columns (total 4 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Channel_name 6 non-null object 1 Subscribers 6 non-null int64 2 Views 6 non-null int64 3 Total_videos 6 non-null int64 dtypes: int64(3), object(1) memory usage: 324.0+ bytes
combined_movie_studios_channels_df
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Marvel Entertainment | 20300000 | 5855379161 | 8854 |
1 | Hulu | 2310000 | 784639767 | 2767 |
2 | OWN | 5730000 | 2912620718 | 19550 |
3 | BETNetworks | 4530000 | 2106379237 | 9285 |
4 | 20th Century Studios | 4680000 | 2933613571 | 2728 |
5 | BETNetworks | 4530000 | 2106379237 | 9285 |
import matplotlib.pyplot as plt
# Sort the DataFrame by 'Subscribers' in descending order
combined_movie_studios_channels_df_subscribers_sorted = combined_movie_studios_channels_df.sort_values(by='Subscribers', ascending=False)
# Plotting Subscribers in descending order
fig, axes = plt.subplots(nrows=3, ncols=1, figsize=(10, 15))
axes[0].bar(combined_movie_studios_channels_df_subscribers_sorted['Channel_name'], combined_movie_studios_channels_df_subscribers_sorted['Subscribers'], color='blue')
axes[0].set_title('Subscribers')
# Sort the DataFrame by 'Views' in descending order
combined_movie_studios_channels_df_views_sorted = combined_movie_studios_channels_df.sort_values(by='Views', ascending=False)
# Plotting Views in descending order
axes[1].bar(combined_movie_studios_channels_df_views_sorted['Channel_name'], combined_movie_studios_channels_df_views_sorted['Views'], color='green')
axes[1].set_title('Views')
# Sort the DataFrame by 'Total_videos' in descending order
combined_movie_studios_channels_df_total_videos_sorted = combined_movie_studios_channels_df.sort_values(by='Total_videos', ascending=False)
# Plotting Total Videos in descending order
axes[2].bar(combined_movie_studios_channels_df_total_videos_sorted['Channel_name'], combined_movie_studios_channels_df_total_videos_sorted['Total_videos'], color='orange')
axes[2].set_title('Total Videos')
# Adjust layout for better visibility
plt.tight_layout()
# Show the plot
plt.show()