Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "25d7736c-ba17-4aff-b6bb-66eba20fbf4e",
"metadata": {
"id": "25d7736c-ba17-4aff-b6bb-66eba20fbf4e"
},
"source": [
"# Lab | Data Structuring and Combining Data"
]
},
{
"cell_type": "markdown",
"id": "a2cdfc70-44c8-478c-81e7-2bc43fdf4986",
"metadata": {
"id": "a2cdfc70-44c8-478c-81e7-2bc43fdf4986"
},
"source": [
"## Challenge 1: Combining & Cleaning Data\n",
"\n",
"In this challenge, we will be working with the customer data from an insurance company, as we did in the two previous labs. The data can be found here:\n",
"- https://raw.githubusercontent.com/data-bootcamp-v4/data/main/file1.csv\n",
"\n",
"But this time, we got new data, which can be found in the following 2 CSV files located at the links below.\n",
"\n",
"- https://raw.githubusercontent.com/data-bootcamp-v4/data/main/file2.csv\n",
"- https://raw.githubusercontent.com/data-bootcamp-v4/data/main/file3.csv\n",
"\n",
"Note that you'll need to clean and format the new data.\n",
"\n",
"Observation:\n",
"- One option is to first combine the three datasets and then apply the cleaning function to the new combined dataset\n",
"- Another option would be to read the clean file you saved in the previous lab, and just clean the two new files and concatenate the three clean datasets"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "492d06e3-92c7-4105-ac72-536db98d3244",
"metadata": {
"id": "492d06e3-92c7-4105-ac72-536db98d3244"
},
"outputs": [],
"source": [
"# Your code goes here"
]
},
{
"cell_type": "markdown",
"id": "31b8a9e7-7db9-4604-991b-ef6771603e57",
"metadata": {
"id": "31b8a9e7-7db9-4604-991b-ef6771603e57"
},
"source": [
"# Challenge 2: Structuring Data"
]
},
{
"cell_type": "markdown",
"id": "a877fd6d-7a0c-46d2-9657-f25036e4ca4b",
"metadata": {
"id": "a877fd6d-7a0c-46d2-9657-f25036e4ca4b"
},
"source": [
"In this challenge, we will continue to work with customer data from an insurance company, but we will use a dataset with more columns, called marketing_customer_analysis.csv, which can be found at the following link:\n",
"\n",
"https://raw.githubusercontent.com/data-bootcamp-v4/data/main/marketing_customer_analysis_clean.csv\n",
"\n",
"This dataset contains information such as customer demographics, policy details, vehicle information, and the customer's response to the last marketing campaign. Our goal is to explore and analyze this data by performing data cleaning, formatting, and structuring."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "aa10d9b0-1c27-4d3f-a8e4-db6ab73bfd26",
"metadata": {
"id": "aa10d9b0-1c27-4d3f-a8e4-db6ab73bfd26"
},
"outputs": [],
"source": [
"# Your code goes here"
]
},
{
"cell_type": "markdown",
"id": "df35fd0d-513e-4e77-867e-429da10a9cc7",
"metadata": {
"id": "df35fd0d-513e-4e77-867e-429da10a9cc7"
},
"source": [
"1. You work at the marketing department and you want to know which sales channel brought the most sales in terms of total revenue. Using pivot, create a summary table showing the total revenue for each sales channel (branch, call center, web, and mail).\n",
"Round the total revenue to 2 decimal points. Analyze the resulting table to draw insights."
]
},
{
"cell_type": "markdown",
"id": "640993b2-a291-436c-a34d-a551144f8196",
"metadata": {
"id": "640993b2-a291-436c-a34d-a551144f8196"
},
"source": [
"2. Create a pivot table that shows the average customer lifetime value per gender and education level. Analyze the resulting table to draw insights."
]
},
{
"cell_type": "markdown",
"id": "32c7f2e5-3d90-43e5-be33-9781b6069198",
"metadata": {
"id": "32c7f2e5-3d90-43e5-be33-9781b6069198"
},
"source": [
"## Bonus\n",
"\n",
"You work at the customer service department and you want to know which months had the highest number of complaints by policy type category. Create a summary table showing the number of complaints by policy type and month.\n",
"Show it in a long format table."
]
},
{
"cell_type": "markdown",
"id": "e3d09a8f-953c-448a-a5f8-2e5a8cca7291",
"metadata": {
"id": "e3d09a8f-953c-448a-a5f8-2e5a8cca7291"
},
"source": [
"*In data analysis, a long format table is a way of structuring data in which each observation or measurement is stored in a separate row of the table. The key characteristic of a long format table is that each column represents a single variable, and each row represents a single observation of that variable.*\n",
"\n",
"*More information about long and wide format tables here: https://www.statology.org/long-vs-wide-data/*"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3a069e0b-b400-470e-904d-d17582191be4",
"metadata": {
"id": "3a069e0b-b400-470e-904d-d17582191be4"
},
"outputs": [],
"source": [
"# Your code goes here"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading