<jupyter_start><jupyter_text>Anime List Inforgraphics from the most productive studios to the top 100 ranks anime (up to date till 2018)by <NAME> has steadily been increasing in popularity in the past decade and recently due to the pandemic steaming services such as [Netflix](https://www.wsj.com/articles/the-world-is-watching-more-animeand-streaming-services-are-buying-11605365629) and HBOMax have reported an increase of viewership for the anime in their catalogWith Netflix seeing exceptional [success with anime](https://www.ign.com/articles/anime-is-becoming-a-huge-success-for-netflix) for their streaming service. With this in mind, I want to bring people attention to [MyAnimeList](https://myanimelist.net/about.php) (MAL) the world's largest anime and manga database and community. MAL, is an anime and manga social networking and social cataloging application website run by volunteers. The site provides its users with a list-like system to organize and score anime and manga. It facilitates finding users who share similar tastes and provides a large database on anime and manga. As of 2008, the site claimed to have 4.4 million anime and 775,000 manga entries.In 2015, the site received 120 million visitors a month.In this site people can register for accounts and record the anime they have seen while providing scores and an internal rankng system aggregating users scores along with many other features cattered to anime fans. The site launched in November 5, 2004 and since then has become a standard for many anime fans to record their watchlist. Culturally, if one has followed anime long enough there is a niche group of seasonal watchers who follow anime as it airs weekly and discuss on various forums. But through some webscraping we can learn a lot from the aggregated metadata possible through the api. Fortunately, there exists a dataset from Azothot on Kraggle. [MyAnimeList Dataset by Azothot on Kraggle](https://www.kaggle.com/azathoth42/myanimelist?select=anime_cleaned.csv) Dataset ContextAzothot's dataset contains information about Anime and Otaku who watch it. This dataset aims to be representative sample of internet otaku community for demographics analysis and trends inside this group. It contains information about users (gender, location, birth date etc.), about anime (airing date, genres, producer…) and anime lists.Users in MyAnimeList can add anime to their lists, and mark it as plan to watch, completed, watching, dropped…, and they can also rate it by score 1-10.Note: All information gathered here are publicly available, there was no need to be registered anywhere to access the data.In particular, the dataset I used for this post is "anime_cleaned.csv"From this dataset we'll explorer two subsets of the anime_cleaned.csva subset representing the 20 most productive studios from the datasetand a subset containing the top 100 ranked anime on MAL   Anime Trends As mentioned above, there are particular sites on dedicated to the seasonal watchers niche group of anime fans[anime trends](https://anitrendz.net/) which provides a multitude of ranking polls for the season. Their most popular being the top 10 anime ep for the week and finishing off providing the show of the season at then end. For more informaiton read their [about page](https://anitrendz.net/about)"Anime Trending is a go-to site for any anime fan, whether they’re looking for the best new anime, an exciting community to join, or industry news about upcoming releases. We, the staff at Anime Trending, release charts that feature each season’s best anime, characters, ships, and soundtracks. These charts are built completely off fan votes — including yours!With this kind of release format, we believe that we can help increase the exposure of anime that aren’t as well-known or went under the radar since other anime websites only release charts at the start or end of a season. As seasons go on, fans’ opinions will change, whether in favor of a steadily-improving anime or to knock down a hyped anime that has dropped the ball in the middle of the season — and our charts will change, too. Our chart format illustrates these changes week-by-week, which enables everyone to track an anime’s progress throughout the season. Some fans may wonder what caused a popular anime to drop a few slots, why a particular ship jumped to the top of the list, or what led an anime to finally break into the top 10."Here is the usual layout of their weekly chart  LiveChartMe [LiveChart.me](https://www.livechart.me/spring-2021/tv)Similarly to AnimeTrends, LiveChartMe is another site dedicated to seasonal fans. On here one can view when a show is about to air so they can set up their week and watch a show they're interested on without having to google when a particular show first aired as well as learn what shows are airing this season. "Launched in August 2013, LiveChart.me aggregates the latest information about new anime into seasonal anime charts and daily schedules complete with customization, episode countdowns and episode notifications."learn more about them in their [about page](https://www.livechart.me/pages/about)Here is the usual layout ![LiveChartMe Screenshot on 20210502](LiveChartMe_20210502.JPG)  MyAnimeList Azothot data vizI'll be using azothots cleaned_anime.csv to gather some information on a couple of shows and seasons ranging from source material, studio, year aired, score, rank, and popularity. This is meant to be a demonstrtion of what we can find and learn on Azothots collected data from MAL.<jupyter_code>import pandas as pd
import altair as alt
alt.renderers.enable('notebook')
anime = pd.read_csv("anime_cleaned.csv") #loading the dataset as a dataframe
anime.info() 
# This method prints information about a DataFrame 
# including the index dtype and columns, non-null values and memory usage.
anime.head() 
top100_anime = anime.loc[anime['rank']<101] # our dataset is too large. Let's work with something smaller
anime['studio'].value_counts().head(20) 
# creating a another dataframe users can parse through that contain anime from the 20 most productive studios
top20_production_studios = anime['studio'].value_counts().index[:20].tolist()
# list of the top 20 anime studios
top20_production_studios
# plan to create a list containing data frames filtered to the anime studios from the previous "production studio list"
top20_lst = []
for studio in top20_production_studios:
    studio_df = anime[anime['studio'] == studio]
    top20_lst.append(studio_df)

top20_df = pd.concat(top20_lst)
top20_df.head()
top100_anime[['score','title','rank']].sort_values('rank')<jupyter_output><empty_output><jupyter_text>Visual 1This grid map uses a subset dataset that contains the top 100 ranked anime from MyAnimeList. The x-axis is the score ranging from the lowest score of the top 100 to the highest and sectioned into bins, while the y-axis is the 100 entries. Each unit is color coded to reflect the source material the anime was adapted from (light novel, manga, novel, original, etc.) and if you move your mouse over a point a tool kit should appear providing you information of that anime like the name, animation studio, source, rank, a score.<jupyter_code># grid map of anime title and score while color coding the source

alt.Chart(top100_anime, title='Top 100 anime Grid').mark_point().encode(
    x=alt.X('score', bin=True),
    y='title',
    color='source:N',
    tooltip=['studio','title','score','source','rank']
)<jupyter_output><empty_output><jupyter_text>Visual 2The second visual contains three interactive graphs (2 scatter and 1 bar chart) from the dataset we created containing the twenty most productive anime studios. The two scatter plot are linked together. One is plotting the score vs the rank while the other plots the score vs popularity. Popularity of a show is determined by the number of viewers recorded to have seen the show as specified in MyAnimeList user database, while the rank reflects the score of the anime with respect to every anime entry. In general, one would expect higher ranked shows to be more popular. You can left click your mouse hold and drag to create a square box that will then filter out data in all three plots. You can do this in either of the scatter plots. The points are color coded by source and you can specify which color to view only by clicking a bar chart in the third graph. Doing so will grey out / filter any points not that specified source in the scatter plot.  If you move your mouse over a point in in the scatter plots a tool kit similar to the previous visual will appear providing you some metadata for the entry.<jupyter_code>brush = alt.selection(type='interval')
click = alt.selection_multi(encodings=['color'])

points = alt.Chart(
    top20_df, title='Top 20 most productive anime studio: score vs. (rank & popularity)'
).mark_point().encode(
    x='score',
    y='rank',
    tooltip=['studio:N','title:N','score:Q','rank:Q','popularity:Q'],
    color=alt.condition(brush, 'source:N', alt.value('lightgray'))
).add_selection(
    brush
).transform_filter(
    click
)

bars = alt.Chart(top20_df).mark_bar().encode(
    y='source:N',
    color=alt.condition(click,'source:N', alt.value('lightgray')),
    x='count(source):Q'
).add_selection(
    click
).transform_filter(
    brush
)

(points.encode(y='rank:Q') | points.encode(y='popularity:Q')) & bars<jupyter_output><empty_output><jupyter_text>Visual 3 This visual uses the dataset we created from the twenty most prodcutive anime studios. There are two graphs (1 grid heat map and a barchart) that are connected. If you select a grid the barchart will reflect data from the selected grid. For example, selecting ToeiAnimation and Mange grid will have the bargraph refelct anime/data that is only from ToeiAnimation and adapted from a manga.<jupyter_code># grid map shwoing the studios in the y axis and the source in the x axis 
# while the color intensity represents the count of the various source adaptions they have made 
# the darker the shade in the grid = more of that source the studio has adapted

# grid map showing the studios in the y axis and the source in the x axis 
# while the color intensity represents the count of the various source adaptions they have made 
# the darker the shade in the grid = more of that source the studio has adapted

click=alt.selection_single(encodings=['x','y'])

grid = alt.Chart(top20_df, title='top 20 most productive anime studios source material gridheat map').mark_bar().encode(
    x='source:N',
    color=alt.condition(click, 'count(source):Q', alt.value('lightgray')),
    y='studio',
    tooltip=['studio','source','count(source):Q','average(score):Q']
).add_selection(
    click
)

bar = alt.Chart(top20_df, title='average anime scores of the studio with respect to the airing year ').mark_bar().encode(
    x='aired_from_year:O',
    y='average(score):Q',
    #color='source:N'
    tooltip=['source:N','studio:N','score:Q']
).transform_filter(
    click
)



grid | bar<jupyter_output><empty_output><jupyter_text>Visual 4This visual is meant to compliment the 5th visual. Both the fourth and fifth use data from the top 100 anime datasubset. The reason this viaul compliments the fifth is because it allows you to see the counts of the anime contained in the top 100 anime dataset with respect to year. The fifth visual lets users compare years of certain anime to view the contemporaries the show had to compete with that year. Without the fourth visual the user would know which year to filter by in the fifth visual. Like previous visuals the entries are color coded by source material and moving your mouse over a base causes a tool kit to appear providing further information on that entry.<jupyter_code>counts = alt.Chart(top100_anime, title='top 100 anime years and the count of anime that aired that year').mark_bar().encode(
    x='aired_from_year:O',
    y='count(title):Q',
    color='source:N',
    tooltip=['studio','source','premiered','rank','title','title_synonyms']
)

counts<jupyter_output><empty_output><jupyter_text>Visual 5this visual benifits from knowning the total number of anime that aired in certan years, which is why the fourth visual exists. You can filter by year and view which contemporary work aired that year for the top 100 anime. Like previous visuals if you zoom over a bar a tool kit appears providing further information.<jupyter_code>click=alt.selection_single()
#encodings=['x','y']
base = alt.Chart(top100_anime).mark_bar().encode(
    x='title:N',
    y='score:Q',
    color=alt.condition(click, 'source:N', alt.value('lightgray')),
    tooltip=['studio','source','premiered','rank','title','title_synonyms']
)

# A dropdown filter
aired_from_year = sorted(top100_anime['aired_from_year'].unique())

year_dropdown = alt.binding_select(options=aired_from_year)
year_select = alt.selection_single(fields=['aired_from_year'], bind=year_dropdown, name='Anime')

filter_year = base.add_selection(
    year_select
).transform_filter(
    year_select
).properties(title="Top 100 ranked anime Score with a year filter").add_selection(
    click
)

filter_year<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07060967276592514, 'fraction_numerical': 0.01313491762204844, 'mean_word_length': 5.086876155268023, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 26, 'https://': 8, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '243376', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 3635, 'n_tokens_neox': 3401, 'n_words': 1725, 'path': 'Juarez_Final_Project_Part_03_20210512.ipynb', 'repo_name': 'lilpringles/lilpringles.github.io', 'size': '13187'}