927 lines
150 KiB
Plaintext
927 lines
150 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 1,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"import pandas as pd\n",
|
|||
|
"# загрузка данных\n",
|
|||
|
"df = pd.read_csv(\"data/students_education.csv\")\n",
|
|||
|
"# сохранение данных\n",
|
|||
|
"df.to_csv(\"lab1.csv\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 2,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"<class 'pandas.core.frame.DataFrame'>\n",
|
|||
|
"RangeIndex: 1205 entries, 0 to 1204\n",
|
|||
|
"Data columns (total 11 columns):\n",
|
|||
|
" # Column Non-Null Count Dtype \n",
|
|||
|
"--- ------ -------------- ----- \n",
|
|||
|
" 0 Education Level 1205 non-null object\n",
|
|||
|
" 1 Institution Type 1205 non-null object\n",
|
|||
|
" 2 Gender 1205 non-null object\n",
|
|||
|
" 3 Age 1205 non-null int64 \n",
|
|||
|
" 4 Device 1204 non-null object\n",
|
|||
|
" 5 IT Student 1205 non-null object\n",
|
|||
|
" 6 Location 1205 non-null object\n",
|
|||
|
" 7 Financial Condition 1201 non-null object\n",
|
|||
|
" 8 Internet Type 1204 non-null object\n",
|
|||
|
" 9 Network Type 1205 non-null object\n",
|
|||
|
" 10 Flexibility Level 1205 non-null object\n",
|
|||
|
"dtypes: int64(1), object(10)\n",
|
|||
|
"memory usage: 103.7+ KB\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# получение сведений о датафрейме\n",
|
|||
|
"df.info()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"Education Level object\n",
|
|||
|
"Institution Type object\n",
|
|||
|
"Gender object\n",
|
|||
|
"Age int64\n",
|
|||
|
"Device object\n",
|
|||
|
"IT Student object\n",
|
|||
|
"Location object\n",
|
|||
|
"Financial Condition object\n",
|
|||
|
"Internet Type object\n",
|
|||
|
"Network Type object\n",
|
|||
|
"Flexibility Level object\n",
|
|||
|
"dtype: object"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"df.dtypes"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 4,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"0 University\n",
|
|||
|
"1 University\n",
|
|||
|
"2 College\n",
|
|||
|
"3 School\n",
|
|||
|
"4 School\n",
|
|||
|
" ... \n",
|
|||
|
"95 University\n",
|
|||
|
"96 School\n",
|
|||
|
"97 School\n",
|
|||
|
"98 University\n",
|
|||
|
"99 College\n",
|
|||
|
"Name: Education Level, Length: 100, dtype: object\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# вывод первых 100 строк из столбца Education Level\n",
|
|||
|
"education = df.iloc[0:100, 0]\n",
|
|||
|
"print(education)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 5,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
" Education Level Institution Type Gender Age Device IT Student \\\n",
|
|||
|
"54 School Private Male 9 Mobile No \n",
|
|||
|
"55 School Private Female 9 Mobile No \n",
|
|||
|
"1155 School Private Female 9 Mobile No \n",
|
|||
|
"886 School Private Female 9 Mobile No \n",
|
|||
|
"916 School Private Female 9 Mobile No \n",
|
|||
|
"... ... ... ... ... ... ... \n",
|
|||
|
"1157 University Public Male 27 Computer Yes \n",
|
|||
|
"714 University Public Female 27 Mobile No \n",
|
|||
|
"717 University Public Female 27 Mobile No \n",
|
|||
|
"16 University Public Female 27 Computer Yes \n",
|
|||
|
"1190 University Private Male 27 Mobile Yes \n",
|
|||
|
"\n",
|
|||
|
" Location Financial Condition Internet Type Network Type Flexibility Level \n",
|
|||
|
"54 Town Poor Mobile Data 4G Low \n",
|
|||
|
"55 Town Mid Mobile Data 4G Moderate \n",
|
|||
|
"1155 Town Poor Mobile Data 4G Moderate \n",
|
|||
|
"886 Town Poor Mobile Data 4G Moderate \n",
|
|||
|
"916 Town Mid Mobile Data 4G Moderate \n",
|
|||
|
"... ... ... ... ... ... \n",
|
|||
|
"1157 Town Rich Wifi 4G High \n",
|
|||
|
"714 Town Mid Wifi 4G Low \n",
|
|||
|
"717 Town Mid Mobile Data 4G Low \n",
|
|||
|
"16 Town Poor Mobile Data 4G Low \n",
|
|||
|
"1190 Town Mid Wifi 3G Moderate \n",
|
|||
|
"\n",
|
|||
|
"[1205 rows x 11 columns]\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# сортировка датафрейма по возрасту\n",
|
|||
|
"sorted_df = df.sort_values(by=\"Age\")\n",
|
|||
|
"print(sorted_df)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 6,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
" Education Level Institution Type Gender Age Device IT Student \\\n",
|
|||
|
"0 University Private Male 23 Tab No \n",
|
|||
|
"1 University Private Female 23 Mobile No \n",
|
|||
|
"2 College Public Female 18 Mobile No \n",
|
|||
|
"4 School Private Female 18 Mobile No \n",
|
|||
|
"8 College Public Male 18 Mobile No \n",
|
|||
|
"... ... ... ... ... ... ... \n",
|
|||
|
"1198 College Public Male 18 Mobile Yes \n",
|
|||
|
"1199 University Private Male 23 Computer Yes \n",
|
|||
|
"1200 College Private Female 18 Mobile No \n",
|
|||
|
"1201 College Private Female 18 Mobile No \n",
|
|||
|
"1203 College Private Female 18 Mobile No \n",
|
|||
|
"\n",
|
|||
|
" Location Financial Condition Internet Type Network Type Flexibility Level \n",
|
|||
|
"0 Town Mid Wifi 4G Moderate \n",
|
|||
|
"1 Town NaN Mobile Data 4G Moderate \n",
|
|||
|
"2 Town Mid Wifi 4G Moderate \n",
|
|||
|
"4 Town Poor NaN 3G Low \n",
|
|||
|
"8 Town Mid Wifi 4G Low \n",
|
|||
|
"... ... ... ... ... ... \n",
|
|||
|
"1198 Rural Mid Mobile Data 4G Low \n",
|
|||
|
"1199 Town Mid Wifi 4G Low \n",
|
|||
|
"1200 Town Mid Wifi 4G Low \n",
|
|||
|
"1201 Rural Mid Wifi 4G Moderate \n",
|
|||
|
"1203 Rural Mid Wifi 4G Low \n",
|
|||
|
"\n",
|
|||
|
"[720 rows x 11 columns]\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# вывод студентов, которым 18 лет и больше\n",
|
|||
|
"Age = df[df['Age'] >= 18]\n",
|
|||
|
"print(Age)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 7,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/html": [
|
|||
|
"<div>\n",
|
|||
|
"<style scoped>\n",
|
|||
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
" vertical-align: middle;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe tbody tr th {\n",
|
|||
|
" vertical-align: top;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe thead th {\n",
|
|||
|
" text-align: right;\n",
|
|||
|
" }\n",
|
|||
|
"</style>\n",
|
|||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
" <thead>\n",
|
|||
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th>Education Level</th>\n",
|
|||
|
" <th>Institution Type</th>\n",
|
|||
|
" <th>Gender</th>\n",
|
|||
|
" <th>Age</th>\n",
|
|||
|
" <th>Device</th>\n",
|
|||
|
" <th>IT Student</th>\n",
|
|||
|
" <th>Financial Condition</th>\n",
|
|||
|
" <th>Internet Type</th>\n",
|
|||
|
" <th>Network Type</th>\n",
|
|||
|
" <th>Flexibility Level</th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </thead>\n",
|
|||
|
" <tbody>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>0</th>\n",
|
|||
|
" <td>University</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Male</td>\n",
|
|||
|
" <td>23</td>\n",
|
|||
|
" <td>Tab</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Wifi</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1</th>\n",
|
|||
|
" <td>University</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>23</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>NaN</td>\n",
|
|||
|
" <td>Mobile Data</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>2</th>\n",
|
|||
|
" <td>College</td>\n",
|
|||
|
" <td>Public</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>18</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Wifi</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>3</th>\n",
|
|||
|
" <td>School</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>11</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>NaN</td>\n",
|
|||
|
" <td>Mobile Data</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>4</th>\n",
|
|||
|
" <td>School</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>18</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Poor</td>\n",
|
|||
|
" <td>NaN</td>\n",
|
|||
|
" <td>3G</td>\n",
|
|||
|
" <td>Low</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </tbody>\n",
|
|||
|
"</table>\n",
|
|||
|
"</div>"
|
|||
|
],
|
|||
|
"text/plain": [
|
|||
|
" Education Level Institution Type Gender Age Device IT Student \\\n",
|
|||
|
"0 University Private Male 23 Tab No \n",
|
|||
|
"1 University Private Female 23 Mobile No \n",
|
|||
|
"2 College Public Female 18 Mobile No \n",
|
|||
|
"3 School Private Female 11 Mobile No \n",
|
|||
|
"4 School Private Female 18 Mobile No \n",
|
|||
|
"\n",
|
|||
|
" Financial Condition Internet Type Network Type Flexibility Level \n",
|
|||
|
"0 Mid Wifi 4G Moderate \n",
|
|||
|
"1 NaN Mobile Data 4G Moderate \n",
|
|||
|
"2 Mid Wifi 4G Moderate \n",
|
|||
|
"3 NaN Mobile Data 4G Moderate \n",
|
|||
|
"4 Poor NaN 3G Low "
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 7,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"df.drop(['Location'], axis=1).head()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 8,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/html": [
|
|||
|
"<div>\n",
|
|||
|
"<style scoped>\n",
|
|||
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
" vertical-align: middle;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe tbody tr th {\n",
|
|||
|
" vertical-align: top;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe thead th {\n",
|
|||
|
" text-align: right;\n",
|
|||
|
" }\n",
|
|||
|
"</style>\n",
|
|||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
" <thead>\n",
|
|||
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th>Education Level</th>\n",
|
|||
|
" <th>Institution Type</th>\n",
|
|||
|
" <th>Gender</th>\n",
|
|||
|
" <th>Age</th>\n",
|
|||
|
" <th>Device</th>\n",
|
|||
|
" <th>IT Student</th>\n",
|
|||
|
" <th>Location</th>\n",
|
|||
|
" <th>Financial Condition</th>\n",
|
|||
|
" <th>Internet Type</th>\n",
|
|||
|
" <th>Network Type</th>\n",
|
|||
|
" <th>Flexibility Level</th>\n",
|
|||
|
" <th>age_group</th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </thead>\n",
|
|||
|
" <tbody>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>0</th>\n",
|
|||
|
" <td>University</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Male</td>\n",
|
|||
|
" <td>23</td>\n",
|
|||
|
" <td>Tab</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Wifi</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" <td>average</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1</th>\n",
|
|||
|
" <td>University</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>23</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>NaN</td>\n",
|
|||
|
" <td>Mobile Data</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" <td>average</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>2</th>\n",
|
|||
|
" <td>College</td>\n",
|
|||
|
" <td>Public</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>18</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Wifi</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" <td>average</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>3</th>\n",
|
|||
|
" <td>School</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>11</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>NaN</td>\n",
|
|||
|
" <td>Mobile Data</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" <td>young</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>4</th>\n",
|
|||
|
" <td>School</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>18</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>Poor</td>\n",
|
|||
|
" <td>NaN</td>\n",
|
|||
|
" <td>3G</td>\n",
|
|||
|
" <td>Low</td>\n",
|
|||
|
" <td>average</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1200</th>\n",
|
|||
|
" <td>College</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>18</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Wifi</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Low</td>\n",
|
|||
|
" <td>average</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1201</th>\n",
|
|||
|
" <td>College</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>18</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Rural</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Wifi</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" <td>average</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1202</th>\n",
|
|||
|
" <td>School</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Male</td>\n",
|
|||
|
" <td>11</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Mobile Data</td>\n",
|
|||
|
" <td>3G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" <td>young</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1203</th>\n",
|
|||
|
" <td>College</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>18</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Rural</td>\n",
|
|||
|
" <td>Mid</td>\n",
|
|||
|
" <td>Wifi</td>\n",
|
|||
|
" <td>4G</td>\n",
|
|||
|
" <td>Low</td>\n",
|
|||
|
" <td>average</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1204</th>\n",
|
|||
|
" <td>School</td>\n",
|
|||
|
" <td>Private</td>\n",
|
|||
|
" <td>Female</td>\n",
|
|||
|
" <td>11</td>\n",
|
|||
|
" <td>Mobile</td>\n",
|
|||
|
" <td>No</td>\n",
|
|||
|
" <td>Town</td>\n",
|
|||
|
" <td>Poor</td>\n",
|
|||
|
" <td>Mobile Data</td>\n",
|
|||
|
" <td>3G</td>\n",
|
|||
|
" <td>Moderate</td>\n",
|
|||
|
" <td>young</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </tbody>\n",
|
|||
|
"</table>\n",
|
|||
|
"<p>1205 rows × 12 columns</p>\n",
|
|||
|
"</div>"
|
|||
|
],
|
|||
|
"text/plain": [
|
|||
|
" Education Level Institution Type Gender Age Device IT Student \\\n",
|
|||
|
"0 University Private Male 23 Tab No \n",
|
|||
|
"1 University Private Female 23 Mobile No \n",
|
|||
|
"2 College Public Female 18 Mobile No \n",
|
|||
|
"3 School Private Female 11 Mobile No \n",
|
|||
|
"4 School Private Female 18 Mobile No \n",
|
|||
|
"... ... ... ... ... ... ... \n",
|
|||
|
"1200 College Private Female 18 Mobile No \n",
|
|||
|
"1201 College Private Female 18 Mobile No \n",
|
|||
|
"1202 School Private Male 11 Mobile No \n",
|
|||
|
"1203 College Private Female 18 Mobile No \n",
|
|||
|
"1204 School Private Female 11 Mobile No \n",
|
|||
|
"\n",
|
|||
|
" Location Financial Condition Internet Type Network Type \\\n",
|
|||
|
"0 Town Mid Wifi 4G \n",
|
|||
|
"1 Town NaN Mobile Data 4G \n",
|
|||
|
"2 Town Mid Wifi 4G \n",
|
|||
|
"3 Town NaN Mobile Data 4G \n",
|
|||
|
"4 Town Poor NaN 3G \n",
|
|||
|
"... ... ... ... ... \n",
|
|||
|
"1200 Town Mid Wifi 4G \n",
|
|||
|
"1201 Rural Mid Wifi 4G \n",
|
|||
|
"1202 Town Mid Mobile Data 3G \n",
|
|||
|
"1203 Rural Mid Wifi 4G \n",
|
|||
|
"1204 Town Poor Mobile Data 3G \n",
|
|||
|
"\n",
|
|||
|
" Flexibility Level age_group \n",
|
|||
|
"0 Moderate average \n",
|
|||
|
"1 Moderate average \n",
|
|||
|
"2 Moderate average \n",
|
|||
|
"3 Moderate young \n",
|
|||
|
"4 Low average \n",
|
|||
|
"... ... ... \n",
|
|||
|
"1200 Low average \n",
|
|||
|
"1201 Moderate average \n",
|
|||
|
"1202 Moderate young \n",
|
|||
|
"1203 Low average \n",
|
|||
|
"1204 Moderate young \n",
|
|||
|
"\n",
|
|||
|
"[1205 rows x 12 columns]"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# добавление нового столбца Возрастная группа\n",
|
|||
|
"def age_group(value):\n",
|
|||
|
" if value < 18:\n",
|
|||
|
" return \"young\"\n",
|
|||
|
" else:\n",
|
|||
|
" return \"average\"\n",
|
|||
|
"\n",
|
|||
|
"df['age_group'] = df['Age'].map(age_group)\n",
|
|||
|
"display(df)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 9,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
" Education Level Institution Type Gender Age Device IT Student \\\n",
|
|||
|
"0 University Private Male 23 Tab No \n",
|
|||
|
"2 College Public Female 18 Mobile No \n",
|
|||
|
"5 School Private Male 11 Mobile No \n",
|
|||
|
"8 College Public Male 18 Mobile No \n",
|
|||
|
"9 School Private Male 11 Mobile No \n",
|
|||
|
"... ... ... ... ... ... ... \n",
|
|||
|
"1200 College Private Female 18 Mobile No \n",
|
|||
|
"1201 College Private Female 18 Mobile No \n",
|
|||
|
"1202 School Private Male 11 Mobile No \n",
|
|||
|
"1203 College Private Female 18 Mobile No \n",
|
|||
|
"1204 School Private Female 11 Mobile No \n",
|
|||
|
"\n",
|
|||
|
" Location Financial Condition Internet Type Network Type \\\n",
|
|||
|
"0 Town Mid Wifi 4G \n",
|
|||
|
"2 Town Mid Wifi 4G \n",
|
|||
|
"5 Town Poor Mobile Data 3G \n",
|
|||
|
"8 Town Mid Wifi 4G \n",
|
|||
|
"9 Town Mid Mobile Data 3G \n",
|
|||
|
"... ... ... ... ... \n",
|
|||
|
"1200 Town Mid Wifi 4G \n",
|
|||
|
"1201 Rural Mid Wifi 4G \n",
|
|||
|
"1202 Town Mid Mobile Data 3G \n",
|
|||
|
"1203 Rural Mid Wifi 4G \n",
|
|||
|
"1204 Town Poor Mobile Data 3G \n",
|
|||
|
"\n",
|
|||
|
" Flexibility Level age_group \n",
|
|||
|
"0 Moderate average \n",
|
|||
|
"2 Moderate average \n",
|
|||
|
"5 Low young \n",
|
|||
|
"8 Low average \n",
|
|||
|
"9 Moderate young \n",
|
|||
|
"... ... ... \n",
|
|||
|
"1200 Low average \n",
|
|||
|
"1201 Moderate average \n",
|
|||
|
"1202 Moderate young \n",
|
|||
|
"1203 Low average \n",
|
|||
|
"1204 Moderate young \n",
|
|||
|
"\n",
|
|||
|
"[1199 rows x 12 columns]\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# удаление строк с пустыми значениями\n",
|
|||
|
"df_cleaned = df.dropna()\n",
|
|||
|
"print(df_cleaned)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 10,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
" Education Level Institution Type Gender Age Device IT Student \\\n",
|
|||
|
"0 University Private Male 23 Tab No \n",
|
|||
|
"1 University Private Female 23 Mobile No \n",
|
|||
|
"2 College Public Female 18 Mobile No \n",
|
|||
|
"3 School Private Female 11 Mobile No \n",
|
|||
|
"4 School Private Female 18 Mobile No \n",
|
|||
|
"... ... ... ... ... ... ... \n",
|
|||
|
"1200 College Private Female 18 Mobile No \n",
|
|||
|
"1201 College Private Female 18 Mobile No \n",
|
|||
|
"1202 School Private Male 11 Mobile No \n",
|
|||
|
"1203 College Private Female 18 Mobile No \n",
|
|||
|
"1204 School Private Female 11 Mobile No \n",
|
|||
|
"\n",
|
|||
|
" Location Financial Condition Internet Type Network Type \\\n",
|
|||
|
"0 Town Mid Wifi 4G \n",
|
|||
|
"1 Town Mid Mobile Data 4G \n",
|
|||
|
"2 Town Mid Wifi 4G \n",
|
|||
|
"3 Town Mid Mobile Data 4G \n",
|
|||
|
"4 Town Poor NaN 3G \n",
|
|||
|
"... ... ... ... ... \n",
|
|||
|
"1200 Town Mid Wifi 4G \n",
|
|||
|
"1201 Rural Mid Wifi 4G \n",
|
|||
|
"1202 Town Mid Mobile Data 3G \n",
|
|||
|
"1203 Rural Mid Wifi 4G \n",
|
|||
|
"1204 Town Poor Mobile Data 3G \n",
|
|||
|
"\n",
|
|||
|
" Flexibility Level age_group \n",
|
|||
|
"0 Moderate average \n",
|
|||
|
"1 Moderate average \n",
|
|||
|
"2 Moderate average \n",
|
|||
|
"3 Moderate young \n",
|
|||
|
"4 Low average \n",
|
|||
|
"... ... ... \n",
|
|||
|
"1200 Low average \n",
|
|||
|
"1201 Moderate average \n",
|
|||
|
"1202 Moderate young \n",
|
|||
|
"1203 Low average \n",
|
|||
|
"1204 Moderate young \n",
|
|||
|
"\n",
|
|||
|
"[1205 rows x 12 columns]\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# Вычисление моды (наиболее часто встречающегося значения) для пустых значений\n",
|
|||
|
"mode_Financial = df['Financial Condition'].mode()[0] \n",
|
|||
|
"df.fillna({'Financial Condition':mode_Financial}, inplace=True)\n",
|
|||
|
"print(df)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 11,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAisAAAGdC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KiskFlRUREpJi8tXgHSanZhAV68dwdDc2OU2aorIiIiBSDlbuO882GRCwWmNwvAi93jX+Ki8qKiIjIdUo9m8fYOVsAGNK+Jq1rBZqcqGxRWREREblOry/aTnJaNjWDvPhHN41/ipvKioiIyHX4eecxZm86XDj+8XR3MTtSmaOyIiIico1Ss/43/hl6Uy1urKnxT0lQWREREblGry7cxvH0HGpX8ubZ2xuYHafMUlkRERG5Bj9sS+a7349gPT/+8XDT+KekqKyIiIgU0enMXJ6fuxWARzrWpkVYBZMTlW0qKyIiIkU0fuE2TmbkULeyD0/fVt/sOGWeyoqIiEgRLN16lPmxSbhYLbyr8U+pUFkRERG5Sqcycnjh/PhneMfaRIQGmBuonFBZERERuUovL9jGqcxc6lfx4cnb6pkdp9xQWREREbkKi+OPsjj+6PnxT3Nsrhr/lBaVFRERkSs4mZHDS/PPjX9Gdq5DsxB/kxOVLyorIiIif8MwDF6at5WUzFwaVvVl1C0a/5Q2lRUREZG/sTD+KEu2JuNqtTC5XwTurnrrLG36FxcREbmM4+nZvHx+/DPqlro0ra7xjxlUVkRERC7BMAxemLuVM1l5NK7mx8gudc2OVG6prIiIiFzC/Ngklm8/hpuLhXf7R+DmordMs+hfXkRE5E+OpWXzyoJtADxxSz0aVfMzOVH5prIiIiLyB4Zh8Px3W0g9m0ez6v6M6Fz
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# линейная диаграмма (средний возраст по уровню образования)\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"plt.plot(df[[\"Education Level\", \"Age\"]].groupby(\"Education Level\").mean())\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 12,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Axes: ylabel='Frequency'>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 12,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGdCAYAAAD60sxaAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAyJ0lEQVR4nO3de1xU9b7/8TcioKhAqNyOgOY1EqzMaE7atmQLyjFNehwtTWu7tdzYRbq42dvU7IJp2W2bdh4PFH2cTLOjlZaaV8xCTdNMLVI3hR5upltQTK7r90fH+TXKdZxhGNfr+Xisx8O11nd95/Ply9C7Nd+Z8TAMwxAAAICJtHB1AQAAAE2NAAQAAEyHAAQAAEyHAAQAAEyHAAQAAEyHAAQAAEyHAAQAAEyHAAQAAEynpasLaA6qq6uVl5endu3aycPDw9XlAACABjAMQ+fOnVNYWJhatGjcPR0CkKS8vDyFh4e7ugwAAGCHEydOqFOnTo26hgAkqV27dpJ++wH6+fm5uBoAANAQJSUlCg8Pt/53vDEIQJL1ZS8/Pz8CEAAAbsae5SssggYAAKZDAAIAAKZDAAIAAKbDGiAAAJqYYRiqrKxUVVWVq0tp1jw9PdWyZUunfEQNAQgAgCZUXl6u/Px8XbhwwdWluAVfX1+FhobK29vbof0SgAAAaCLV1dXKycmRp6enwsLC5O3tzQfw1sIwDJWXl+vUqVPKyclR9+7dG/1hh3UhAAEA0ETKy8tVXV2t8PBw+fr6urqcZq9169by8vLSzz//rPLycrVq1cphfbMIGgCAJubIOxnXOmf9rJgBAABgOgQgAABgOqwBAgDAxTr/9dMmfbyf5iTadV1WVpb69++vhIQEffpp09bsaNwBAgAADZKenq7HHntMO3bsUF5enqvLuSoEIAAAUK/z589r5cqVmjx5shITE5WRkWFz/pNPPlH37t3VqlUr3XXXXVq6dKk8PDx09uxZa5udO3dqwIABat26tcLDw/X444+rtLS0aQfyfwhAAACgXh988IF69eqlnj17auzYsVq8eLEMw5Ak5eTk6L777tOIESP07bff6pFHHtHf//53m+uPHz+uhIQEJSUl6eDBg1q5cqV27typKVOmuGI4rAECAFxbalpPY++aF/x/6enpGjt2rCQpISFBxcXFyszM1MCBA/Xuu++qZ8+emjdvniSpZ8+eOnTokF566SXr9WlpaRozZoyefPJJSVL37t311ltv6Q9/+IMWLlzo0M/4aQjuAAEAgDplZ2drz549uv/++yVJLVu21KhRo5Senm49369fP5trbrvtNpv9b7/9VhkZGWrbtq11i4+Pt346dlPjDhAAAKhTenq6KisrFRYWZj1mGIZ8fHz0j3/8o0F9nD9/Xo888ogef/zxK85FREQ4rNaGIgABAIBaVVZWatmyZXrttdc0ePBgm3MjRozQ+++/r549e+qzzz6zOff111/b7N9yyy06cuSIunXr5vSaG4IABAAAarVu3Tr961//0oQJE+Tv729zLikpSenp6frggw80f/58TZs2TRMmTNCBAwes7xK79GWv06ZN0+23364pU6boz3/+s9q0aaMjR45o06ZNDb6L5EisAQIAALVKT09XXFzcFeFH+i0A7d27V+fOndOHH36o1atXKyYmRgsXLrS+C8zHx0eSFBMTo8zMTP34448aMGCAbr75Zs2YMcPmZbWmxB0gAABcrDm/S23t2rW1nrvtttusb4WPiYnRPffcYz330ksvqVOnTjbv7urXr58+//xz5xXbCAQgAABw1d555x3169dP7du315dffql58+a57DN+GoIABAAArtrRo0f14osv6syZM4qIiNBTTz2l1NRUV5dVKwIQAAC4aq+//rpef/11V5fRYCyCBgAApkMAAgAApkMAAgCgiV165xTq56yfFQEIAIAm4uXlJUm6cOGCiytxH5d+Vpd+do7CImgAAJqIp6enAgICVFRUJEny9fW1flIybBmGoQsXLqioqEgBAQHy9PR0aP8EIAAAmlBISIgkWUMQ6hYQEGD9mTkSAQgAgCbk4eGh0N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FAACucc1uDRAAAICzEYAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpEIAAAIDpuDQALVy4UDExMfLz85Ofn58sFovWr19vPX/x4kUlJyerffv2atu2rZKSklRYWGjTR25urhITE+Xr66ugoCA988wzqqysbOqhAAAAN+LSANSpUyfNmTNH+/bt0969e3X33Xdr+PDhOnz4sCRp6tSpWrt2rVatWqXMzEzl5eVp5MiR1uurqqqUmJio8vJyffXVV1q6dKkyMjI0Y8YMVw0JAAC4AQ/DMAxXF/F7gYGBmjdvnu677z517NhRy5cv13333SdJ+uGHH3TDDTcoKytLt99+u9avX6//+I//UF5enoKDgyVJixYt0rRp03Tq1Cl5e3s36DFLSkrk7++v4uJi+fn5OW1s7qLzXz+t8fhPcxKbuBIAaLya/obx9+vadDX//W42a4Cqqqq0YsUKlZaWymKxaN++faqoqFBcXJy1Ta9evRQREaGsrCxJUlZWlqKjo63hR5Li4+NVUlJivYtUk7KyMpWUlNhsAADAPFwegL777ju1bdtWPj4+evTRR7VmzRpFRUWpoKBA3t7eCggIsGkfHBysgoICSVJBQYFN+Ll0/tK52qSlpcnf39+6hYeHO3ZQAACgWXN5AOrZs6cOHDig3bt3a/LkyRo
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# гистограмма\n",
|
|||
|
"df.plot.hist(column=[\"Age\"], bins=80)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 13,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"Age Axes(0.125,0.11;0.775x0.77)\n",
|
|||
|
"dtype: object"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 13,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0MAAAKqCAYAAAD4/IURAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA0CElEQVR4nO3df7RXdYHv/9cB9IDAwVR+jqggo0whlmbkSC4Ihh9jCP6otO4IjukdLzQ53H7RNZWsWNNPVxOj3ZaK3lCaZsRxbC6NoWAmWGBoTA2Xw4LE4KDgcI4cARE+3z/6eqYTP+TDr4O+H4+19pLP3u+993u3Wm6f7PPZp6ZSqVQCAABQmHZtPQEAAIC2IIYAAIAiiSEAAKBIYggAACiSGAIAAIokhgAAgCKJIQAAoEhiCAAAKJIYAgAAiiSGAACAIokhAI5qf//3f5+ampoMGTKkracCwFtMTaVSqbT1JABgby644IKsW7cua9asycqVKzNgwIC2nhIAbxGeDAFw1Fq9enWefPLJfOMb30j37t0ze/bstp4SAG8hYgiAo9bs2bPztre9LRdddFEuv/zyPcbQpk2b8hd/8Repq6vL8ccfn4kTJ+aZZ55JTU1NZs2a1Wrsf/zHf+Tyyy/PCSeckI4dO+bd7353HnrooSN0NQAcbcQQAEet2bNn59JLL82xxx6bK6+8MitXrszPf/7zlu27du3KuHHjcv/992fixIn50pe+lPXr12fixIm7Hevf//3f8973vje//vWv89nPfjZf//rX07lz50yYMCFz5849kpcFwFHCd4YAOCotXbo07373u/PII49k5MiRqVQqOeWUU3LZZZfltttuS5I88MADLZ8/8YlPJPldIP3Zn/1ZHn300dx9992ZNGlSkmTkyJF54YUX8vOf/zy1tbVJkkqlkqFDh+bFF1/M//t//68tLhOANuTJEABHpdmzZ6dnz54ZPnx4kqSmpiYf/vCHM2fOnOzcuTNJMm/evBxzzDG59tprW/Zr165dJk+e3OpYL730Uh599NF86EMfyssvv5yNGzdm48aN2bRpU0aPHp2VK1fmt7/97ZG7OACOCmIIgKPOzp07M2fOnAwfPjyrV69OfX196uvrM2TIkGzYsCHz589PkvzmN79J7969c9xxx7Xa/w/fOFdfX59KpZLPf/7z6d69e6vl5ptvTpK88MILR+biADhqdGjrCQDAH3r00Uezfv36zJkzJ3PmzNlt++zZszNq1Kj9Pt6uXbuSJJ/85CczevToPY7xym6A8oghAI46s2fPTo8ePTJz5szdtj3wwAOZO3du7rjjjpx66ql57LHH8sorr7R6OlRfX99qn/79+ydJjjnmmIwcOfLwTh6ANw0vUADgqLJ169b07NkzH/zgB3PnnXfutv3JJ5/MBRdckDlz5qRDhw65/PLL9+sFCsOHD8+zzz6b5cuXp3fv3q2O+eKLL6Z79+6H/doAOLp4MgTAUeWhhx7Kyy+/nIsvvniP29/73ve2/ALWuXPn5j3veU/+5//8n6mvr8/AgQPz0EMP5aWXXkryu5cuvG7mzJkZOnRozjrrrFx77bXp379/NmzYkEWLFuX555/PM888c0SuD4CjhxgC4Kgye/bsdOzYMX/2Z3+2x+3t2rXLRRddlNmzZ2fz5s354Q9/mE984hO555570q5du1xyySW5+eabc8EFF6Rjx44t+7397W/PkiVLMn369MyaNSubNm1Kjx498q53vSs33XTTkbo8AI4ifkwOgLecBx98MJdcckmeeOKJXHDBBW09HQCOUmIIgDe1rVu3plOnTi2fd+7cmVGjRmXJkiVpaGhotQ0Afp8fkwPgTe3jH/94tm7dmvPPPz/bt2/PAw88kCeffDJf/vKXhRAA++TJEABvavfdd1++/vWvp76+Ptu2bcuAAQNy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
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# ящик с усами\n",
|
|||
|
"df.plot.box(column=\"Age\", by=\"Gender\", figsize=(10, 8))"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 14,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Axes: xlabel='Education Level'>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 14,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAisAAAGwCAYAAABo5yU1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA+FUlEQVR4nO3deVyU5f7/8fe4gRvgriSapZKWtp00NUtPJnbKtMxT5vkeK01PaZ6yxfy1aJ3U9jqlaXVM1DRttTKXFFcQF1RwQVERBRcWRXYYYOb6/VFOTZiJAnMPvJ6PxzwezXVvn3sS5s19Xfd92YwxRgAAABZVzdMFAAAAnAthBQAAWBphBQAAWBphBQAAWBphBQAAWBphBQAAWBphBQAAWFoNTxfwe06nU8ePH1f9+vVls9k8XQ4AADgPxhhlZ2crMDBQ1aqV7bUQy4WV48ePKygoyNNlAACAC5CUlKSWLVuW6T4tF1bq168v6eeT9fPz83A1AADgfGRlZSkoKMj1PV6WLBdWznT9+Pn5EVYAAPAy5TGEgwG2AADA0ggrAADA0ggrAADA0iw3ZuV8ORwOFRUVeboMS6tZs6aqV6/u6TIAALgoXhdWjDFKTk5WRkaGp0vxCgEBAWrevDnPrAEAeC2vCytngkrTpk1Vp04dvoT/gDFG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V7926Fh4dfVAE+Pj7y8fG5qH0AAHA+8gsdevbrnfoh5rikqtXt480uKKyMGTNGS5Ys0fr169WyZUtXe/PmzVVYWKiMjAy3qyspKSlq3rz5RRcLAMCFSkr
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# диаграмма с областями \n",
|
|||
|
"data = (df[[ \"Education Level\", \"Age\"]].groupby(['Education Level']).mean())\n",
|
|||
|
"data.plot.area()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 15,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Axes: xlabel='Age', ylabel='Education Level'>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 15,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmwAAAGwCAYAAAAUgTnsAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAwhUlEQVR4nO3dfXzP9f7H8efXxWZ26TJbNsYYc5nLEyGi6fAbkZAOftIlRyEHpaiTpqijUx065ydLF0I/SYlyLTsKZUbTQqtxhp0422xzMdvn94efb752+d323d7bHvfb7Xu7+Vy9v6/33vvu+/S5tFmWZQkAAADGqlbeBQAAAKBgBDYAAADDEdgAAAAMR2ADAAAwHIENAADAcAQ2AAAAwxHYAAAADFejvAuAc3JycpSUlCRvb2/ZbLbyLgcAABSBZVk6f/68AgICVK2a8/vLCGwVTFJSkgID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uZQCAIbAAAVT0m/v4v18HdJio6O1mOPPSZ/f3/dd999atu2rTZs2FDc5gAAAJAPp68SnT17tj788EMlJSVpwIABeu211zRkyBDVrl3bFfUBAABUeU4Htl27dmnGjBm69957Vb9+fVfUBAAAgOs4Hdiio6NdUQcAAADyUaxz2N5991317NlTAQEB+uWXXyRJixcv1ieffFKqxQEAAKAYgW3JkiWaNm2afv/73yslJcV+Vaifn58WL15c2vUBAABUeU4Httdff13/+Mc/9PTTT6t69er2+V26dNGhQ4dKtTgAAAAUI7AlJCT
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# диаграмма рассеяния \n",
|
|||
|
"df.plot.scatter(x =\"Age\", y =\"Education Level\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 16,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Axes: ylabel='Age'>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 16,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbkAAAGFCAYAAABg7I3+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA8bUlEQVR4nO3deXxU5aHG8d8kZCMrkE0gkR0SdkUp6K21lQJSFEFBiyKi1gVUquACKuAOiLVWpFZW71WgCm5FUIqiFcWArIVIAgQCGnZCyJ7MzP1jNBK2LLO8szzfz2c+ZGZOznkCIU/Oe5bX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HtFxYWAo49xJ49e1Z7LzhYe+jOUMmJbzqSDdkrHT/Uc7+BsgLTibyLrdJR/D9uhLWvOV5r3OqX0mv9O4htZjajF+nXrx/l5eVYLBb69u1b7b3WrVsTGhrKmjVruPDCCwGoqKhg3bp1jB07ttqya9eurTor8/jx42RlZZGWllbj9pOSkmjatCm7d++uOjYorqGSE99QXuzYS9u50lFu+XtNJ/I9x3Y7HpveAizQ7CJIuwbSr3EUYAALDg6uGlY8fc8pMjKSe+65h/Hjx9O4cWNSU1OZNm0axcXF3H777dWWfeqpp2jSpAlJSUlMnDiR+Ph4Bg0aVKsMU6ZM4f777yc2NpZ+/fpRVlbG+vXrOX78OA8++KBLvs5ApJIT71VRAjs+hi3/hF2fg7XMdCI/YocfvnM8/j0JkjpD2kBH4SXWvOfhj2J
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# круговая диаграмма \n",
|
|||
|
"data = (df[[ \"Device\", \"Age\"]].groupby(['Device']).count())\n",
|
|||
|
"data.plot.pie(x ='Device', y ='Age')"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"kernelspec": {
|
|||
|
"display_name": ".venv",
|
|||
|
"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.12.5"
|
|||
|
},
|
|||
|
"orig_nbformat": 4
|
|||
|
},
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 2
|
|||
|
}
|