How Much Do You Know About Anime?: Filtering, Selection and Sorting
How Much Do You Know About Anime?: Filtering, Selection and Sorting Data Science Project
Intro to Pandas for Data Analysis

How Much Do You Know About Anime?: Filtering, Selection and Sorting

This project guides you through an anime dataset with information about thousands of anime. It contains a lot of activities that challenges you to practice filtering, selection and sorting skills you've learned before. Come on it's time to dive in and crush it!
Start this project
How Much Do You Know About Anime?: Filtering, Selection and SortingHow Much Do You Know About Anime?: Filtering, Selection and Sorting
Project Created by

Lohith Unnam

Project Activities

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

codevalidated

Select the first 7 rows of the dataset

Choose the initial seven rows from the dataframe and assign them to a variable named first_seven_rows.

This is how your result will look like:

Activity 01

codevalidated

Select the last nine records

Select the last nine rows of the dataset and store them in a variable named last_nine_rows.

This is how your result will look like:

Activity 02

codevalidated

Select the `Release_Year` column

Store the selected column in year_df. Make sure year_df is a DataFrame. As specified before, try to use .iloc[]

This is how your result will look like:

Activity 03

codevalidated

Select rows 3 to 6 and extract only the `Title` and `Genres` columns

Store the resulting dataframe in variable named selected_rows_cols. Remember that indices in Python/Pandas are 0-based, so the 3rd row is indexed as 2.

This is how your result will look like:

Activity 04

codevalidated

Select the `Episodes` column

Store the selected column in the variable episodes_df. Make sure episodes_df is a DataFrame.

This is how your result will look like:

Activity 05

codevalidated

Select the popularity scores of anime from rows 200 to 300, Inclusive

Extract the popularity scores for all anime between the 200th and 300th entry (including both the 200th and 300th entries) and store them in pop_200_300_df variable. Remember that indices in Python/Pandas are 0-based, so the 400th row is indexed as 399.

This is how your result will look like:

Activity 06

codevalidated

Select the anime that were released in the year 2018 and store them in `released_2018`

This is how your result will look like:

Activity 07

input

How many anime were released in `Spring 2022`

Please enter the number of anime released during the spring season of the year 2022.

multiplechoice

Which of the following anime have a single episode ?

Select anime from the options below that have only a single episode.

codevalidated

Select anime for which the `Release Date` is missing

Select the rows that do not contain a release date and store them in the missing_release_date.

This is how your result will look like:

Activity 10

codevalidated

Select the anime that belong to `Action,Comedy,Sci-Fi` in `Genres` column, Only select `Title`, `Score`

Store the resulting dataframe in specific_genre_df variable.

This is how your result will look like:

Activity 11

input

What is the popularity value that marks the top 1% of anime?

We will round the number to the nearest thousand. For example, if the value obtained is 15700, then the rounded value would be 16000.

codevalidated

Select the anime that have a popularity score greater than `14000`

Store the resulting dataframe in a variable named high_popularity_df.

This is how your result will look like:

Activity 13

codevalidated

Select the anime that have an episode length less than or equal to 5

Select the rows based on the above specified condition and store them in less_episode_length_df variable.

This is how your result will look like:

Activity 14

input

What percentage of anime episodes last half an hour or more ?

Please enter the percentage of anime with episodes duration exceeding half an hour, rounded to two decimal points. For example, if the value is 3.4321, then enter 3.43.

codevalidated

Select the anime that released after 2020, Select only `Title` and `Release_Year` columns

Store the resulting dataframe in filtered_year variable.

This is how your result will look like:

Activity 16

codevalidated

What are the anime that were released in 2015 ?

Filter the data to only include anime that were released in 2015 and store them in anime_2015 variable.

This is how your result will look like:

Activity 17

codevalidated

Filter the dataset to select the anime that belong to genre `Comedy,Slice of Life`

Store the resulting dataframe in a variable named comedy_slice_of_life_df.

This is how your result will look like:

Activity 18

input

How many anime consist of precisely ten episodes ?

Please enter the count of anime specifically having ten episode.

codevalidated

Filter the dataset on the given condition

Select the anime that have less than 5 episodes and store them in episodes_less_than_five variable.

