188 lines
5.5 KiB
Plaintext
188 lines
5.5 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 11,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import pandas as pd\n",
|
||
|
"data_base = pd.read_csv(\"csv/option4.csv\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 19,
|
||
|
"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>id</th>\n",
|
||
|
" <th>gender</th>\n",
|
||
|
" <th>age</th>\n",
|
||
|
" <th>hypertension</th>\n",
|
||
|
" <th>heart_disease</th>\n",
|
||
|
" <th>ever_married</th>\n",
|
||
|
" <th>work_type</th>\n",
|
||
|
" <th>Residence_type</th>\n",
|
||
|
" <th>avg_glucose_level</th>\n",
|
||
|
" <th>bmi</th>\n",
|
||
|
" <th>smoking_status</th>\n",
|
||
|
" <th>stroke</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>0</th>\n",
|
||
|
" <td>9046</td>\n",
|
||
|
" <td>Male</td>\n",
|
||
|
" <td>67.0</td>\n",
|
||
|
" <td>0</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>Yes</td>\n",
|
||
|
" <td>Private</td>\n",
|
||
|
" <td>Urban</td>\n",
|
||
|
" <td>228.69</td>\n",
|
||
|
" <td>36.6</td>\n",
|
||
|
" <td>formerly smoked</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>1</th>\n",
|
||
|
" <td>51676</td>\n",
|
||
|
" <td>Female</td>\n",
|
||
|
" <td>61.0</td>\n",
|
||
|
" <td>0</td>\n",
|
||
|
" <td>0</td>\n",
|
||
|
" <td>Yes</td>\n",
|
||
|
" <td>Self-employed</td>\n",
|
||
|
" <td>Rural</td>\n",
|
||
|
" <td>202.21</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>never smoked</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>2</th>\n",
|
||
|
" <td>31112</td>\n",
|
||
|
" <td>Male</td>\n",
|
||
|
" <td>80.0</td>\n",
|
||
|
" <td>0</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>Yes</td>\n",
|
||
|
" <td>Private</td>\n",
|
||
|
" <td>Rural</td>\n",
|
||
|
" <td>105.92</td>\n",
|
||
|
" <td>32.5</td>\n",
|
||
|
" <td>never smoked</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>3</th>\n",
|
||
|
" <td>60182</td>\n",
|
||
|
" <td>Female</td>\n",
|
||
|
" <td>49.0</td>\n",
|
||
|
" <td>0</td>\n",
|
||
|
" <td>0</td>\n",
|
||
|
" <td>Yes</td>\n",
|
||
|
" <td>Private</td>\n",
|
||
|
" <td>Urban</td>\n",
|
||
|
" <td>171.23</td>\n",
|
||
|
" <td>34.4</td>\n",
|
||
|
" <td>smokes</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>4</th>\n",
|
||
|
" <td>1665</td>\n",
|
||
|
" <td>Female</td>\n",
|
||
|
" <td>79.0</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>0</td>\n",
|
||
|
" <td>Yes</td>\n",
|
||
|
" <td>Self-employed</td>\n",
|
||
|
" <td>Rural</td>\n",
|
||
|
" <td>174.12</td>\n",
|
||
|
" <td>24.0</td>\n",
|
||
|
" <td>never smoked</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" id gender age hypertension heart_disease ever_married \\\n",
|
||
|
"0 9046 Male 67.0 0 1 Yes \n",
|
||
|
"1 51676 Female 61.0 0 0 Yes \n",
|
||
|
"2 31112 Male 80.0 0 1 Yes \n",
|
||
|
"3 60182 Female 49.0 0 0 Yes \n",
|
||
|
"4 1665 Female 79.0 1 0 Yes \n",
|
||
|
"\n",
|
||
|
" work_type Residence_type avg_glucose_level bmi smoking_status \\\n",
|
||
|
"0 Private Urban 228.69 36.6 formerly smoked \n",
|
||
|
"1 Self-employed Rural 202.21 NaN never smoked \n",
|
||
|
"2 Private Rural 105.92 32.5 never smoked \n",
|
||
|
"3 Private Urban 171.23 34.4 smokes \n",
|
||
|
"4 Self-employed Rural 174.12 24.0 never smoked \n",
|
||
|
"\n",
|
||
|
" stroke \n",
|
||
|
"0 1 \n",
|
||
|
"1 1 \n",
|
||
|
"2 1 \n",
|
||
|
"3 1 \n",
|
||
|
"4 1 "
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 19,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"data_base.head()"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"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.6"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|