From c31e090ac4c9c07ff9593e1be06ef6e61607a9fe Mon Sep 17 00:00:00 2001
From: Vladimir Tesar <82026936+TajomnyTien@users.noreply.github.com>
Date: Sat, 9 Sep 2023 14:37:06 +0200
Subject: [PATCH] Add files via upload
---
your-code/main.ipynb | 1398 +++++++++++++++++++++++++++++++++---------
1 file changed, 1119 insertions(+), 279 deletions(-)
diff --git a/your-code/main.ipynb b/your-code/main.ipynb
index b2b6f8d..20465e0 100644
--- a/your-code/main.ipynb
+++ b/your-code/main.ipynb
@@ -1,279 +1,1119 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Before your start:\n",
- "- Read the README.md file\n",
- "- Comment as much as you can and use the resources (README.md file)\n",
- "- Happy learning!"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# import numpy and pandas\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Challenge 1 - Exploring the Data\n",
- "\n",
- "In this challenge, we will examine all salaries of employees of the City of Chicago. We will start by loading the dataset and examining its contents."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Examine the `salaries` dataset using the `head` function below."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "We see from looking at the `head` function that there is quite a bit of missing data. Let's examine how much missing data is in each column. Produce this output in the cell below"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Let's also look at the count of hourly vs. salaried employees. Write the code in the cell below"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "What this information indicates is that the table contains information about two types of employees - salaried and hourly. Some columns apply only to one type of employee while other columns only apply to another kind. This is why there are so many missing values. Therefore, we will not do anything to handle the missing values."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "There are different departments in the city. List all departments and the count of employees in each department."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Challenge 2 - Hypothesis Tests\n",
- "\n",
- "In this section of the lab, we will test whether the hourly wage of all hourly workers is significantly different from $30/hr. Import the correct one sample test function from scipy and perform the hypothesis test for a 95% two sided confidence interval."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "We are also curious about salaries in the police force. The chief of police in Chicago claimed in a press briefing that salaries this year are higher than last year's mean of $86000/year a year for all salaried employees. Test this one sided hypothesis using a 95% confidence interval.\n",
- "\n",
- "Hint: A one tailed test has a p-value that is half of the two tailed p-value. If our hypothesis is greater than, then to reject, the test statistic must also be positive."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Using the `crosstab` function, find the department that has the most hourly workers. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "The workers from the department with the most hourly workers have complained that their hourly wage is less than $35/hour. Using a one sample t-test, test this one-sided hypothesis at the 95% confidence level."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Challenge 3: To practice - Constructing Confidence Intervals\n",
- "\n",
- "While testing our hypothesis is a great way to gather empirical evidence for accepting or rejecting the hypothesis, another way to gather evidence is by creating a confidence interval. A confidence interval gives us information about the true mean of the population. So for a 95% confidence interval, we are 95% sure that the mean of the population is within the confidence interval. \n",
- ").\n",
- "\n",
- "To read more about confidence intervals, click [here](https://en.wikipedia.org/wiki/Confidence_interval).\n",
- "\n",
- "\n",
- "In the cell below, we will construct a 95% confidence interval for the mean hourly wage of all hourly workers. \n",
- "\n",
- "The confidence interval is computed in SciPy using the `t.interval` function. You can read more about this function [here](https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.t.html).\n",
- "\n",
- "To compute the confidence interval of the hourly wage, use the 0.95 for the confidence level, number of rows - 1 for degrees of freedom, the mean of the sample for the location parameter and the standard error for the scale. The standard error can be computed using [this](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.sem.html) function in SciPy."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Now construct the 95% confidence interval for all salaried employeed in the police in the cell below."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Bonus Challenge - Hypothesis Tests of Proportions\n",
- "\n",
- "Another type of one sample test is a hypothesis test of proportions. In this test, we examine whether the proportion of a group in our sample is significantly different than a fraction. \n",
- "\n",
- "You can read more about one sample proportion tests [here](http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/SAS/SAS6-CategoricalData/SAS6-CategoricalData2.html).\n",
- "\n",
- "In the cell below, use the `proportions_ztest` function from `statsmodels` to perform a hypothesis test that will determine whether the number of hourly workers in the City of Chicago is significantly different from 25% at the 95% confidence level."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Your code here:\n",
- "\n"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "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.7.3"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Before your start:\n",
+ "- Read the README.md file\n",
+ "- Comment as much as you can and use the resources (README.md file)\n",
+ "- Happy learning!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import numpy as np\n",
+ "import pandas as pd"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Challenge 1 - Exploring the Data\n",
+ "\n",
+ "In this challenge, we will examine all salaries of employees of the City of Chicago. We will start by loading the dataset and examining its contents."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Name | \n",
+ " Job Titles | \n",
+ " Department | \n",
+ " Full or Part-Time | \n",
+ " Salary or Hourly | \n",
+ " Typical Hours | \n",
+ " Annual Salary | \n",
+ " Hourly Rate | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " AARON, JEFFERY M | \n",
+ " SERGEANT | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 101442.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " AARON, KARINA | \n",
+ " POLICE OFFICER (ASSIGNED AS DETECTIVE) | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 94122.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " AARON, KIMBERLEI R | \n",
+ " CHIEF CONTRACT EXPEDITER | \n",
+ " GENERAL SERVICES | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 101592.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " ABAD JR, VICENTE M | \n",
+ " CIVIL ENGINEER IV | \n",
+ " WATER MGMNT | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 110064.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " ABASCAL, REECE E | \n",
+ " TRAFFIC CONTROL AIDE-HOURLY | \n",
+ " OEMC | \n",
+ " P | \n",
+ " Hourly | \n",
+ " 20.0 | \n",
+ " NaN | \n",
+ " 19.86 | \n",
+ "
\n",
+ " \n",
+ " | 5 | \n",
+ " ABBASI, CHRISTOPHER | \n",
+ " STAFF ASST TO THE ALDERMAN | \n",
+ " CITY COUNCIL | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 50436.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 6 | \n",
+ " ABBATACOLA, ROBERT J | \n",
+ " ELECTRICAL MECHANIC | \n",
+ " AVIATION | \n",
+ " F | \n",
+ " Hourly | \n",
+ " 40.0 | \n",
+ " NaN | \n",
+ " 46.10 | \n",
+ "
\n",
+ " \n",
+ " | 7 | \n",
+ " ABBATE, JOSEPH L | \n",
+ " POOL MOTOR TRUCK DRIVER | \n",
+ " STREETS & SAN | \n",
+ " F | \n",
+ " Hourly | \n",
+ " 40.0 | \n",
+ " NaN | \n",
+ " 35.60 | \n",
+ "
\n",
+ " \n",
+ " | 8 | \n",
+ " ABBATEMARCO, JAMES J | \n",
+ " FIRE ENGINEER-EMT | \n",
+ " FIRE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 103350.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 9 | \n",
+ " ABBATE, TERRY M | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 93354.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 10 | \n",
+ " ABBOTT, BETTY L | \n",
+ " FOSTER GRANDPARENT | \n",
+ " FAMILY & SUPPORT | \n",
+ " P | \n",
+ " Hourly | \n",
+ " 20.0 | \n",
+ " NaN | \n",
+ " 2.65 | \n",
+ "
\n",
+ " \n",
+ " | 11 | \n",
+ " ABDALLAH, ZAID | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 84054.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 12 | \n",
+ " ABDELHADI, ABDALMAHD | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 87006.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 13 | \n",
+ " ABDELLATIF, AREF R | \n",
+ " FIREFIGHTER (PER ARBITRATORS AWARD)-PARAMEDIC | \n",
+ " FIRE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 102228.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 14 | \n",
+ " ABDELMAJEID, AZIZ | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 84054.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 15 | \n",
+ " ABDOLLAHZADEH, ALI | \n",
+ " FIREFIGHTER/PARAMEDIC | \n",
+ " FIRE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 91272.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 16 | \n",
+ " ABDUL-KARIM, MUHAMMAD A | \n",
+ " ENGINEERING TECHNICIAN VI | \n",
+ " WATER MGMNT | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 111492.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 17 | \n",
+ " ABDULLAH, DANIEL N | \n",
+ " FIREFIGHTER-EMT | \n",
+ " FIRE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 95484.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 18 | \n",
+ " ABDULLAH, LAKENYA N | \n",
+ " CROSSING GUARD | \n",
+ " OEMC | \n",
+ " P | \n",
+ " Hourly | \n",
+ " 20.0 | \n",
+ " NaN | \n",
+ " 17.68 | \n",
+ "
\n",
+ " \n",
+ " | 19 | \n",
+ " ABDULLAH, RASHAD | \n",
+ " ELECTRICAL MECHANIC (AUTOMOTIVE) | \n",
+ " GENERAL SERVICES | \n",
+ " F | \n",
+ " Hourly | \n",
+ " 40.0 | \n",
+ " NaN | \n",
+ " 46.10 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Name Job Titles \\\n",
+ "0 AARON, JEFFERY M SERGEANT \n",
+ "1 AARON, KARINA POLICE OFFICER (ASSIGNED AS DETECTIVE) \n",
+ "2 AARON, KIMBERLEI R CHIEF CONTRACT EXPEDITER \n",
+ "3 ABAD JR, VICENTE M CIVIL ENGINEER IV \n",
+ "4 ABASCAL, REECE E TRAFFIC CONTROL AIDE-HOURLY \n",
+ "5 ABBASI, CHRISTOPHER STAFF ASST TO THE ALDERMAN \n",
+ "6 ABBATACOLA, ROBERT J ELECTRICAL MECHANIC \n",
+ "7 ABBATE, JOSEPH L POOL MOTOR TRUCK DRIVER \n",
+ "8 ABBATEMARCO, JAMES J FIRE ENGINEER-EMT \n",
+ "9 ABBATE, TERRY M POLICE OFFICER \n",
+ "10 ABBOTT, BETTY L FOSTER GRANDPARENT \n",
+ "11 ABDALLAH, ZAID POLICE OFFICER \n",
+ "12 ABDELHADI, ABDALMAHD POLICE OFFICER \n",
+ "13 ABDELLATIF, AREF R FIREFIGHTER (PER ARBITRATORS AWARD)-PARAMEDIC \n",
+ "14 ABDELMAJEID, AZIZ POLICE OFFICER \n",
+ "15 ABDOLLAHZADEH, ALI FIREFIGHTER/PARAMEDIC \n",
+ "16 ABDUL-KARIM, MUHAMMAD A ENGINEERING TECHNICIAN VI \n",
+ "17 ABDULLAH, DANIEL N FIREFIGHTER-EMT \n",
+ "18 ABDULLAH, LAKENYA N CROSSING GUARD \n",
+ "19 ABDULLAH, RASHAD ELECTRICAL MECHANIC (AUTOMOTIVE) \n",
+ "\n",
+ " Department Full or Part-Time Salary or Hourly Typical Hours \\\n",
+ "0 POLICE F Salary NaN \n",
+ "1 POLICE F Salary NaN \n",
+ "2 GENERAL SERVICES F Salary NaN \n",
+ "3 WATER MGMNT F Salary NaN \n",
+ "4 OEMC P Hourly 20.0 \n",
+ "5 CITY COUNCIL F Salary NaN \n",
+ "6 AVIATION F Hourly 40.0 \n",
+ "7 STREETS & SAN F Hourly 40.0 \n",
+ "8 FIRE F Salary NaN \n",
+ "9 POLICE F Salary NaN \n",
+ "10 FAMILY & SUPPORT P Hourly 20.0 \n",
+ "11 POLICE F Salary NaN \n",
+ "12 POLICE F Salary NaN \n",
+ "13 FIRE F Salary NaN \n",
+ "14 POLICE F Salary NaN \n",
+ "15 FIRE F Salary NaN \n",
+ "16 WATER MGMNT F Salary NaN \n",
+ "17 FIRE F Salary NaN \n",
+ "18 OEMC P Hourly 20.0 \n",
+ "19 GENERAL SERVICES F Hourly 40.0 \n",
+ "\n",
+ " Annual Salary Hourly Rate \n",
+ "0 101442.0 NaN \n",
+ "1 94122.0 NaN \n",
+ "2 101592.0 NaN \n",
+ "3 110064.0 NaN \n",
+ "4 NaN 19.86 \n",
+ "5 50436.0 NaN \n",
+ "6 NaN 46.10 \n",
+ "7 NaN 35.60 \n",
+ "8 103350.0 NaN \n",
+ "9 93354.0 NaN \n",
+ "10 NaN 2.65 \n",
+ "11 84054.0 NaN \n",
+ "12 87006.0 NaN \n",
+ "13 102228.0 NaN \n",
+ "14 84054.0 NaN \n",
+ "15 91272.0 NaN \n",
+ "16 111492.0 NaN \n",
+ "17 95484.0 NaN \n",
+ "18 NaN 17.68 \n",
+ "19 NaN 46.10 "
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Your code here:\n",
+ "data = pd.read_csv(r\"C:\\Users\\Vladimir\\Desktop\\Ironhack_labs\\Week13\\lab-hypothesis-testing-1\\your-code\\Current_Employee_Names__Salaries__and_Position_Titles.csv\")\n",
+ "data.head(20)\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Examine the `salaries` dataset using the `head` function below."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Name | \n",
+ " Job Titles | \n",
+ " Department | \n",
+ " Full or Part-Time | \n",
+ " Salary or Hourly | \n",
+ " Typical Hours | \n",
+ " Annual Salary | \n",
+ " Hourly Rate | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " AARON, JEFFERY M | \n",
+ " SERGEANT | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 101442.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " AARON, KARINA | \n",
+ " POLICE OFFICER (ASSIGNED AS DETECTIVE) | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 94122.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " AARON, KIMBERLEI R | \n",
+ " CHIEF CONTRACT EXPEDITER | \n",
+ " GENERAL SERVICES | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 101592.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " ABAD JR, VICENTE M | \n",
+ " CIVIL ENGINEER IV | \n",
+ " WATER MGMNT | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 110064.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " ABASCAL, REECE E | \n",
+ " TRAFFIC CONTROL AIDE-HOURLY | \n",
+ " OEMC | \n",
+ " P | \n",
+ " Hourly | \n",
+ " 20.0 | \n",
+ " NaN | \n",
+ " 19.86 | \n",
+ "
\n",
+ " \n",
+ " | 5 | \n",
+ " ABBASI, CHRISTOPHER | \n",
+ " STAFF ASST TO THE ALDERMAN | \n",
+ " CITY COUNCIL | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 50436.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 6 | \n",
+ " ABBATACOLA, ROBERT J | \n",
+ " ELECTRICAL MECHANIC | \n",
+ " AVIATION | \n",
+ " F | \n",
+ " Hourly | \n",
+ " 40.0 | \n",
+ " NaN | \n",
+ " 46.10 | \n",
+ "
\n",
+ " \n",
+ " | 7 | \n",
+ " ABBATE, JOSEPH L | \n",
+ " POOL MOTOR TRUCK DRIVER | \n",
+ " STREETS & SAN | \n",
+ " F | \n",
+ " Hourly | \n",
+ " 40.0 | \n",
+ " NaN | \n",
+ " 35.60 | \n",
+ "
\n",
+ " \n",
+ " | 8 | \n",
+ " ABBATEMARCO, JAMES J | \n",
+ " FIRE ENGINEER-EMT | \n",
+ " FIRE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 103350.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 9 | \n",
+ " ABBATE, TERRY M | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 93354.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 10 | \n",
+ " ABBOTT, BETTY L | \n",
+ " FOSTER GRANDPARENT | \n",
+ " FAMILY & SUPPORT | \n",
+ " P | \n",
+ " Hourly | \n",
+ " 20.0 | \n",
+ " NaN | \n",
+ " 2.65 | \n",
+ "
\n",
+ " \n",
+ " | 11 | \n",
+ " ABDALLAH, ZAID | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 84054.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 12 | \n",
+ " ABDELHADI, ABDALMAHD | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 87006.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 13 | \n",
+ " ABDELLATIF, AREF R | \n",
+ " FIREFIGHTER (PER ARBITRATORS AWARD)-PARAMEDIC | \n",
+ " FIRE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 102228.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 14 | \n",
+ " ABDELMAJEID, AZIZ | \n",
+ " POLICE OFFICER | \n",
+ " POLICE | \n",
+ " F | \n",
+ " Salary | \n",
+ " NaN | \n",
+ " 84054.0 | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Name Job Titles \\\n",
+ "0 AARON, JEFFERY M SERGEANT \n",
+ "1 AARON, KARINA POLICE OFFICER (ASSIGNED AS DETECTIVE) \n",
+ "2 AARON, KIMBERLEI R CHIEF CONTRACT EXPEDITER \n",
+ "3 ABAD JR, VICENTE M CIVIL ENGINEER IV \n",
+ "4 ABASCAL, REECE E TRAFFIC CONTROL AIDE-HOURLY \n",
+ "5 ABBASI, CHRISTOPHER STAFF ASST TO THE ALDERMAN \n",
+ "6 ABBATACOLA, ROBERT J ELECTRICAL MECHANIC \n",
+ "7 ABBATE, JOSEPH L POOL MOTOR TRUCK DRIVER \n",
+ "8 ABBATEMARCO, JAMES J FIRE ENGINEER-EMT \n",
+ "9 ABBATE, TERRY M POLICE OFFICER \n",
+ "10 ABBOTT, BETTY L FOSTER GRANDPARENT \n",
+ "11 ABDALLAH, ZAID POLICE OFFICER \n",
+ "12 ABDELHADI, ABDALMAHD POLICE OFFICER \n",
+ "13 ABDELLATIF, AREF R FIREFIGHTER (PER ARBITRATORS AWARD)-PARAMEDIC \n",
+ "14 ABDELMAJEID, AZIZ POLICE OFFICER \n",
+ "\n",
+ " Department Full or Part-Time Salary or Hourly Typical Hours \\\n",
+ "0 POLICE F Salary NaN \n",
+ "1 POLICE F Salary NaN \n",
+ "2 GENERAL SERVICES F Salary NaN \n",
+ "3 WATER MGMNT F Salary NaN \n",
+ "4 OEMC P Hourly 20.0 \n",
+ "5 CITY COUNCIL F Salary NaN \n",
+ "6 AVIATION F Hourly 40.0 \n",
+ "7 STREETS & SAN F Hourly 40.0 \n",
+ "8 FIRE F Salary NaN \n",
+ "9 POLICE F Salary NaN \n",
+ "10 FAMILY & SUPPORT P Hourly 20.0 \n",
+ "11 POLICE F Salary NaN \n",
+ "12 POLICE F Salary NaN \n",
+ "13 FIRE F Salary NaN \n",
+ "14 POLICE F Salary NaN \n",
+ "\n",
+ " Annual Salary Hourly Rate \n",
+ "0 101442.0 NaN \n",
+ "1 94122.0 NaN \n",
+ "2 101592.0 NaN \n",
+ "3 110064.0 NaN \n",
+ "4 NaN 19.86 \n",
+ "5 50436.0 NaN \n",
+ "6 NaN 46.10 \n",
+ "7 NaN 35.60 \n",
+ "8 103350.0 NaN \n",
+ "9 93354.0 NaN \n",
+ "10 NaN 2.65 \n",
+ "11 84054.0 NaN \n",
+ "12 87006.0 NaN \n",
+ "13 102228.0 NaN \n",
+ "14 84054.0 NaN "
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "data.head(15)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We see from looking at the `head` function that there is quite a bit of missing data. Let's examine how much missing data is in each column. Produce this output in the cell below"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Name 0\n",
+ "Job Titles 0\n",
+ "Department 0\n",
+ "Full or Part-Time 0\n",
+ "Salary or Hourly 0\n",
+ "Typical Hours 25161\n",
+ "Annual Salary 8022\n",
+ "Hourly Rate 25161\n",
+ "dtype: int64\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(data.isnull().sum())"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Let's also look at the count of hourly vs. salaried employees. Write the code in the cell below"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Salary 25161\n",
+ "Hourly 8022\n",
+ "Name: Salary or Hourly, dtype: int64"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "data['Salary or Hourly'].value_counts()\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "What this information indicates is that the table contains information about two types of employees - salaried and hourly. Some columns apply only to one type of employee while other columns only apply to another kind. This is why there are so many missing values. Therefore, we will not do anything to handle the missing values."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "There are different departments in the city. List all departments and the count of employees in each department."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Department: POLICE, Count: 13414\n",
+ "Department: GENERAL SERVICES, Count: 980\n",
+ "Department: WATER MGMNT, Count: 1879\n",
+ "Department: OEMC, Count: 2102\n",
+ "Department: CITY COUNCIL, Count: 411\n",
+ "Department: AVIATION, Count: 1629\n",
+ "Department: STREETS & SAN, Count: 2198\n",
+ "Department: FIRE, Count: 4641\n",
+ "Department: FAMILY & SUPPORT, Count: 615\n",
+ "Department: PUBLIC LIBRARY, Count: 1015\n",
+ "Department: TRANSPORTN, Count: 1140\n",
+ "Department: MAYOR'S OFFICE, Count: 85\n",
+ "Department: HEALTH, Count: 488\n",
+ "Department: BUSINESS AFFAIRS, Count: 171\n",
+ "Department: LAW, Count: 407\n",
+ "Department: FINANCE, Count: 560\n",
+ "Department: CULTURAL AFFAIRS, Count: 65\n",
+ "Department: COMMUNITY DEVELOPMENT, Count: 207\n",
+ "Department: PROCUREMENT, Count: 92\n",
+ "Department: BUILDINGS, Count: 269\n",
+ "Department: ANIMAL CONTRL, Count: 81\n",
+ "Department: CITY CLERK, Count: 84\n",
+ "Department: BOARD OF ELECTION, Count: 107\n",
+ "Department: DISABILITIES, Count: 28\n",
+ "Department: HUMAN RESOURCES, Count: 79\n",
+ "Department: DoIT, Count: 99\n",
+ "Department: BUDGET & MGMT, Count: 46\n",
+ "Department: TREASURER, Count: 22\n",
+ "Department: INSPECTOR GEN, Count: 87\n",
+ "Department: HUMAN RELATIONS, Count: 16\n",
+ "Department: COPA, Count: 116\n",
+ "Department: BOARD OF ETHICS, Count: 8\n",
+ "Department: POLICE BOARD, Count: 2\n",
+ "Department: ADMIN HEARNG, Count: 39\n",
+ "Department: LICENSE APPL COMM, Count: 1\n"
+ ]
+ }
+ ],
+ "source": [
+ "department_counts = {}\n",
+ "\n",
+ "for department in data[\"Department\"]:\n",
+ " if department in department_counts:\n",
+ " department_counts[department] += 1\n",
+ " else:\n",
+ " department_counts[department] = 1\n",
+ " \n",
+ "for department, count in department_counts.items():\n",
+ " print(f\"Department: {department}, Count: {count}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Challenge 2 - Hypothesis Tests\n",
+ "\n",
+ "In this section of the lab, we will test whether the hourly wage of all hourly workers is significantly different from $30/hr. Import the correct one sample test function from scipy and perform the hypothesis test for a 95% two sided confidence interval."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The p-value (nan) is greater than alpha (0.05), so we fail to reject the null hypothesis.\n",
+ "There is no significant difference in the hourly wage of hourly workers from $30/hr.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from scipy import stats\n",
+ "\n",
+ "# Sample data representing hourly rates\n",
+ "hourly_rates = data[\"Hourly Rate\"]\n",
+ "\n",
+ "# Define the null hypothesis (H0) that the mean hourly rate is $30/hr\n",
+ "null_hypothesis_mean = 30.0\n",
+ "\n",
+ "# Perform a one-sample t-test for a 95% two-sided confidence interval\n",
+ "t_statistic, p_value = stats.ttest_1samp(hourly_rates, null_hypothesis_mean)\n",
+ "\n",
+ "# Set the significance level (alpha)\n",
+ "alpha = 0.05\n",
+ "\n",
+ "# Check if the p-value is less than alpha to determine significance\n",
+ "if p_value < alpha:\n",
+ " print(f\"The p-value ({p_value:.4f}) is less than alpha ({alpha}), so we reject the null hypothesis.\")\n",
+ " print(\"The hourly wage of hourly workers is significantly different from $30/hr.\")\n",
+ "else:\n",
+ " print(f\"The p-value ({p_value:.4f}) is greater than alpha ({alpha}), so we fail to reject the null hypothesis.\")\n",
+ " print(\"There is no significant difference in the hourly wage of hourly workers from $30/hr.\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We are also curious about salaries in the police force. The chief of police in Chicago claimed in a press briefing that salaries this year are higher than last year's mean of $86000/year a year for all salaried employees. Test this one sided hypothesis using a 95% confidence interval.\n",
+ "\n",
+ "Hint: A one tailed test has a p-value that is half of the two tailed p-value. If our hypothesis is greater than, then to reject, the test statistic must also be positive."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The one-tailed p-value (nan) is greater than alpha (0.05) or the test statistic (nan) is not positive.\n",
+ "We fail to reject the null hypothesis.\n",
+ "There is no evidence that salaries in the police force are higher than last year's mean of $86,000/year.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from scipy import stats\n",
+ "\n",
+ "# Sample data representing annual salaries\n",
+ "annual_salaries = data[\"Annual Salary\"]\n",
+ "\n",
+ "# Define the null hypothesis (H0) that the mean annual salary is $86,000/year\n",
+ "null_hypothesis_mean = 86000.0\n",
+ "\n",
+ "# Perform a one-sample t-test for a 95% one-sided (greater) confidence interval\n",
+ "t_statistic, p_value = stats.ttest_1samp(annual_salaries, null_hypothesis_mean)\n",
+ "\n",
+ "# Since this is a one-tailed test (greater than), we need to divide the p-value by 2\n",
+ "p_value /= 2\n",
+ "\n",
+ "# Set the significance level (alpha)\n",
+ "alpha = 0.05\n",
+ "\n",
+ "# Check if the p-value is less than alpha to determine significance\n",
+ "if p_value < alpha and t_statistic > 0:\n",
+ " print(f\"The one-tailed p-value ({p_value:.4f}) is less than alpha ({alpha}), and the test statistic ({t_statistic:.4f}) is positive.\")\n",
+ " print(\"We reject the null hypothesis.\")\n",
+ " print(\"Salaries in the police force are higher than last year's mean of $86,000/year.\")\n",
+ "else:\n",
+ " print(f\"The one-tailed p-value ({p_value:.4f}) is greater than alpha ({alpha}) or the test statistic ({t_statistic:.4f}) is not positive.\")\n",
+ " print(\"We fail to reject the null hypothesis.\")\n",
+ " print(\"There is no evidence that salaries in the police force are higher than last year's mean of $86,000/year.\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Using the `crosstab` function, find the department that has the most hourly workers. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The department with the most hourly workers is 'STREETS & SAN' with 1862 workers.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import pandas as pd\n",
+ "\n",
+ "cross_tab = pd.crosstab(data[\"Department\"], data[\"Salary or Hourly\"])\n",
+ "\n",
+ "# Extract the count of hourly workers\n",
+ "hourly_counts = cross_tab[\"Hourly\"]\n",
+ "\n",
+ "# Find the department with the most hourly workers\n",
+ "department_with_most_hourly_workers = hourly_counts.idxmax()\n",
+ "max_hourly_workers = hourly_counts.max()\n",
+ "\n",
+ "print(f\"The department with the most hourly workers is '{department_with_most_hourly_workers}' with {max_hourly_workers} workers.\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The workers from the department with the most hourly workers have complained that their hourly wage is less than $35/hour. Using a one sample t-test, test this one-sided hypothesis at the 95% confidence level."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The one-tailed p-value (nan) is greater than alpha (0.05) or the test statistic (nan) is not negative.\n",
+ "We fail to reject the null hypothesis.\n",
+ "There is no evidence that the workers from the department with the most hourly workers have an hourly wage less than $35.0/hour.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from scipy import stats\n",
+ "\n",
+ "department_with_most_hourly_workers = 'STREETS & SAN' # Replace with the actual department name\n",
+ "hourly_rates_department = data[data[\"Department\"] == department_with_most_hourly_workers][\"Hourly Rate\"]\n",
+ "\n",
+ "# Define the null hypothesis (H0) that the mean hourly rate is $35/hour\n",
+ "null_hypothesis_mean = 35.0\n",
+ "\n",
+ "# Perform a one-sample t-test for a 95% one-sided (less than) confidence interval\n",
+ "t_statistic, p_value = stats.ttest_1samp(hourly_rates_department, null_hypothesis_mean)\n",
+ "\n",
+ "# Since this is a one-tailed test (less than), we need to divide the p-value by 2\n",
+ "p_value /= 2\n",
+ "\n",
+ "# Set the significance level (alpha)\n",
+ "alpha = 0.05\n",
+ "\n",
+ "# Check if the p-value is less than alpha to determine significance\n",
+ "if p_value < alpha and t_statistic < 0:\n",
+ " print(f\"The one-tailed p-value ({p_value:.4f}) is less than alpha ({alpha}), and the test statistic ({t_statistic:.4f}) is negative.\")\n",
+ " print(\"We reject the null hypothesis.\")\n",
+ " print(f\"The workers from the department with the most hourly workers have an hourly wage less than ${null_hypothesis_mean}/hour.\")\n",
+ "else:\n",
+ " print(f\"The one-tailed p-value ({p_value:.4f}) is greater than alpha ({alpha}) or the test statistic ({t_statistic:.4f}) is not negative.\")\n",
+ " print(\"We fail to reject the null hypothesis.\")\n",
+ " print(f\"There is no evidence that the workers from the department with the most hourly workers have an hourly wage less than ${null_hypothesis_mean}/hour.\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Challenge 3: To practice - Constructing Confidence Intervals\n",
+ "\n",
+ "While testing our hypothesis is a great way to gather empirical evidence for accepting or rejecting the hypothesis, another way to gather evidence is by creating a confidence interval. A confidence interval gives us information about the true mean of the population. So for a 95% confidence interval, we are 95% sure that the mean of the population is within the confidence interval. \n",
+ ").\n",
+ "\n",
+ "To read more about confidence intervals, click [here](https://en.wikipedia.org/wiki/Confidence_interval).\n",
+ "\n",
+ "\n",
+ "In the cell below, we will construct a 95% confidence interval for the mean hourly wage of all hourly workers. \n",
+ "\n",
+ "The confidence interval is computed in SciPy using the `t.interval` function. You can read more about this function [here](https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.t.html).\n",
+ "\n",
+ "To compute the confidence interval of the hourly wage, use the 0.95 for the confidence level, number of rows - 1 for degrees of freedom, the mean of the sample for the location parameter and the standard error for the scale. The standard error can be computed using [this](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.sem.html) function in SciPy."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "95% Confidence Interval for Mean Hourly Wage: (nan, nan)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from scipy import stats\n",
+ "\n",
+ "# Sample data representing hourly rates\n",
+ "hourly_rates = data[\"Hourly Rate\"]\n",
+ "\n",
+ "# Calculate the sample mean and standard error of the mean\n",
+ "sample_mean = np.mean(hourly_rates)\n",
+ "standard_error = stats.sem(hourly_rates)\n",
+ "\n",
+ "# Set the confidence level (e.g., 95%)\n",
+ "confidence_level = 0.95\n",
+ "\n",
+ "# Calculate the degrees of freedom\n",
+ "degrees_of_freedom = len(hourly_rates) - 1\n",
+ "\n",
+ "# Compute the confidence interval using t.interval\n",
+ "confidence_interval = stats.t.interval(confidence_level, degrees_of_freedom, loc=sample_mean, scale=standard_error)\n",
+ "\n",
+ "# Print the confidence interval\n",
+ "print(f\"95% Confidence Interval for Mean Hourly Wage: ({confidence_interval[0]:.2f}, {confidence_interval[1]:.2f})\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now construct the 95% confidence interval for all salaried employeed in the police in the cell below."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "95% Confidence Interval for Mean Annual Salary in the Police Department: ($86177.06, $86795.77)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from scipy import stats\n",
+ "\n",
+ "# Assuming you have a DataFrame named 'data' with columns 'Department' and 'Annual Salary'\n",
+ "# Extract the annual salaries for salaried employees in the police department\n",
+ "police_salaries = data[(data[\"Department\"] == \"POLICE\") & (data[\"Salary or Hourly\"] == \"Salary\")][\"Annual Salary\"]\n",
+ "\n",
+ "# Calculate the sample mean and standard error of the mean\n",
+ "sample_mean = np.mean(police_salaries)\n",
+ "standard_error = stats.sem(police_salaries)\n",
+ "\n",
+ "# Set the confidence level (e.g., 95%)\n",
+ "confidence_level = 0.95\n",
+ "\n",
+ "# Calculate the degrees of freedom\n",
+ "degrees_of_freedom = len(police_salaries) - 1\n",
+ "\n",
+ "# Compute the confidence interval using t.interval\n",
+ "confidence_interval = stats.t.interval(confidence_level, degrees_of_freedom, loc=sample_mean, scale=standard_error)\n",
+ "\n",
+ "# Print the confidence interval\n",
+ "print(f\"95% Confidence Interval for Mean Annual Salary in the Police Department: (${confidence_interval[0]:.2f}, ${confidence_interval[1]:.2f})\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Bonus Challenge - Hypothesis Tests of Proportions\n",
+ "\n",
+ "Another type of one sample test is a hypothesis test of proportions. In this test, we examine whether the proportion of a group in our sample is significantly different than a fraction. \n",
+ "\n",
+ "You can read more about one sample proportion tests [here](http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/SAS/SAS6-CategoricalData/SAS6-CategoricalData2.html).\n",
+ "\n",
+ "In the cell below, use the `proportions_ztest` function from `statsmodels` to perform a hypothesis test that will determine whether the number of hourly workers in the City of Chicago is significantly different from 25% at the 95% confidence level."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Your code here:\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "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": 2
+}