This commit is contained in:
2023-04-09 21:05:30 +03:00
parent e11dd8f72c
commit 2aefddb8ff
6 changed files with 143 additions and 68 deletions

View File

@@ -13,19 +13,32 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"outputs": [],
"source": [
"dizi = [37, 40, 1, 2, 3, 3, 4, 5, 15, 20, 4, 3]"
],
"metadata": {
"collapsed": false
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-04-08T23:13:37.482288Z",
"end_time": "2023-04-08T23:13:37.486971Z"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"execution_count": 2,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"11.416666666666666\n",
"11.416666666666666\n"
]
}
],
"source": [
"def mean1(a):\n",
" return sum(a) / float(len(a))\n",
@@ -38,16 +51,37 @@
"print(mean2(dizi))"
],
"metadata": {
"collapsed": false
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-04-08T23:13:37.490658Z",
"end_time": "2023-04-08T23:13:37.494548Z"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"execution_count": 3,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4.0\n",
"4.0\n"
]
},
{
"data": {
"text/plain": "3"
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def median(ls):\n",
" # orjinla diziyi bozmayalım diye kopyasını alallım\n",
" # orjinal diziyi bozmayalım diye kopyasını alalım\n",
" data = sorted(ls)\n",
"\n",
" # // --> Floor division\n",
@@ -65,7 +99,11 @@
"statistics.mode(dizi)"
],
"metadata": {
"collapsed": false
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-04-08T23:13:37.495794Z",
"end_time": "2023-04-08T23:13:37.506885Z"
}
}
},
{