refactor
This commit is contained in:
parent
a57f15288d
commit
54581c48dd
@ -46,7 +46,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 84,
|
"execution_count": 86,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@ -147,7 +147,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 85,
|
"execution_count": 87,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@ -162,34 +162,35 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"x = dataset['Female height'].to_numpy()\n",
|
"ALPHA = 0.05\n",
|
||||||
"shapiro_test = stats.shapiro(x)\n",
|
"female_heights = dataset['Female height'].to_numpy()\n",
|
||||||
|
"shapiro_test = stats.shapiro(female_heights)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"if shapiro_test.pvalue > 0.05:\n",
|
"if shapiro_test.pvalue > ALPHA:\n",
|
||||||
" print(\"Female height: Dane mają rozkład normalny.\")\n",
|
" print(\"Female height: Dane mają rozkład normalny.\")\n",
|
||||||
"else:\n",
|
"else:\n",
|
||||||
" print(\"Female height: Dane nie mają rozkładu normalnego.\")\n",
|
" print(\"Female height: Dane nie mają rozkładu normalnego.\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"x = dataset['Male height'].to_numpy()\n",
|
"male_heights = dataset['Male height'].to_numpy()\n",
|
||||||
"shapiro_test = stats.shapiro(x)\n",
|
"shapiro_test = stats.shapiro(male_heights)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"if shapiro_test.pvalue > 0.05:\n",
|
"if shapiro_test.pvalue > ALPHA:\n",
|
||||||
" print(\"Male height: Dane mają rozkład normalny.\")\n",
|
" print(\"Male height: Dane mają rozkład normalny.\")\n",
|
||||||
"else:\n",
|
"else:\n",
|
||||||
" print(\"Male height: Dane nie mają rozkładu normalnego.\")\n",
|
" print(\"Male height: Dane nie mają rozkładu normalnego.\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"x = dataset['Weight before'].to_numpy()\n",
|
"weights_before = dataset['Weight before'].to_numpy()\n",
|
||||||
"shapiro_test = stats.shapiro(x)\n",
|
"shapiro_test = stats.shapiro(weights_before)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"if shapiro_test.pvalue > 0.05:\n",
|
"if shapiro_test.pvalue > ALPHA:\n",
|
||||||
" print(\"Weight before: Dane mają rozkład normalny.\")\n",
|
" print(\"Weight before: Dane mają rozkład normalny.\")\n",
|
||||||
"else:\n",
|
"else:\n",
|
||||||
" print(\"Weight before: Dane nie mają rozkładu normalnego.\")\n",
|
" print(\"Weight before: Dane nie mają rozkładu normalnego.\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"x = dataset['Weight after'].to_numpy()\n",
|
"weights_after = dataset['Weight after'].to_numpy()\n",
|
||||||
"shapiro_test = stats.shapiro(x)\n",
|
"shapiro_test = stats.shapiro(weights_after)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"if shapiro_test.pvalue > 0.05:\n",
|
"if shapiro_test.pvalue > ALPHA:\n",
|
||||||
" print(\"Weight after: Dane mają rozkład normalny.\")\n",
|
" print(\"Weight after: Dane mają rozkład normalny.\")\n",
|
||||||
"else:\n",
|
"else:\n",
|
||||||
" print(\"Weight after: Dane nie mają rozkładu normalnego.\")\n",
|
" print(\"Weight after: Dane nie mają rozkładu normalnego.\")\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user