Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 1.22 KB

File metadata and controls

25 lines (17 loc) · 1.22 KB

🐱 Exercises

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.

  1. Create a frequency table showing each country and the number of cat breeds it has.

  2. Calculate the average life span of all cats.

  3. Calculate the average weight of cats (in kilograms).

  4. Filter out all cats whose energy level is greater than 4.

  5. 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.

  6. 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

  7. Find the top 5 countries with the highest number of cat breeds.

  8. Determine how many unique words were used to describe cat temperaments.

  9. Find the top 5 cats with the longest life span.

  10. Find the 5 cats with the smallest average weight.