Apply different methods such as Functional programming(map, filter, reduce), list comprehension to solve the problem. Use the cats data from this JSON file to solve the following problems.
-
Create a frequency table showing each country and the number of cat breeds it has.
-
Calculate the average life span of all cats.
-
Calculate the average weight of cats (in kilograms).
-
Filter out all cats whose energy level is greater than 4.
-
Concatenate all the description texts, then find the 10 most frequent words. You may also use worldcloud package and create a word cloud of the description.
-
Create a list of all cat image URLs by concatenating:
image_url = 'https://cdn2.thecatapi.com/images/' + reference_image_id + '.jpg'
👉 Example:
https://cdn2.thecatapi.com/images/0XYvRd7oD.jpg -
Find the top 5 countries with the highest number of cat breeds.
-
Determine how many unique words were used to describe cat temperaments.
-
Find the top 5 cats with the longest life span.
-
Find the 5 cats with the smallest average weight.