Answer To: You can use python packages for solving a theory part. Theory (60 points) 1. Joon takes a...
Abhishek answered on Sep 23 2021
{
"cells": [
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from scipy import stats\n",
"from scipy.stats import sem, t\n",
"from numpy import mean"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" bank-got2icve.csv 't test.ipynb'\r\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
"df=pd.read_csv('bank-got2icve.csv', index_col=[0])"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Index(['Age', 'Income', 'Education', 'PersonalLoan'], dtype='object')"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.columns"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
"df_0=df.loc[df['PersonalLoan']==0]\n",
"df_1=df.loc[df['PersonalLoan']==1]"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Ttest_indResult(statistic=0.5461906615539323, pvalue=0.584959263705325)"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
...