This is how your result will look like:

Activity 20

codevalidated

Filter the dataset on the given condition

Select the anime which have score equal or above 9 and store them in a variable named high_score_anime.

This is how your result will look like:

Activity 21

multiplechoice

Which of the following Anime are in Top 10 Anime's based on Rank ?

codevalidated

Filter the dataset on the specified condition

Filter the dataset to only include entries where the Popularity is greater than 1000 and the Score is greater than 8.5. Then store the resulting dataframe in filtered_popular_score variable.

This is how your result will look like:

Activity 23

codevalidated

Filtering Dataset for Recent Releases and High Popularity

Filter the dataset to only include anime that were released in and after 2020 and have a popularity score above 9000. Store the resulting dataframe in recent_popular_anime variable.

This is how your result will look like:

Activity 24

codevalidated

Filtering Based on three conditions

Filter the dataframe to only include entries where the Episodes is greater than 20 and less than 30, and the Rank is less than 20. Then store the resulting dataframe in filtered_data variable.

This is how your result will look like:

Activity 25

codevalidated

Sort the dataframe by single column

Sort the dataframe based on Rank column in ascending order and store it in sorted_rank_df variable.

This is how your result will look like:

Activity 26

codevalidated

Sort in descending order

Sort the dataframe in descending order based on Popularity column and store the resulting dataframe in popularity_desc_df variable.

This is how your result will look like:

Activity 27

codevalidated

Sort by Multiple Columns

Sort the dataframe based on two columns Popularity and Score in ascending order. Store the result in sorted_pop_score_df variable.

This is how your result will look like:

Activity 28

input

What is the title of the first anime when the dataframe is sorted by the `Genres` column ?

Enter the title of the first anime in the sorted dataframe, where the dataframe is sorted in ascending order based on the Genres column.

codevalidated

Select anime released in 2017 that have more than 20 episodes

Store the resulting dataframe in a variable named df_2017_more_than_20_episodes.

This is how your result will look like:

Activity 30

codevalidated

Choose anime that were released during either `Spring 2009` or `Summer 2009`

Select the anime which were released in either Spring 2009 or Summer 2009 and store them in spring_summer_2009_df.

This is how your result will look like:

Activity 31

codevalidated

Find anime that do not belong to the genre `Action,Adventure`

Store the resulting dataframe in a variable named not_act_adv_df.

This is how your result will look like:

Activity 32

codevalidated

Popularity Range Sorting

Select the records where the popularity is between 7500 and 8000 (inclusive), then sort them based on popularity in ascending order, and store them in pop_range_sorted_df.

This is how your result will look like:

Activity 33

input

What is the score of the anime ranked lowest in the genres `Drama,Sci-Fi`?

Enter the rating of the anime categorized under Drama,Sci-Fi with the highest value in the 'Rank' column. Remember, in the context of ranks, lower numerical values indicate higher ranks, while higher numerical values indicate lower ranks.

codevalidated

Anime Selection & Ranking (2017-2019)

Select the anime that were released between 2017 and 2019 (inclusive), then sort it based on Score in descending order and store the resulting dataframe in anime_2017_2019_df.

This is how your result will look like:

Activity 35

codevalidated

Select and sort the dataframe based on the given conditions, then store it in `last_activity_df`

Select anime that belong to genre Action,Comedy, having a popularity score above 50, consisting of fewer than 100 episodes, and released between 2015 and 2019 (inclusive). Sort them based on episode length in ascending order.

This is how your result will look like:

Activity 36

How Much Do You Know About Anime?: Filtering, Selection and SortingHow Much Do You Know About Anime?: Filtering, Selection and Sorting
Project Created by

Lohith Unnam

I'm an undergraduate student majoring in Computer Science and Engineering with a focus on Artificial Intelligence and Machine Learning. I have a strong passion for programming and AI. I aim to make meaningful contributions to the field of AI.

I'm an undergraduate student majoring in Computer Science and Engineering with a focus on Artificial Intelligence and Machine Learning. I have a strong passion for programming and AI. I aim to make meaningful contributions to the field of AI.

This project is part of

Intro to Pandas for Data Analysis

Explore other projects