Skip to content
Open

ok #15

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
148 changes: 131 additions & 17 deletions 03_05/03_05 Missing Values [Begin].ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
{
"cell_type": "code",
"execution_count": 80,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -70,23 +70,42 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"data": {
"text/plain": [
"(10127, 23)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"10127"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"To fill in the missing values, we will use the following code:"
"data[\"CLIENTNUM\"].nunique()"
]
},
{
Expand All @@ -96,6 +115,26 @@
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(10127, 23)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.shape"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -105,18 +144,88 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"data": {
"text/plain": [
"Index(['CLIENTNUM', 'Attrition_Flag', 'Customer_Age', 'Gender',\n",
" 'Dependent_count', 'Education_Level', 'Marital_Status',\n",
" 'Income_Category', 'Card_Category', 'Months_on_book',\n",
" 'Total_Relationship_Count', 'Months_Inactive_12_mon',\n",
" 'Contacts_Count_12_mon', 'Credit_Limit', 'Total_Revolving_Bal',\n",
" 'Avg_Open_To_Buy', 'Total_Amt_Chng_Q4_Q1', 'Total_Trans_Amt',\n",
" 'Total_Trans_Ct', 'Total_Ct_Chng_Q4_Q1', 'Avg_Utilization_Ratio',\n",
" 'Naive_Bayes_Classifier_Attrition_Flag_Card_Category_Contacts_Count_12_mon_Dependent_count_Education_Level_Months_Inactive_12_mon_1',\n",
" 'Naive_Bayes_Classifier_Attrition_Flag_Card_Category_Contacts_Count_12_mon_Dependent_count_Education_Level_Months_Inactive_12_mon_2'],\n",
" dtype='object')"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.columns"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Datatypes"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"CLIENTNUM int64\n",
"Attrition_Flag object\n",
"Customer_Age int64\n",
"Gender object\n",
"Dependent_count int64\n",
"Education_Level object\n",
"Marital_Status object\n",
"Income_Category object\n",
"Card_Category object\n",
"Months_on_book int64\n",
"Total_Relationship_Count int64\n",
"Months_Inactive_12_mon int64\n",
"Contacts_Count_12_mon int64\n",
"Credit_Limit float64\n",
"Total_Revolving_Bal int64\n",
"Avg_Open_To_Buy float64\n",
"Total_Amt_Chng_Q4_Q1 float64\n",
"Total_Trans_Amt int64\n",
"Total_Trans_Ct int64\n",
"Total_Ct_Chng_Q4_Q1 float64\n",
"Avg_Utilization_Ratio float64\n",
"dtype: object"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.dtypes"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -141,7 +250,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.10.4 (main, Jan 18 2023, 00:26:41) [GCC 9.4.0]"
},
"vscode": {
"interpreter": {
"hash": "3ad933181bd8a04b432d3370b9dc3b0662ad032c4dfaa4e4f1596c548f763858"
}
}
},
"nbformat": 4,
Expand Down