initial commit for YZM509

This commit is contained in:
2023-04-04 12:33:38 +03:00
parent a02bc91915
commit 51080b1617
12 changed files with 1546 additions and 16 deletions

View File

@@ -0,0 +1,106 @@
{
"cells": [
{
"cell_type": "markdown",
"source": [
"* Mean (Ortalama)\n",
"* Median (En orta değer) (Mean of the two middle values)\n",
"* Mode: the most common value in data"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"dizi = [37, 40, 1, 2, 3, 3, 4, 5, 15, 20, 4, 3]"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"def mean1(a):\n",
" return sum(a) / float(len(a))\n",
"\n",
"import functools\n",
"def mean2(a):\n",
" return functools.reduce(lambda x, y: x + y, a) / float(len(a))\n",
"\n",
"print(mean1(dizi))\n",
"print(mean2(dizi))"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"def median(ls):\n",
" # orjinla diziyi bozmayalım diye kopyasını alallım\n",
" data = sorted(ls)\n",
"\n",
" # // --> Floor division\n",
" mid = len(data) // 2\n",
"\n",
" # ~ --> bitwise not\n",
" # https://www.w3schools.com/python/trypython.asp?filename=demo_oper_not\n",
" med = (data[mid] + data[~mid]) / 2\n",
" return med\n",
"\n",
"print(median(dizi))\n",
"\n",
"import statistics\n",
"print(statistics.median(dizi))\n",
"statistics.mode(dizi)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"source": [
"Varyans = Topla((Her terim - ortalama))^2 / n\n",
"* Varyans, verinin ortalamadan ne kadar uzaksadığının / yakınsadığının ölçüsü\n",
"* Veri örneğinin varyansı için, yine tüm değerlerin ortalaması kullanılır ama n-1'e bölünür.\n",
"\n",
"Standart Sapma = karekök(varyans)"
],
"metadata": {
"collapsed": false
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.10"
}
},
"nbformat": 4,
"nbformat_minor": 1
}