Cats vs Dogs: The Great Pet Debate ๐ฑ๐ถ
๐ Background
You and your friend have debated for years whether cats or dogs make more popular pets. You finally decide to settle the score by analyzing pet data across different regions of the UK. Your friend found data on estimated pet populations, average pets per household, and geographic factors across UK postal code areas. It's time to dig into the numbers and settle the cat vs. dog debate!
๐พ The data
There are three data files, which contains the data as follows below.
The population_per_postal_code.csv
data contains these columns:
population_per_postal_code.csv
data contains these columns:Column | Description |
---|---|
postal_code | An identifier for each postal code area |
estimated_cat_population | The estimated cat population for the postal code area |
estimated_dog_population | The estimated cat population for the postal code area |
The avg_per_household.csv
data contains these columns:
avg_per_household.csv
data contains these columns:Column | Description |
---|---|
postal_code | An identifier for each postal code area |
cats_per_household | The average number of cats per household in the postal code area |
dog_per_household | The average number of dogs per household in the postal code area |
The postal_code_areas.csv
data contains these columns:
postal_code_areas.csv
data contains these columns:Column | Description |
---|---|
postal_code | An identifier for each postal code area |
town | The town/towns which are contained in the postal code area |
county | The UK county that the postal code area is located in |
population | The population of people in each postal code area |
num_households | The number of households in each postal code area |
uk_region | The region in the UK which the postal code is located in |
*Acknowledgments: Data has been assembled and modified from two different sources: Animal and Plant Health Agency, Postcodes.
!pip install waterfallcharts
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
import waterfall_chart
population_raw_data = pd.read_csv('data/population_per_postal_code.csv')
population_raw_data
avg_raw_data = pd.read_csv('data/avg_per_household.csv')
avg_raw_data
postcodes_raw_data = pd.read_csv('data/postal_codes_areas.csv')
postcodes_raw_data
๐ช Challenge
Leverage the pet data to analyze and compare cat vs. dog rates across different regions of the UK. Your goal is to identify factors associated with higher cat or dog popularity.
Some examples:
- Examine if pet preferences correlate to estimated pet populations, or geographic regions. Create visualizations to present your findings.
- Develop an accessible summary of study findings on factors linked to cat and dog ownership rates for non-technical audiences.
- See if you can identify any regional trends; which areas prefer cats vs. dogs?
๐งโโ๏ธ Judging criteria
This competition is for helping to understand how competitions work. This competition will not be judged.
โ
Checklist before publishing into the competition
- Rename your workspace to make it descriptive of your work. N.B. you should leave the notebook name as notebook.ipynb.
- Remove redundant cells like the judging criteria, so the workbook is focused on your story.
- Make sure the workbook reads well and explains how you found your insights.
- Try to include an executive summary of your recommendations at the beginning.
- Check that all the cells run without error.
Executive Summary
People living in the UK follow a similar trend in adopting cats and dogs.
It is observed that the rate of adoption of cats and dogs decreases with the increase in population.
In every region and county of the UK, dog adoption is more common rather than cat adoption.
Compare to big cities, in rural region where the population is lower compare the others, people have much dogs or cats
created by : Alper ลAHฤฐN createdat : 16 March 2024
โ๏ธ Time is ticking. Good luck!
Population per postal code
population_raw_data.info()
# There is no missing values in population raw data.
population_raw_data.head(3)
โ
โ