├── .DS_Store ├── .gitignore ├── Bagian 1 - Pengenalan Python untuk Data Science ├── 1. Variabel dan Tipe Data.ipynb ├── 2. List Python.ipynb ├── 3. Fungsi, Method, Package.ipynb ├── 4. Numpy.ipynb ├── Kunci Jawaban │ ├── Kunci Jawaban 1 Variabel dan Tipe Data.ipynb │ └── Kunci Jawaban Latihan 2 List Python.ipynb ├── Latihan 1 Variabel dan Tipe Data.ipynb ├── Latihan 2 List Python.ipynb ├── Latihan 3 Fungsi, Method, Package.ipynb └── Latihan 4 Numpy.ipynb ├── Bagian 2 - Python Lanjutan ├── 1. Plot Dasar menggunakan matplotlib.ipynb ├── 2. Dictionaries & Pandas.ipynb ├── 3. Logic, Control Flow and Filtering .ipynb ├── 4. Loop.ipynb ├── negara.csv └── tabular.png ├── Bagian 3 - Hacker Statistics ├── 1. Koin.ipynb └── 2. Dadu.ipynb ├── Bagian 4 - Fundamental Pandas ├── .DS_Store ├── 1. Pengenalan Pandas.ipynb ├── 2. Exploratory Data Analysis.ipynb ├── 3. Indexing Time Series.ipynb ├── aapl.csv ├── iris.csv ├── sales-feb-2015.csv └── sp500.csv ├── Bagian 5 - Statistik dan Python 1 ├── 1. Exploratory Data Analysis.ipynb ├── 2. Summary Statistics.ipynb ├── 2008_all_states.csv ├── 2008_swing_states.csv ├── 3. Probabilistik and Statistik Inferensia.ipynb ├── 4. Probability Density Function.ipynb ├── Gaussian-1.png ├── Gaussian-2.png ├── belmont.csv ├── iris.csv ├── michelson_speed_of_light.csv └── pearson_r.png ├── Bagian 6 - Statistik dan Python 2 ├── 1. Regresi Linear.ipynb ├── 2008_all_states.csv ├── 2008_swing_states.csv ├── ans1.png ├── ans2.png ├── ans3.png ├── ans4.png ├── ans5.png ├── anscombe.csv ├── bee_sperm.csv ├── female_literacy_fertility.csv ├── finch_beaks_1975.csv ├── finch_beaks_2012.csv ├── fortis_beak_depth_heredity.csv ├── frog_tongue.csv ├── mlb_nohitters.csv ├── scandens_beak_depth_heredity.csv └── sheffield_weather_station.csv ├── Bagian 7 - Supervised Learning ├── .DS_Store ├── 1. Supervised Learning with Python Introduction.ipynb ├── 2. Regresi Linear dan Cross Validation.ipynb ├── 3. Classifaction Metrics.ipynb ├── Bonus │ ├── .DS_Store │ ├── Decision Trees and Random Forests.ipynb │ └── Support Vector Machines.ipynb ├── boston.csv ├── img │ ├── cm.png │ ├── cv.png │ ├── decision_boundary.png │ ├── k_nearest_neighbours.png │ ├── loss-function.png │ ├── n_neigbors.png │ └── underfitting_overfitting.png ├── iris.csv └── spambase.data ├── Bagian 8 - Unsupervised Learning ├── .DS_Store ├── 1. K-Means Clustering.ipynb ├── img │ └── inertia.png └── iris.csv ├── Bagian Bonus - Natural Language Processing ├── .DS_Store ├── 1. Dasar mengolah data text.ipynb ├── 2. Regex.ipynb ├── 3. Regex dan Pandas.ipynb ├── 4. Dasar NLP.ipynb └── 5. Klasifikasi Teks.ipynb ├── CONTRIBUTORS.md ├── LICENSE ├── README.md └── images ├── .DS_Store ├── anaconda-navigator.png ├── jupyter-lab.png └── jupyter-notebook.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | env/ 14 | build/ 15 | develop-eggs/ 16 | dist/ 17 | downloads/ 18 | eggs/ 19 | .eggs/ 20 | lib/ 21 | lib64/ 22 | parts/ 23 | sdist/ 24 | var/ 25 | wheels/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | .hypothesis/ 50 | 51 | # Translations 52 | *.mo 53 | *.pot 54 | 55 | # Django stuff: 56 | *.log 57 | local_settings.py 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # dotenv 85 | .env 86 | 87 | # virtualenv 88 | .venv 89 | venv/ 90 | ENV/ 91 | 92 | # Spyder project settings 93 | .spyderproject 94 | .spyproject 95 | 96 | # Rope project settings 97 | .ropeproject 98 | 99 | # mkdocs documentation 100 | /site 101 | 102 | # mypy 103 | .mypy_cache/ 104 | -------------------------------------------------------------------------------- /Bagian 1 - Pengenalan Python untuk Data Science/1. Variabel dan Tipe Data.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Python Dasar" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## 1. Hello World" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "name": "stdout", 24 | "output_type": "stream", 25 | "text": [ 26 | "Hello World\n" 27 | ] 28 | } 29 | ], 30 | "source": [ 31 | "print('Hello World')" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "metadata": {}, 37 | "source": [ 38 | "## 2. Variabel \n", 39 | "### - Spesifik, *case sensitive* , dan dapat dipanggil melalui nama variabel" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 8, 45 | "metadata": { 46 | "collapsed": true 47 | }, 48 | "outputs": [], 49 | "source": [ 50 | "tinggi = 1.65\n", 51 | "berat = 55" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 13, 57 | "metadata": {}, 58 | "outputs": [ 59 | { 60 | "data": { 61 | "text/plain": [ 62 | "172" 63 | ] 64 | }, 65 | "execution_count": 13, 66 | "metadata": {}, 67 | "output_type": "execute_result" 68 | } 69 | ], 70 | "source": [ 71 | "tinggi" 72 | ] 73 | }, 74 | { 75 | "cell_type": "code", 76 | "execution_count": 10, 77 | "metadata": {}, 78 | "outputs": [ 79 | { 80 | "data": { 81 | "text/plain": [ 82 | "85" 83 | ] 84 | }, 85 | "execution_count": 10, 86 | "metadata": {}, 87 | "output_type": "execute_result" 88 | } 89 | ], 90 | "source": [ 91 | "berat" 92 | ] 93 | }, 94 | { 95 | "cell_type": "markdown", 96 | "metadata": {}, 97 | "source": [ 98 | "Menghitung BMI atau *Body Mass Index* dapat kita gunakan persamaan berikut $BMI = \\frac{Berat}{Tinggi^2}$" 99 | ] 100 | }, 101 | { 102 | "cell_type": "code", 103 | "execution_count": 11, 104 | "metadata": { 105 | "collapsed": true 106 | }, 107 | "outputs": [], 108 | "source": [ 109 | "tinggi = 1.78 # Meter\n", 110 | "berat = 70 # Kilogram" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": 12, 116 | "metadata": {}, 117 | "outputs": [ 118 | { 119 | "data": { 120 | "text/plain": [ 121 | "22.093170054286073" 122 | ] 123 | }, 124 | "execution_count": 12, 125 | "metadata": {}, 126 | "output_type": "execute_result" 127 | } 128 | ], 129 | "source": [ 130 | "70 / 1.78 ** 2" 131 | ] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "execution_count": 6, 136 | "metadata": {}, 137 | "outputs": [ 138 | { 139 | "data": { 140 | "text/plain": [ 141 | "22.093170054286073" 142 | ] 143 | }, 144 | "execution_count": 6, 145 | "metadata": {}, 146 | "output_type": "execute_result" 147 | } 148 | ], 149 | "source": [ 150 | "berat / tinggi ** 2" 151 | ] 152 | }, 153 | { 154 | "cell_type": "code", 155 | "execution_count": 14, 156 | "metadata": {}, 157 | "outputs": [ 158 | { 159 | "data": { 160 | "text/plain": [ 161 | "22.093170054286073" 162 | ] 163 | }, 164 | "execution_count": 14, 165 | "metadata": {}, 166 | "output_type": "execute_result" 167 | } 168 | ], 169 | "source": [ 170 | "bmi" 171 | ] 172 | }, 173 | { 174 | "cell_type": "markdown", 175 | "metadata": {}, 176 | "source": [ 177 | "### *Reproducibility*" 178 | ] 179 | }, 180 | { 181 | "cell_type": "code", 182 | "execution_count": 16, 183 | "metadata": { 184 | "scrolled": true 185 | }, 186 | "outputs": [ 187 | { 188 | "name": "stdout", 189 | "output_type": "stream", 190 | "text": [ 191 | "30.116213151927443\n" 192 | ] 193 | } 194 | ], 195 | "source": [ 196 | "tinggi = 1.68\n", 197 | "berat = 85 # Coba ganti berat dengan angka yang lain apa yang terjadi?\n", 198 | "bmi = berat / tinggi ** 2\n", 199 | "print(bmi)" 200 | ] 201 | }, 202 | { 203 | "cell_type": "markdown", 204 | "metadata": {}, 205 | "source": [ 206 | "## Tipe Data" 207 | ] 208 | }, 209 | { 210 | "cell_type": "code", 211 | "execution_count": 17, 212 | "metadata": {}, 213 | "outputs": [ 214 | { 215 | "data": { 216 | "text/plain": [ 217 | "float" 218 | ] 219 | }, 220 | "execution_count": 17, 221 | "metadata": {}, 222 | "output_type": "execute_result" 223 | } 224 | ], 225 | "source": [ 226 | "type(bmi)" 227 | ] 228 | }, 229 | { 230 | "cell_type": "code", 231 | "execution_count": 18, 232 | "metadata": { 233 | "collapsed": true 234 | }, 235 | "outputs": [], 236 | "source": [ 237 | "jumlah_hari = 7" 238 | ] 239 | }, 240 | { 241 | "cell_type": "code", 242 | "execution_count": 18, 243 | "metadata": {}, 244 | "outputs": [ 245 | { 246 | "data": { 247 | "text/plain": [ 248 | "int" 249 | ] 250 | }, 251 | "execution_count": 18, 252 | "metadata": {}, 253 | "output_type": "execute_result" 254 | } 255 | ], 256 | "source": [ 257 | "type(jumlah_hari)" 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": 19, 263 | "metadata": { 264 | "collapsed": true 265 | }, 266 | "outputs": [], 267 | "source": [ 268 | "x = 'BMI itu apa?'\n", 269 | "y = 'Haha'" 270 | ] 271 | }, 272 | { 273 | "cell_type": "code", 274 | "execution_count": 20, 275 | "metadata": {}, 276 | "outputs": [ 277 | { 278 | "name": "stdout", 279 | "output_type": "stream", 280 | "text": [ 281 | " \n" 282 | ] 283 | } 284 | ], 285 | "source": [ 286 | "print(type(x), type(y))" 287 | ] 288 | }, 289 | { 290 | "cell_type": "code", 291 | "execution_count": 21, 292 | "metadata": {}, 293 | "outputs": [ 294 | { 295 | "data": { 296 | "text/plain": [ 297 | "str" 298 | ] 299 | }, 300 | "execution_count": 21, 301 | "metadata": {}, 302 | "output_type": "execute_result" 303 | } 304 | ], 305 | "source": [ 306 | "type(x)" 307 | ] 308 | }, 309 | { 310 | "cell_type": "code", 311 | "execution_count": 22, 312 | "metadata": {}, 313 | "outputs": [ 314 | { 315 | "data": { 316 | "text/plain": [ 317 | "str" 318 | ] 319 | }, 320 | "execution_count": 22, 321 | "metadata": {}, 322 | "output_type": "execute_result" 323 | } 324 | ], 325 | "source": [ 326 | "type(y)" 327 | ] 328 | }, 329 | { 330 | "cell_type": "code", 331 | "execution_count": 23, 332 | "metadata": {}, 333 | "outputs": [ 334 | { 335 | "data": { 336 | "text/plain": [ 337 | "bool" 338 | ] 339 | }, 340 | "execution_count": 23, 341 | "metadata": {}, 342 | "output_type": "execute_result" 343 | } 344 | ], 345 | "source": [ 346 | "z = True\n", 347 | "type(z)" 348 | ] 349 | }, 350 | { 351 | "cell_type": "code", 352 | "execution_count": null, 353 | "metadata": { 354 | "collapsed": true 355 | }, 356 | "outputs": [], 357 | "source": [] 358 | } 359 | ], 360 | "metadata": { 361 | "kernelspec": { 362 | "display_name": "Python 3", 363 | "language": "python", 364 | "name": "python3" 365 | }, 366 | "language_info": { 367 | "codemirror_mode": { 368 | "name": "ipython", 369 | "version": 3 370 | }, 371 | "file_extension": ".py", 372 | "mimetype": "text/x-python", 373 | "name": "python", 374 | "nbconvert_exporter": "python", 375 | "pygments_lexer": "ipython3", 376 | "version": "3.7.0" 377 | } 378 | }, 379 | "nbformat": 4, 380 | "nbformat_minor": 2 381 | } 382 | -------------------------------------------------------------------------------- /Bagian 1 - Pengenalan Python untuk Data Science/Kunci Jawaban/Kunci Jawaban 1 Variabel dan Tipe Data.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "(1). Silahkan print(8 / 7) dan berikan *comment* # Ini adalah pembagian, lihat contoh di bawah ini" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [ 15 | { 16 | "name": "stdout", 17 | "output_type": "stream", 18 | "text": [ 19 | "32\n" 20 | ] 21 | } 22 | ], 23 | "source": [ 24 | "# Ini adalah perkalian\n", 25 | "print(4 * 8)" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 1, 31 | "metadata": {}, 32 | "outputs": [ 33 | { 34 | "name": "stdout", 35 | "output_type": "stream", 36 | "text": [ 37 | "1.1428571428571428\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "# Ini adalah pembagian\n", 43 | "print(8/7)" 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "metadata": {}, 49 | "source": [ 50 | "#### Python sebagai kalkulator" 51 | ] 52 | }, 53 | { 54 | "cell_type": "markdown", 55 | "metadata": {}, 56 | "source": [ 57 | "(2) Lihat beberapa contoh di bawah ini" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": 3, 63 | "metadata": {}, 64 | "outputs": [ 65 | { 66 | "name": "stdout", 67 | "output_type": "stream", 68 | "text": [ 69 | "10\n", 70 | "0\n", 71 | "15\n", 72 | "5.0\n", 73 | "16\n", 74 | "4\n" 75 | ] 76 | } 77 | ], 78 | "source": [ 79 | "# Penambahan dan pengurangan\n", 80 | "print(5 + 5)\n", 81 | "print(5 - 5)\n", 82 | "\n", 83 | "# Perkalian dan pembagian\n", 84 | "print(3 * 5)\n", 85 | "print(10 / 2)\n", 86 | "\n", 87 | "# Perpangkatan\n", 88 | "print(4 ** 2)\n", 89 | "\n", 90 | "# Pembagian Modulo\n", 91 | "print(18 % 7)\n" 92 | ] 93 | }, 94 | { 95 | "cell_type": "markdown", 96 | "metadata": {}, 97 | "source": [ 98 | "Jika kamu memilik uang seratus ribu rupiah di bank dan bank memberikan bunga 10 persen setiap tahunnya, berapakah uang yang kamu dapat dalam 7 tahun? Gunakan Python menjawabnya" 99 | ] 100 | }, 101 | { 102 | "cell_type": "code", 103 | "execution_count": 2, 104 | "metadata": {}, 105 | "outputs": [ 106 | { 107 | "name": "stdout", 108 | "output_type": "stream", 109 | "text": [ 110 | "194871.7100000001\n" 111 | ] 112 | } 113 | ], 114 | "source": [ 115 | "print(100000 * 1.1 ** 7)" 116 | ] 117 | }, 118 | { 119 | "cell_type": "markdown", 120 | "metadata": {}, 121 | "source": [ 122 | "(3) Buat variabel simpanan dengan nilai 100000, kemudian print variabel simpanan" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": 3, 128 | "metadata": { 129 | "collapsed": true 130 | }, 131 | "outputs": [], 132 | "source": [ 133 | "simpanan = 100000" 134 | ] 135 | }, 136 | { 137 | "cell_type": "markdown", 138 | "metadata": {}, 139 | "source": [ 140 | "(4)\n", 141 | "- Buat variable faktor = 1.10\n", 142 | "- Gunakan variabel simpanan dan faktor untuk menentukan berapa hasil yang didapat dalam 10 tahun dan simpan dalam variabel hasil\n", 143 | "- print hasil" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": 5, 149 | "metadata": {}, 150 | "outputs": [ 151 | { 152 | "name": "stdout", 153 | "output_type": "stream", 154 | "text": [ 155 | "259374.24601000024\n" 156 | ] 157 | } 158 | ], 159 | "source": [ 160 | "faktor = 1.10\n", 161 | "hasil = simpanan * faktor ** 10\n", 162 | "print(hasil)" 163 | ] 164 | }, 165 | { 166 | "cell_type": "markdown", 167 | "metadata": {}, 168 | "source": [ 169 | "(5) \n", 170 | "- Kalikan simpanan dan faktor dan simpan dalam variabel hasil_1\n", 171 | "- Apakah tipe data dari hasil 1? Silahkan print tipe datanya\n", 172 | "- Buatlah variabel desc = \"Sains Data\"\n", 173 | "- Jumlahkan desc dengan desc bagaimana hasilnya? Simpan pada variabel dobel_desc\n", 174 | "- print dobel_desc" 175 | ] 176 | }, 177 | { 178 | "cell_type": "code", 179 | "execution_count": 6, 180 | "metadata": {}, 181 | "outputs": [ 182 | { 183 | "name": "stdout", 184 | "output_type": "stream", 185 | "text": [ 186 | "\n", 187 | "Sains DataSains Data\n" 188 | ] 189 | } 190 | ], 191 | "source": [ 192 | "hasil_1 = faktor * simpanan\n", 193 | "print(type(hasil_1))\n", 194 | "desc = \"Sains Data\"\n", 195 | "dobel_desc = desc + desc\n", 196 | "print(dobel_desc)" 197 | ] 198 | }, 199 | { 200 | "cell_type": "markdown", 201 | "metadata": {}, 202 | "source": [ 203 | "#### Konversi tipe data / casting" 204 | ] 205 | }, 206 | { 207 | "cell_type": "markdown", 208 | "metadata": {}, 209 | "source": [ 210 | "Kamu bisa merubah tipe data seperti berikut" 211 | ] 212 | }, 213 | { 214 | "cell_type": "code", 215 | "execution_count": 7, 216 | "metadata": {}, 217 | "outputs": [ 218 | { 219 | "data": { 220 | "text/plain": [ 221 | "'5'" 222 | ] 223 | }, 224 | "execution_count": 7, 225 | "metadata": {}, 226 | "output_type": "execute_result" 227 | } 228 | ], 229 | "source": [ 230 | "a = 5\n", 231 | "a_baru = str(a)\n", 232 | "a_baru" 233 | ] 234 | }, 235 | { 236 | "cell_type": "code", 237 | "execution_count": 8, 238 | "metadata": {}, 239 | "outputs": [ 240 | { 241 | "data": { 242 | "text/plain": [ 243 | "str" 244 | ] 245 | }, 246 | "execution_count": 8, 247 | "metadata": {}, 248 | "output_type": "execute_result" 249 | } 250 | ], 251 | "source": [ 252 | "type(a_baru)\n" 253 | ] 254 | }, 255 | { 256 | "cell_type": "code", 257 | "execution_count": 9, 258 | "metadata": {}, 259 | "outputs": [ 260 | { 261 | "data": { 262 | "text/plain": [ 263 | "300" 264 | ] 265 | }, 266 | "execution_count": 9, 267 | "metadata": {}, 268 | "output_type": "execute_result" 269 | } 270 | ], 271 | "source": [ 272 | "b = '300'\n", 273 | "b_baru = int(b)\n", 274 | "b_baru" 275 | ] 276 | }, 277 | { 278 | "cell_type": "code", 279 | "execution_count": 10, 280 | "metadata": {}, 281 | "outputs": [ 282 | { 283 | "data": { 284 | "text/plain": [ 285 | "int" 286 | ] 287 | }, 288 | "execution_count": 10, 289 | "metadata": {}, 290 | "output_type": "execute_result" 291 | } 292 | ], 293 | "source": [ 294 | "type(b_baru)" 295 | ] 296 | }, 297 | { 298 | "cell_type": "markdown", 299 | "metadata": {}, 300 | "source": [ 301 | "(6).\n", 302 | "Lihat error di bawah ini bagaiman kamu menyelesaikannya?" 303 | ] 304 | }, 305 | { 306 | "cell_type": "code", 307 | "execution_count": 1, 308 | "metadata": {}, 309 | "outputs": [ 310 | { 311 | "name": "stdout", 312 | "output_type": "stream", 313 | "text": [ 314 | "Uang saya awalnya 100000 dan saya sekarang punya 194871.7100000001. Kueren cak\n" 315 | ] 316 | } 317 | ], 318 | "source": [ 319 | "# Simpanan dan hasil\n", 320 | "simpanan_x = 100000\n", 321 | "hasil_x = 100000 * 1.10 ** 7\n", 322 | "\n", 323 | "# Fix the printout\n", 324 | "print(\"Uang saya awalnya \" + str(simpanan_x) + \" dan saya sekarang punya \" + str(hasil_x) + \". Kueren cak\")\n" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": 2, 330 | "metadata": {}, 331 | "outputs": [ 332 | { 333 | "name": "stdout", 334 | "output_type": "stream", 335 | "text": [ 336 | "3.1415926\n" 337 | ] 338 | } 339 | ], 340 | "source": [ 341 | "# Selesaikan juga ini\n", 342 | "pi_string = \"3.1415926\"\n", 343 | "\n", 344 | "# Konversi pi_string menjadi float simpan dalam variabel pi_float dan kemudian print\n", 345 | "pi_float = float(pi_string)\n", 346 | "print(pi_float)" 347 | ] 348 | }, 349 | { 350 | "cell_type": "code", 351 | "execution_count": null, 352 | "metadata": { 353 | "collapsed": true 354 | }, 355 | "outputs": [], 356 | "source": [] 357 | } 358 | ], 359 | "metadata": { 360 | "kernelspec": { 361 | "display_name": "Python 3", 362 | "language": "python", 363 | "name": "python3" 364 | }, 365 | "language_info": { 366 | "codemirror_mode": { 367 | "name": "ipython", 368 | "version": 3 369 | }, 370 | "file_extension": ".py", 371 | "mimetype": "text/x-python", 372 | "name": "python", 373 | "nbconvert_exporter": "python", 374 | "pygments_lexer": "ipython3", 375 | "version": "3.6.1" 376 | } 377 | }, 378 | "nbformat": 4, 379 | "nbformat_minor": 2 380 | } 381 | -------------------------------------------------------------------------------- /Bagian 1 - Pengenalan Python untuk Data Science/Kunci Jawaban/Kunci Jawaban Latihan 2 List Python.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "(1) Lihat Petunjuk di bawah ini" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [ 15 | { 16 | "name": "stdout", 17 | "output_type": "stream", 18 | "text": [ 19 | "[11.25, 18.0, 20.0, 10.75, 9.5]\n" 20 | ] 21 | } 22 | ], 23 | "source": [ 24 | "# Luas ruangan dalam meter persegi\n", 25 | "hall = 11.25\n", 26 | "kit = 18.0\n", 27 | "liv = 20.0\n", 28 | "bed = 10.75\n", 29 | "bath = 9.50\n", 30 | "\n", 31 | "# Buatlah list dengan nama area berdasarkan variabel diatas dan print area\n", 32 | "area = [hall, kit, liv, bed, bath]\n", 33 | "print(area)" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "metadata": {}, 39 | "source": [ 40 | "(2)\n", 41 | "- Buatlah list dengan nama variabel area_2 kemudian sisipkan \"Hallway\", \"Kitchen\", \"Living Room\", \"Bed Room\", dan \"Bath Room\" sesuai dengan ukuran masing masing\n", 42 | "- contoh ['hallway', hall, ..., ..., ...]" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 3, 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "name": "stdout", 52 | "output_type": "stream", 53 | "text": [ 54 | "['Hallway', 11.25, 'Kitchen', 18.0, 'Living Room', 20.0, 'Bed Room', 10.75, 'Bath Room', 9.5]\n" 55 | ] 56 | } 57 | ], 58 | "source": [ 59 | "area_2 = ['Hallway', hall, 'Kitchen', kit, 'Living Room', liv, 'Bed Room', bed, 'Bath Room', bath]\n", 60 | "print(area_2)" 61 | ] 62 | }, 63 | { 64 | "cell_type": "markdown", 65 | "metadata": {}, 66 | "source": [ 67 | "(3)\n", 68 | "- A. [1, 3, 4, 2] B. [[1, 2, 3], [4, 5, 7]] C. [1 + 2, \"a\" * 5, 3]\n", 69 | "- Manakah yang bisa dikatakan membuat list yang benar?\n", 70 | "- A, B, C\n", 71 | "- B\n", 72 | "- B dan C\n", 73 | "- C" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": 3, 79 | "metadata": { 80 | "collapsed": true 81 | }, 82 | "outputs": [], 83 | "source": [ 84 | "# A" 85 | ] 86 | }, 87 | { 88 | "cell_type": "markdown", 89 | "metadata": {}, 90 | "source": [ 91 | "(4) Selesaikan list of list dari rumah di bawah ini, kemudian print rumah serta tipe data dari rumah" 92 | ] 93 | }, 94 | { 95 | "cell_type": "code", 96 | "execution_count": 4, 97 | "metadata": {}, 98 | "outputs": [ 99 | { 100 | "name": "stdout", 101 | "output_type": "stream", 102 | "text": [ 103 | "[['Hallway', 11.25], ['Kitchen', 18.0], ['Living Room', 20.0], ['Bed Room', 10.75], ['Bath Room', 9.5]]\n", 104 | "\n" 105 | ] 106 | } 107 | ], 108 | "source": [ 109 | "rumah = [['Hallway', hall],\n", 110 | " ['Kitchen',kit],\n", 111 | " ['Living Room', liv],\n", 112 | " ['Bed Room', bed],\n", 113 | " ['Bath Room', bath]\n", 114 | " ]\n", 115 | "print(rumah)\n", 116 | "print(type(rumah))" 117 | ] 118 | }, 119 | { 120 | "cell_type": "markdown", 121 | "metadata": {}, 122 | "source": [ 123 | "(5) Selesaikan permasalahan di bawah ini" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 5, 129 | "metadata": {}, 130 | "outputs": [ 131 | { 132 | "name": "stdout", 133 | "output_type": "stream", 134 | "text": [ 135 | "11.25\n", 136 | "9.5\n", 137 | "living room\n" 138 | ] 139 | } 140 | ], 141 | "source": [ 142 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 143 | "\n", 144 | "# Print elemen kedua dari area_3\n", 145 | "print(area_3[1])\n", 146 | "\n", 147 | "# Print elemen terakhir dari area_3\n", 148 | "print(area_3[-1])\n", 149 | "\n", 150 | "# Print area dari \"living room\n", 151 | "\n", 152 | "print(area_3[4])" 153 | ] 154 | }, 155 | { 156 | "cell_type": "markdown", 157 | "metadata": {}, 158 | "source": [ 159 | "(6) Selesaikan permasalah di bawah ini" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": 7, 165 | "metadata": {}, 166 | "outputs": [ 167 | { 168 | "name": "stdout", 169 | "output_type": "stream", 170 | "text": [ 171 | "28.75\n" 172 | ] 173 | } 174 | ], 175 | "source": [ 176 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 177 | "\n", 178 | "# Jumlahkan area kitchen dan bedroom kedalam variabel area_makan_favorit\n", 179 | "area_makanan_favorit = area_3[3] + area_3[7]\n", 180 | "\n", 181 | "# Print variabel area_makan_favorit\n", 182 | "print(area_makanan_favorit)\n" 183 | ] 184 | }, 185 | { 186 | "cell_type": "markdown", 187 | "metadata": {}, 188 | "source": [ 189 | "(7) Selesaikan permasalahan di bawah ini" 190 | ] 191 | }, 192 | { 193 | "cell_type": "code", 194 | "execution_count": 12, 195 | "metadata": {}, 196 | "outputs": [ 197 | { 198 | "name": "stdout", 199 | "output_type": "stream", 200 | "text": [ 201 | "['hallway', 11.25, 'kitchen', 18.0, 'living room', 20.0]\n", 202 | "['bedroom', 10.75, 'bathroom', 9.5]\n" 203 | ] 204 | } 205 | ], 206 | "source": [ 207 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 208 | "\n", 209 | "# Guanakan slicing untuk menyimpan 6 elemen pertama dari area_3 simpan pada variabel lantai_1\n", 210 | "lantai_1 = area_3[0:6]\n", 211 | "\n", 212 | "# Gunakan slicing untuk menyimpan 4 elemen terakhir dari area_3 simpan pada variabel lantai_2\n", 213 | "lantai_2 = area_3[-4:]\n", 214 | "\n", 215 | "# Print lantai_1 dan lantai_2\n", 216 | "print(lantai_1)\n", 217 | "print(lantai_2)" 218 | ] 219 | }, 220 | { 221 | "cell_type": "markdown", 222 | "metadata": {}, 223 | "source": [ 224 | "(8) Lihat contoh di bawah ini print hasilnya" 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": 9, 230 | "metadata": {}, 231 | "outputs": [ 232 | { 233 | "name": "stdout", 234 | "output_type": "stream", 235 | "text": [ 236 | "g\n" 237 | ] 238 | }, 239 | { 240 | "data": { 241 | "text/plain": [ 242 | "['g', 'h']" 243 | ] 244 | }, 245 | "execution_count": 9, 246 | "metadata": {}, 247 | "output_type": "execute_result" 248 | } 249 | ], 250 | "source": [ 251 | "x = [[\"a\", \"b\", \"c\"],\n", 252 | " [\"d\", \"e\", \"f\"],\n", 253 | " [\"g\", \"h\", \"i\"]]\n", 254 | "\n", 255 | "print(x[2][0])\n", 256 | "x[2][:2]\n" 257 | ] 258 | }, 259 | { 260 | "cell_type": "markdown", 261 | "metadata": {}, 262 | "source": [ 263 | "(9) Selesaikan permasalahan di bawah ini" 264 | ] 265 | }, 266 | { 267 | "cell_type": "code", 268 | "execution_count": 10, 269 | "metadata": {}, 270 | "outputs": [ 271 | { 272 | "name": "stdout", 273 | "output_type": "stream", 274 | "text": [ 275 | "['hallway', 11.25, 'kitchen', 18.0, 'ruang tamu', 20.0, 'bedroom', 10.75, 'bathroom', 10.8]\n" 276 | ] 277 | } 278 | ], 279 | "source": [ 280 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 281 | "\n", 282 | "# Ganti nilai dari \"bathroom\" menjadi 10.8\n", 283 | "\n", 284 | "area_3[-1] = 10.8\n", 285 | "\n", 286 | "# Ganti \"living room\" menjadi \"ruang tamu\"\n", 287 | "area_3[4] = \"ruang tamu\"\n", 288 | "print(area_3)\n" 289 | ] 290 | }, 291 | { 292 | "cell_type": "markdown", 293 | "metadata": {}, 294 | "source": [ 295 | "(10) Selesaikan permasalahan di bawah ini" 296 | ] 297 | }, 298 | { 299 | "cell_type": "code", 300 | "execution_count": 11, 301 | "metadata": {}, 302 | "outputs": [ 303 | { 304 | "name": "stdout", 305 | "output_type": "stream", 306 | "text": [ 307 | "['hallway', 11.25, 'kitchen', 18.0, 'chill zone', 20.0, 'bedroom', 10.75, 'bathroom', 10.5, 'poolhouse', 24.5]\n", 308 | "['hallway', 11.25, 'kitchen', 18.0, 'chill zone', 20.0, 'bedroom', 10.75, 'bathroom', 10.5, 'poolhouse', 24.5, 'garage', 15.45]\n" 309 | ] 310 | } 311 | ], 312 | "source": [ 313 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"chill zone\", 20.0,\n", 314 | " \"bedroom\", 10.75, \"bathroom\", 10.50]\n", 315 | "\n", 316 | "# Tambahkan list ['poolhouse', 24.5] kedalam area_3 beri nama variabel baru area_3_1\n", 317 | "area_3_1 = area_3 + ['poolhouse', 24.5]\n", 318 | "\n", 319 | "# Tambahkan list dari ['garage', 15.45] ke dalam area_3_1 beri nama variabel baru area_3_2\n", 320 | "area_3_2 = area_3_1 + ['garage', 15.45]\n", 321 | "\n", 322 | "print(area_3_1)\n", 323 | "print(area_3_2)" 324 | ] 325 | }, 326 | { 327 | "cell_type": "markdown", 328 | "metadata": {}, 329 | "source": [ 330 | "(11) Selesaikan permasalahan di bawah ini" 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": 14, 336 | "metadata": {}, 337 | "outputs": [ 338 | { 339 | "data": { 340 | "text/plain": [ 341 | "['hallway',\n", 342 | " 11.25,\n", 343 | " 'kitchen',\n", 344 | " 18.0,\n", 345 | " 'chill zone',\n", 346 | " 20.0,\n", 347 | " 'bedroom',\n", 348 | " 10.75,\n", 349 | " 'bathroom',\n", 350 | " 10.5]" 351 | ] 352 | }, 353 | "execution_count": 14, 354 | "metadata": {}, 355 | "output_type": "execute_result" 356 | } 357 | ], 358 | "source": [ 359 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0,\n", 360 | " \"chill zone\", 20.0, \"bedroom\", 10.75,\n", 361 | " \"bathroom\", 10.50, \"poolhouse\", 24.5,\n", 362 | " \"garage\", 15.45]\n", 363 | "\n", 364 | "# Silahkan hapus 4 elemen terakhir\n", 365 | "del(area_3[-4:])\n", 366 | "area_3\n" 367 | ] 368 | }, 369 | { 370 | "cell_type": "code", 371 | "execution_count": null, 372 | "metadata": { 373 | "collapsed": true 374 | }, 375 | "outputs": [], 376 | "source": [] 377 | } 378 | ], 379 | "metadata": { 380 | "kernelspec": { 381 | "display_name": "Python 3", 382 | "language": "python", 383 | "name": "python3" 384 | }, 385 | "language_info": { 386 | "codemirror_mode": { 387 | "name": "ipython", 388 | "version": 3 389 | }, 390 | "file_extension": ".py", 391 | "mimetype": "text/x-python", 392 | "name": "python", 393 | "nbconvert_exporter": "python", 394 | "pygments_lexer": "ipython3", 395 | "version": "3.6.1" 396 | } 397 | }, 398 | "nbformat": 4, 399 | "nbformat_minor": 2 400 | } 401 | -------------------------------------------------------------------------------- /Bagian 1 - Pengenalan Python untuk Data Science/Latihan 1 Variabel dan Tipe Data.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "(1). Silahkan print(8 / 7) dan berikan *comment* # Ini adalah pembagian, lihat contoh di bawah ini" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [ 15 | { 16 | "name": "stdout", 17 | "output_type": "stream", 18 | "text": [ 19 | "32\n" 20 | ] 21 | } 22 | ], 23 | "source": [ 24 | "# Ini adalah perkalian\n", 25 | "print(4 * 8)" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 3, 31 | "metadata": { 32 | "collapsed": true 33 | }, 34 | "outputs": [ 35 | { 36 | "name": "stdout", 37 | "output_type": "stream", 38 | "text": [ 39 | "1.1428571428571428\n" 40 | ] 41 | } 42 | ], 43 | "source": [ 44 | "# Jawaban ada disini\n", 45 | "# Ini adalah pembagian\n", 46 | "print(8/7)" 47 | ] 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": {}, 52 | "source": [ 53 | "#### Python sebagai kalkulator" 54 | ] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "metadata": {}, 59 | "source": [ 60 | "(2) Lihat beberapa contoh di bawah ini" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": 3, 66 | "metadata": {}, 67 | "outputs": [ 68 | { 69 | "name": "stdout", 70 | "output_type": "stream", 71 | "text": [ 72 | "10\n", 73 | "0\n", 74 | "15\n", 75 | "5.0\n", 76 | "16\n", 77 | "4\n" 78 | ] 79 | } 80 | ], 81 | "source": [ 82 | "# Penambahan dan pengurangan\n", 83 | "print(5 + 5)\n", 84 | "print(5 - 5)\n", 85 | "\n", 86 | "# Perkalian dan pembagian\n", 87 | "print(3 * 5)\n", 88 | "print(10 / 2)\n", 89 | "\n", 90 | "# Perpangkatan\n", 91 | "print(4 ** 2)\n", 92 | "\n", 93 | "# Pembagian Modulo\n", 94 | "print(18 % 7)\n" 95 | ] 96 | }, 97 | { 98 | "cell_type": "markdown", 99 | "metadata": {}, 100 | "source": [ 101 | "Jika kamu memilik uang seratus ribu rupiah di bank dan bank memberikan bunga 10 persen setiap tahunnya, berapakah uang yang kamu dapat dalam 7 tahun? Gunakan Python menjawabnya" 102 | ] 103 | }, 104 | { 105 | "cell_type": "code", 106 | "execution_count": 9, 107 | "metadata": { 108 | "collapsed": true 109 | }, 110 | "outputs": [ 111 | { 112 | "name": "stdout", 113 | "output_type": "stream", 114 | "text": [ 115 | "170000.0\n" 116 | ] 117 | } 118 | ], 119 | "source": [ 120 | "# Jawab disini\n", 121 | "modal=100000\n", 122 | "bunga=0.1\n", 123 | "periode=7\n", 124 | "print(modal+((modal*bunga)*periode))" 125 | ] 126 | }, 127 | { 128 | "cell_type": "markdown", 129 | "metadata": {}, 130 | "source": [ 131 | "(3) Buat variabel simpanan dengan nilai 100000, kemudian print variabel simpanan" 132 | ] 133 | }, 134 | { 135 | "cell_type": "code", 136 | "execution_count": 10, 137 | "metadata": { 138 | "collapsed": true 139 | }, 140 | "outputs": [ 141 | { 142 | "name": "stdout", 143 | "output_type": "stream", 144 | "text": [ 145 | "100000\n" 146 | ] 147 | } 148 | ], 149 | "source": [ 150 | "# Jawab disini\n", 151 | "simpanan=100000\n", 152 | "print(simpanan)" 153 | ] 154 | }, 155 | { 156 | "cell_type": "markdown", 157 | "metadata": {}, 158 | "source": [ 159 | "(4)\n", 160 | "- Buat variable faktor = 1.10\n", 161 | "- Gunakan variabel simpanan dan faktor untuk menentukan berapa hasil yang didapat dalam 10 tahun dan simpan dalam variabel hasil\n", 162 | "- print hasil" 163 | ] 164 | }, 165 | { 166 | "cell_type": "code", 167 | "execution_count": 19, 168 | "metadata": { 169 | "collapsed": true 170 | }, 171 | "outputs": [ 172 | { 173 | "name": "stdout", 174 | "output_type": "stream", 175 | "text": [ 176 | "2.5937424601000035e+50\n" 177 | ] 178 | } 179 | ], 180 | "source": [ 181 | "# Jawab disini\n", 182 | "faktor=1.10\n", 183 | "hasil=simpanan*faktor\n", 184 | "print(hasil**10)" 185 | ] 186 | }, 187 | { 188 | "cell_type": "markdown", 189 | "metadata": {}, 190 | "source": [ 191 | "(5) \n", 192 | "- Kalikan simpanan dan faktor dan simpan dalam variabel hasil_1\n", 193 | "- Apakah tipe data dari hasil 1? Silahkan print tipe datanya\n", 194 | "- Buatlah variabel desc = \"Sains Data\"\n", 195 | "- Jumlahkan desc dengan desc bagaimana hasilnya? Simpan pada variabel dobel_desc\n", 196 | "- print dobel_desc" 197 | ] 198 | }, 199 | { 200 | "cell_type": "code", 201 | "execution_count": 18, 202 | "metadata": { 203 | "collapsed": true 204 | }, 205 | "outputs": [ 206 | { 207 | "name": "stdout", 208 | "output_type": "stream", 209 | "text": [ 210 | "\n", 211 | "Sains DataSains Data\n" 212 | ] 213 | } 214 | ], 215 | "source": [ 216 | "# Jawab Disini\n", 217 | "hasil_1=simpanan*faktor\n", 218 | "print(type(hasil_1))\n", 219 | "\n", 220 | "desc=\"Sains Data\"\n", 221 | "dobel_desc=desc+desc\n", 222 | "print(dobel_desc)" 223 | ] 224 | }, 225 | { 226 | "cell_type": "markdown", 227 | "metadata": {}, 228 | "source": [ 229 | "#### Konversi tipe data / casting" 230 | ] 231 | }, 232 | { 233 | "cell_type": "markdown", 234 | "metadata": {}, 235 | "source": [ 236 | "Kamu bisa merubah tipe data seperti berikut" 237 | ] 238 | }, 239 | { 240 | "cell_type": "code", 241 | "execution_count": 7, 242 | "metadata": {}, 243 | "outputs": [ 244 | { 245 | "data": { 246 | "text/plain": [ 247 | "'5'" 248 | ] 249 | }, 250 | "execution_count": 7, 251 | "metadata": {}, 252 | "output_type": "execute_result" 253 | } 254 | ], 255 | "source": [ 256 | "a = 5\n", 257 | "a_baru = str(a)\n", 258 | "a_baru" 259 | ] 260 | }, 261 | { 262 | "cell_type": "code", 263 | "execution_count": 8, 264 | "metadata": {}, 265 | "outputs": [ 266 | { 267 | "data": { 268 | "text/plain": [ 269 | "str" 270 | ] 271 | }, 272 | "execution_count": 8, 273 | "metadata": {}, 274 | "output_type": "execute_result" 275 | } 276 | ], 277 | "source": [ 278 | "type(a_baru)\n" 279 | ] 280 | }, 281 | { 282 | "cell_type": "code", 283 | "execution_count": 9, 284 | "metadata": {}, 285 | "outputs": [ 286 | { 287 | "data": { 288 | "text/plain": [ 289 | "300" 290 | ] 291 | }, 292 | "execution_count": 9, 293 | "metadata": {}, 294 | "output_type": "execute_result" 295 | } 296 | ], 297 | "source": [ 298 | "b = '300'\n", 299 | "b_baru = int(b)\n", 300 | "b_baru" 301 | ] 302 | }, 303 | { 304 | "cell_type": "code", 305 | "execution_count": 10, 306 | "metadata": {}, 307 | "outputs": [ 308 | { 309 | "data": { 310 | "text/plain": [ 311 | "int" 312 | ] 313 | }, 314 | "execution_count": 10, 315 | "metadata": {}, 316 | "output_type": "execute_result" 317 | } 318 | ], 319 | "source": [ 320 | "type(b_baru)" 321 | ] 322 | }, 323 | { 324 | "cell_type": "markdown", 325 | "metadata": {}, 326 | "source": [ 327 | "(6).\n", 328 | "Lihat error di bawah ini bagaiman kamu menyelesaikannya?" 329 | ] 330 | }, 331 | { 332 | "cell_type": "code", 333 | "execution_count": 25, 334 | "metadata": {}, 335 | "outputs": [ 336 | { 337 | "name": "stdout", 338 | "output_type": "stream", 339 | "text": [ 340 | "Uang saya awalnya 100000 dan saya sekarang punya 194871.7100000001. Kueren cak\n" 341 | ] 342 | } 343 | ], 344 | "source": [ 345 | "# Simpanan dan hasil\n", 346 | "simpanan_x = 100000\n", 347 | "hasil_x = 100000 * 1.10 ** 7\n", 348 | "\n", 349 | "simpanan_x_str=str(simpanan_x)\n", 350 | "hasil_x_str=str(hasil_x)\n", 351 | "\n", 352 | "# Fix the printout\n", 353 | "print(\"Uang saya awalnya \" + simpanan_x_str + \" dan saya sekarang punya \" + hasil_x_str + \". Kueren cak\")\n" 354 | ] 355 | }, 356 | { 357 | "cell_type": "code", 358 | "execution_count": 27, 359 | "metadata": { 360 | "collapsed": true 361 | }, 362 | "outputs": [ 363 | { 364 | "name": "stdout", 365 | "output_type": "stream", 366 | "text": [ 367 | "3.1415926\n" 368 | ] 369 | }, 370 | { 371 | "data": { 372 | "text/plain": [ 373 | "float" 374 | ] 375 | }, 376 | "execution_count": 27, 377 | "metadata": {}, 378 | "output_type": "execute_result" 379 | } 380 | ], 381 | "source": [ 382 | "# Selesaikan juga ini\n", 383 | "pi_string = \"3.1415926\"\n", 384 | "\n", 385 | "# Konversi pi_string menjadi float simpan dalam variabel pi_float dan kemudian print\n", 386 | "# Jawba disini\n", 387 | "pi_float=float(pi_string)\n", 388 | "print(pi_float)\n", 389 | "type(pi_float)" 390 | ] 391 | }, 392 | { 393 | "cell_type": "code", 394 | "execution_count": null, 395 | "metadata": {}, 396 | "outputs": [], 397 | "source": [] 398 | } 399 | ], 400 | "metadata": { 401 | "kernelspec": { 402 | "display_name": "Python 3", 403 | "language": "python", 404 | "name": "python3" 405 | }, 406 | "language_info": { 407 | "codemirror_mode": { 408 | "name": "ipython", 409 | "version": 3 410 | }, 411 | "file_extension": ".py", 412 | "mimetype": "text/x-python", 413 | "name": "python", 414 | "nbconvert_exporter": "python", 415 | "pygments_lexer": "ipython3", 416 | "version": "3.7.0" 417 | } 418 | }, 419 | "nbformat": 4, 420 | "nbformat_minor": 2 421 | } 422 | -------------------------------------------------------------------------------- /Bagian 1 - Pengenalan Python untuk Data Science/Latihan 2 List Python.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "(1) Lihat Petunjuk di bawah ini" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 4, 13 | "metadata": { 14 | "collapsed": true 15 | }, 16 | "outputs": [ 17 | { 18 | "data": { 19 | "text/plain": [ 20 | "[11.25, 18.0, 20.0, 10.75, 9.5]" 21 | ] 22 | }, 23 | "execution_count": 4, 24 | "metadata": {}, 25 | "output_type": "execute_result" 26 | } 27 | ], 28 | "source": [ 29 | "# Luas ruangan dalam meter persegi\n", 30 | "hall = 11.25\n", 31 | "kit = 18.0\n", 32 | "liv = 20.0\n", 33 | "bed = 10.75\n", 34 | "bath = 9.50\n", 35 | "\n", 36 | "# Buatlah list dengan nama area berdasarkan variabel diatas dan print area\n", 37 | "# Jawab disini\n", 38 | "area=[11.25,18.0,20.0,10.75,9.50]\n", 39 | "area" 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "(2)\n", 47 | "- Buatlah list dengan nama variabel area_2 kemudian sisipkan \"Hallway\", \"Kitchen\", \"Living Room\", \"Bed Room\", dan \"Bath Room\" sesuai dengan ukuran masing masing\n", 48 | "- contoh ['hallway', hall, ..., ..., ...]" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": 6, 54 | "metadata": { 55 | "collapsed": true 56 | }, 57 | "outputs": [ 58 | { 59 | "data": { 60 | "text/plain": [ 61 | "['hallway',\n", 62 | " 11.25,\n", 63 | " 'Kitchen',\n", 64 | " 18.0,\n", 65 | " 'Living Room',\n", 66 | " 20.0,\n", 67 | " 'Bed Room',\n", 68 | " 10.75,\n", 69 | " 'Bath Room',\n", 70 | " 9.5]" 71 | ] 72 | }, 73 | "execution_count": 6, 74 | "metadata": {}, 75 | "output_type": "execute_result" 76 | } 77 | ], 78 | "source": [ 79 | "# Jawab disini\n", 80 | "area_2=[\"hallway\", hall, \"Kitchen\", kit, \"Living Room\", liv, \"Bed Room\", bed, \"Bath Room\", bath]\n", 81 | "area_2" 82 | ] 83 | }, 84 | { 85 | "cell_type": "markdown", 86 | "metadata": {}, 87 | "source": [ 88 | "(3)\n", 89 | "- A. [1, 3, 4, 2] B. [[1, 2, 3], [4, 5, 7]] C. [1 + 2, \"a\" * 5, 3]\n", 90 | "- Manakah yang bisa dikatakan membuat list yang benar?\n", 91 | "- A, B, C\n", 92 | "- B\n", 93 | "- B dan C\n", 94 | "- C" 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "execution_count": 3, 100 | "metadata": { 101 | "collapsed": true 102 | }, 103 | "outputs": [], 104 | "source": [ 105 | "# Jawab disini dengan comment\n", 106 | "# A,B,C" 107 | ] 108 | }, 109 | { 110 | "cell_type": "markdown", 111 | "metadata": {}, 112 | "source": [ 113 | "(4) Selesaikan list of list dari rumah di bawah ini, kemudian print rumah serta tipe data dari rumah" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": 10, 119 | "metadata": { 120 | "collapsed": true 121 | }, 122 | "outputs": [ 123 | { 124 | "name": "stdout", 125 | "output_type": "stream", 126 | "text": [ 127 | "[['hallway', 11.25], ['kitchen', 18.0], ['living room', 20.0], ['bedroom', 10.75], ['bathroom', 9.5]]\n" 128 | ] 129 | }, 130 | { 131 | "data": { 132 | "text/plain": [ 133 | "list" 134 | ] 135 | }, 136 | "execution_count": 10, 137 | "metadata": {}, 138 | "output_type": "execute_result" 139 | } 140 | ], 141 | "source": [ 142 | "rumah = [['hallway', hall],\n", 143 | " ['kitchen', kit],\n", 144 | " ['living room', liv],\n", 145 | " ['bedroom', bed],\n", 146 | " ['bathroom', bath]\n", 147 | " ]\n", 148 | "print(rumah)\n", 149 | "type(rumah)" 150 | ] 151 | }, 152 | { 153 | "cell_type": "markdown", 154 | "metadata": {}, 155 | "source": [ 156 | "(5) Selesaikan permasalahan di bawah ini" 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "execution_count": 18, 162 | "metadata": { 163 | "collapsed": true 164 | }, 165 | "outputs": [ 166 | { 167 | "data": { 168 | "text/plain": [ 169 | "20.0" 170 | ] 171 | }, 172 | "execution_count": 18, 173 | "metadata": {}, 174 | "output_type": "execute_result" 175 | } 176 | ], 177 | "source": [ 178 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 179 | "\n", 180 | "# Print elemen kedua dari area_3\n", 181 | "area_3[2]\n", 182 | "\n", 183 | "# Print elemen terakhir dari area_3\n", 184 | "area_3[9]\n", 185 | "\n", 186 | "# Print area dari \"living room\n", 187 | "area_3[5]\n" 188 | ] 189 | }, 190 | { 191 | "cell_type": "markdown", 192 | "metadata": {}, 193 | "source": [ 194 | "(6) Selesaikan permasalah di bawah ini" 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": 19, 200 | "metadata": { 201 | "collapsed": true 202 | }, 203 | "outputs": [ 204 | { 205 | "data": { 206 | "text/plain": [ 207 | "28.75" 208 | ] 209 | }, 210 | "execution_count": 19, 211 | "metadata": {}, 212 | "output_type": "execute_result" 213 | } 214 | ], 215 | "source": [ 216 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 217 | "\n", 218 | "# Jumlahkan area kitchen dan bedroom kedalam variabel area_makan_favorit\n", 219 | "area_makan_favorit=area_3[3]+area_3[7]\n", 220 | "\n", 221 | "# Print the variable area_makan_favorit\n", 222 | "area_makan_favorit\n" 223 | ] 224 | }, 225 | { 226 | "cell_type": "markdown", 227 | "metadata": {}, 228 | "source": [ 229 | "(7) Selesaikan permasalahan di bawah ini" 230 | ] 231 | }, 232 | { 233 | "cell_type": "code", 234 | "execution_count": 60, 235 | "metadata": { 236 | "collapsed": true 237 | }, 238 | "outputs": [ 239 | { 240 | "name": "stdout", 241 | "output_type": "stream", 242 | "text": [ 243 | "['hallway', 11.25, 'kitchen', 18.0, 'living room', 20.0]\n", 244 | "['bedroom', 10.75, 'bathroom', 9.5]\n" 245 | ] 246 | } 247 | ], 248 | "source": [ 249 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 250 | "\n", 251 | "# Guanakan slicing untuk menyimpan 6 elemen pertama dari area_3 simpan pada variabel lantai_1\n", 252 | "lantai_1=area_3[0:6]\n", 253 | "\n", 254 | "# Gunakan slicing untuk menyimpan 4 elemen terakhir dari area_3 simpan pada variabel lantai_2\n", 255 | "lantai_2=area_3[-4:]\n", 256 | "\n", 257 | "# Print lantai_1 dan lantai_2\n", 258 | "print(lantai_1)\n", 259 | "print(lantai_2)" 260 | ] 261 | }, 262 | { 263 | "cell_type": "markdown", 264 | "metadata": {}, 265 | "source": [ 266 | "(8) Lihat contoh di bawah ini silahkan eksekusi hasilnya" 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": 30, 272 | "metadata": { 273 | "collapsed": true 274 | }, 275 | "outputs": [ 276 | { 277 | "name": "stdout", 278 | "output_type": "stream", 279 | "text": [ 280 | "g\n", 281 | "['g', 'h']\n" 282 | ] 283 | } 284 | ], 285 | "source": [ 286 | "x = [[\"a\", \"b\", \"c\"],\n", 287 | " [\"d\", \"e\", \"f\"],\n", 288 | " [\"g\", \"h\", \"i\"]]\n", 289 | "\n", 290 | "print(x[2][0])\n", 291 | "print(x[2][:2])\n" 292 | ] 293 | }, 294 | { 295 | "cell_type": "markdown", 296 | "metadata": {}, 297 | "source": [ 298 | "(9) Selesaikan permasalahan di bawah ini" 299 | ] 300 | }, 301 | { 302 | "cell_type": "code", 303 | "execution_count": 32, 304 | "metadata": { 305 | "collapsed": true 306 | }, 307 | "outputs": [ 308 | { 309 | "data": { 310 | "text/plain": [ 311 | "['hallway',\n", 312 | " 11.25,\n", 313 | " 'kitchen',\n", 314 | " 18.0,\n", 315 | " 'ruang tamu',\n", 316 | " 20.0,\n", 317 | " 'bedroom',\n", 318 | " 10.8,\n", 319 | " 'bathroom',\n", 320 | " 9.5]" 321 | ] 322 | }, 323 | "execution_count": 32, 324 | "metadata": {}, 325 | "output_type": "execute_result" 326 | } 327 | ], 328 | "source": [ 329 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"living room\", 20.0, \"bedroom\", 10.75, \"bathroom\", 9.50]\n", 330 | "\n", 331 | "# Ganti nilai dari \"bathroom\" menjadi 10.8\n", 332 | "area_3[7]=10.8\n", 333 | "# Ganti \"living room\" menjadi \"ruang tamu\"\n", 334 | "area_3[4]=\"ruang tamu\"\n", 335 | "area_3" 336 | ] 337 | }, 338 | { 339 | "cell_type": "markdown", 340 | "metadata": {}, 341 | "source": [ 342 | "(10) Selesaikan permasalahan di bawah ini" 343 | ] 344 | }, 345 | { 346 | "cell_type": "code", 347 | "execution_count": 34, 348 | "metadata": { 349 | "collapsed": true 350 | }, 351 | "outputs": [ 352 | { 353 | "data": { 354 | "text/plain": [ 355 | "['hallway',\n", 356 | " 11.25,\n", 357 | " 'kitchen',\n", 358 | " 18.0,\n", 359 | " 'chill zone',\n", 360 | " 20.0,\n", 361 | " 'bedroom',\n", 362 | " 10.75,\n", 363 | " 'bathroom',\n", 364 | " 10.5,\n", 365 | " 'poothouse',\n", 366 | " 24.5,\n", 367 | " 'garage',\n", 368 | " 15.45]" 369 | ] 370 | }, 371 | "execution_count": 34, 372 | "metadata": {}, 373 | "output_type": "execute_result" 374 | } 375 | ], 376 | "source": [ 377 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0, \"chill zone\", 20.0,\n", 378 | " \"bedroom\", 10.75, \"bathroom\", 10.50]\n", 379 | "\n", 380 | "# Tambahkan list ['poolhouse', 24.5] kedalam area_3 beri nama variabel baru area_3_1\n", 381 | "area_3_1=area_3 + [\"poothouse\", 24.5]\n", 382 | "area_3_1\n", 383 | "# Tambahkan list dari ['garage', 15.45] ke dalam area_3_1 beri nama variabel baru area_3_2\n", 384 | "area_3_2=area_3_1+[\"garage\", 15.45]\n", 385 | "area_3_2\n" 386 | ] 387 | }, 388 | { 389 | "cell_type": "markdown", 390 | "metadata": {}, 391 | "source": [ 392 | "(11) Selesaikan permasalahan di bawah ini" 393 | ] 394 | }, 395 | { 396 | "cell_type": "code", 397 | "execution_count": 57, 398 | "metadata": { 399 | "collapsed": true 400 | }, 401 | "outputs": [ 402 | { 403 | "data": { 404 | "text/plain": [ 405 | "['hallway',\n", 406 | " 11.25,\n", 407 | " 'kitchen',\n", 408 | " 18.0,\n", 409 | " 'chill zone',\n", 410 | " 20.0,\n", 411 | " 'bedroom',\n", 412 | " 10.75,\n", 413 | " 'bathroom',\n", 414 | " 10.5]" 415 | ] 416 | }, 417 | "execution_count": 57, 418 | "metadata": {}, 419 | "output_type": "execute_result" 420 | } 421 | ], 422 | "source": [ 423 | "area_3 = [\"hallway\", 11.25, \"kitchen\", 18.0,\n", 424 | " \"chill zone\", 20.0, \"bedroom\", 10.75,\n", 425 | " \"bathroom\", 10.50, \"poolhouse\", 24.5,\n", 426 | " \"garage\", 15.45]\n", 427 | "\n", 428 | "# Silahkan hapus 4 elemen terakhir\n", 429 | "del(area_3[-4:])\n", 430 | "area_3" 431 | ] 432 | }, 433 | { 434 | "cell_type": "code", 435 | "execution_count": null, 436 | "metadata": { 437 | "collapsed": true 438 | }, 439 | "outputs": [], 440 | "source": [] 441 | }, 442 | { 443 | "cell_type": "code", 444 | "execution_count": null, 445 | "metadata": {}, 446 | "outputs": [], 447 | "source": [] 448 | } 449 | ], 450 | "metadata": { 451 | "kernelspec": { 452 | "display_name": "Python 3", 453 | "language": "python", 454 | "name": "python3" 455 | }, 456 | "language_info": { 457 | "codemirror_mode": { 458 | "name": "ipython", 459 | "version": 3 460 | }, 461 | "file_extension": ".py", 462 | "mimetype": "text/x-python", 463 | "name": "python", 464 | "nbconvert_exporter": "python", 465 | "pygments_lexer": "ipython3", 466 | "version": "3.7.0" 467 | } 468 | }, 469 | "nbformat": 4, 470 | "nbformat_minor": 2 471 | } 472 | -------------------------------------------------------------------------------- /Bagian 1 - Pengenalan Python untuk Data Science/Latihan 4 Numpy.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "(1)" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 38, 13 | "metadata": { 14 | "collapsed": true 15 | }, 16 | "outputs": [ 17 | { 18 | "data": { 19 | "text/plain": [ 20 | "numpy.ndarray" 21 | ] 22 | }, 23 | "execution_count": 38, 24 | "metadata": {}, 25 | "output_type": "execute_result" 26 | } 27 | ], 28 | "source": [ 29 | "tinggi = [180, 215, 210, 210, 188, 176, 209, 200] # dalam cm \n", 30 | "\n", 31 | "# Import numpy dengan alias np\n", 32 | "import numpy as np\n", 33 | "\n", 34 | "# Buat numpy array dengan list tinggi beri nama variabel np_tinggi\n", 35 | "np_tinggi=np.array(tinggi)\n", 36 | "\n", 37 | "# Print tipe data np_tinggi\n", 38 | "type(np_tinggi)\n" 39 | ] 40 | }, 41 | { 42 | "cell_type": "markdown", 43 | "metadata": {}, 44 | "source": [ 45 | "(2)" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 41, 51 | "metadata": { 52 | "collapsed": true 53 | }, 54 | "outputs": [ 55 | { 56 | "data": { 57 | "text/plain": [ 58 | "array([1.8 , 2.15, 2.1 , 2.1 , 1.88, 1.76, 2.09, 2. ])" 59 | ] 60 | }, 61 | "execution_count": 41, 62 | "metadata": {}, 63 | "output_type": "execute_result" 64 | } 65 | ], 66 | "source": [ 67 | "# Buat np_tinggi menjadi dalam satuan meter\n", 68 | "a=np_tinggi\n", 69 | "b=a/100\n", 70 | "# print np_tinggi\n", 71 | "b\n" 72 | ] 73 | }, 74 | { 75 | "cell_type": "markdown", 76 | "metadata": {}, 77 | "source": [ 78 | "(3)" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": 4, 84 | "metadata": { 85 | "collapsed": true 86 | }, 87 | "outputs": [ 88 | { 89 | "data": { 90 | "text/plain": [ 91 | "array([27.31481481, 21.63331531, 22.22222222, 22.90249433, 22.15368945,\n", 92 | " 21.08083678, 24.95364117, 27.5 ])" 93 | ] 94 | }, 95 | "execution_count": 4, 96 | "metadata": {}, 97 | "output_type": "execute_result" 98 | } 99 | ], 100 | "source": [ 101 | "berat = [88.5, 100, 98, 101, 78.3, 65.3, 109, 110]\n", 102 | "\n", 103 | "# Buatlah numpy array dari list berat dan simpan dalam np_berat\n", 104 | "np_berat=np.array(berat)\n", 105 | "\n", 106 | "# hitung bmi dari berat dan tinggi simpan ke dalam variabel bmi\n", 107 | "bmi=np_berat/b**2\n", 108 | "bmi" 109 | ] 110 | }, 111 | { 112 | "cell_type": "markdown", 113 | "metadata": {}, 114 | "source": [ 115 | "(4)" 116 | ] 117 | }, 118 | { 119 | "cell_type": "code", 120 | "execution_count": 10, 121 | "metadata": { 122 | "collapsed": true 123 | }, 124 | "outputs": [ 125 | { 126 | "data": { 127 | "text/plain": [ 128 | "array([27.31481481, 24.95364117, 27.5 ])" 129 | ] 130 | }, 131 | "execution_count": 10, 132 | "metadata": {}, 133 | "output_type": "execute_result" 134 | } 135 | ], 136 | "source": [ 137 | "# Buatalah numpy array boolean dengan dengan operator > untuk mencari bmi yang lebih besar dari 23\n", 138 | "# Simpan dalam variabel bmi_tinggi\n", 139 | "bmi_tinggi=bmi>23\n", 140 | "bmi_tinggi\n", 141 | "\n", 142 | "# Partisi numpy array bmi dengan menggunkan bmi_tinggi untuk mencari bmi yang hanya lebih besar dari 23\n", 143 | "bmi[bmi>23]" 144 | ] 145 | }, 146 | { 147 | "cell_type": "markdown", 148 | "metadata": {}, 149 | "source": [ 150 | "(5)\n", 151 | "- np.array([True, 1, 2]) + np.array([3, 4, False])\n", 152 | "- Manakah pilihan di bawah ini yang memilik hasil sama seperti di atas?\n", 153 | "- A. np.array([True, 1, 2, 3, 4, False])\n", 154 | "- B. np.array([4, 3, 0]) + np.array([0, 2, 2])\n", 155 | "- C. np.array([1, 1, 2]) + np.array([3, 4, -1])\n", 156 | "- D. np.array([0, 1, 2, 3, 4, 5]) " 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "execution_count": 19, 162 | "metadata": { 163 | "collapsed": true 164 | }, 165 | "outputs": [ 166 | { 167 | "data": { 168 | "text/plain": [ 169 | "array([4, 5, 2])" 170 | ] 171 | }, 172 | "execution_count": 19, 173 | "metadata": {}, 174 | "output_type": "execute_result" 175 | } 176 | ], 177 | "source": [ 178 | "# Coba jawabanmu disini\n", 179 | "#np.array([True, 1, 2]) + np.array([3, 4, False])\n", 180 | "\n", 181 | "np.array([4, 3, 0]) + np.array([0, 2, 2])\n", 182 | "\n", 183 | "\n", 184 | "#belum paham logika nya" 185 | ] 186 | }, 187 | { 188 | "cell_type": "markdown", 189 | "metadata": {}, 190 | "source": [ 191 | "(6)" 192 | ] 193 | }, 194 | { 195 | "cell_type": "markdown", 196 | "metadata": {}, 197 | "source": [ 198 | "#### subsetting 1D numpy array" 199 | ] 200 | }, 201 | { 202 | "cell_type": "code", 203 | "execution_count": 23, 204 | "metadata": { 205 | "collapsed": true 206 | }, 207 | "outputs": [ 208 | { 209 | "data": { 210 | "text/plain": [ 211 | "array([210, 188, 176, 209, 200])" 212 | ] 213 | }, 214 | "execution_count": 23, 215 | "metadata": {}, 216 | "output_type": "execute_result" 217 | } 218 | ], 219 | "source": [ 220 | "# print hasil np_berat yang meliki index terakhir\n", 221 | "np_berat[-1]\n", 222 | "\n", 223 | "# print 5 elemen terakhir dari np_tinggi\n", 224 | "np_tinggi[-5:]\n" 225 | ] 226 | }, 227 | { 228 | "cell_type": "markdown", 229 | "metadata": {}, 230 | "source": [ 231 | "#### 2D Numpy Array" 232 | ] 233 | }, 234 | { 235 | "cell_type": "markdown", 236 | "metadata": {}, 237 | "source": [ 238 | "(7)" 239 | ] 240 | }, 241 | { 242 | "cell_type": "code", 243 | "execution_count": 27, 244 | "metadata": { 245 | "collapsed": true 246 | }, 247 | "outputs": [ 248 | { 249 | "data": { 250 | "text/plain": [ 251 | "(4, 2)" 252 | ] 253 | }, 254 | "execution_count": 27, 255 | "metadata": {}, 256 | "output_type": "execute_result" 257 | } 258 | ], 259 | "source": [ 260 | "pemain_basket = [[180, 78.4],\n", 261 | " [215, 102.7],\n", 262 | " [210, 98.5],\n", 263 | " [188, 75.2]]\n", 264 | "\n", 265 | "# Buatlah 2D array dari pemain_basket simpan dalam variabel basket_2d\n", 266 | "basket_2d=np.array([[180, 78.4], [215, 102.7], [210, 98.5], [188, 75.2]])\n", 267 | "\n", 268 | "# print tipe dari basket_2d\n", 269 | "type(basket_2d)\n", 270 | "\n", 271 | "# print basket_2d\n", 272 | "basket_2d\n", 273 | "\n", 274 | "# print dimensi dari basket_2d dengan basket_2d.shape\n", 275 | "basket_2d.shape\n", 276 | "\n", 277 | "\n" 278 | ] 279 | }, 280 | { 281 | "cell_type": "markdown", 282 | "metadata": {}, 283 | "source": [ 284 | "(8)" 285 | ] 286 | }, 287 | { 288 | "cell_type": "code", 289 | "execution_count": 32, 290 | "metadata": { 291 | "collapsed": true 292 | }, 293 | "outputs": [ 294 | { 295 | "data": { 296 | "text/plain": [ 297 | "array([[210. , 98.5],\n", 298 | " [188. , 75.2]])" 299 | ] 300 | }, 301 | "execution_count": 32, 302 | "metadata": {}, 303 | "output_type": "execute_result" 304 | } 305 | ], 306 | "source": [ 307 | "# Gunakan slicing untuk untuk mengambil hanya kolom pertama dari basket_2d\n", 308 | "basket_2d[0]\n", 309 | "\n", 310 | "\n", 311 | "# Gunakan slicing untuk mendapatkan 2 baris terakhir dan hanya kolom kedua dari basket_2d\n", 312 | "basket_2d[-2:]\n" 313 | ] 314 | }, 315 | { 316 | "cell_type": "markdown", 317 | "metadata": {}, 318 | "source": [ 319 | "(9) Coba eksekusi hasil di bawah ini apa hasilnya?" 320 | ] 321 | }, 322 | { 323 | "cell_type": "code", 324 | "execution_count": 33, 325 | "metadata": {}, 326 | "outputs": [ 327 | { 328 | "name": "stdout", 329 | "output_type": "stream", 330 | "text": [ 331 | "[[ 2 4]\n", 332 | " [ 6 8]\n", 333 | " [10 12]]\n", 334 | "[[11 12]\n", 335 | " [13 14]\n", 336 | " [15 16]]\n", 337 | "[[ 2 4]\n", 338 | " [ 6 8]\n", 339 | " [10 12]]\n" 340 | ] 341 | } 342 | ], 343 | "source": [ 344 | "np_mat = np.array([[1, 2],\n", 345 | " [3, 4],\n", 346 | " [5, 6]])\n", 347 | "print(np_mat * 2)\n", 348 | "print(np_mat + np.array([10, 10]))\n", 349 | "print(np_mat + np_mat)" 350 | ] 351 | }, 352 | { 353 | "cell_type": "code", 354 | "execution_count": 36, 355 | "metadata": { 356 | "collapsed": true 357 | }, 358 | "outputs": [ 359 | { 360 | "name": "stdout", 361 | "output_type": "stream", 362 | "text": [ 363 | "[220. 107.7]\n", 364 | "[1.8 0.784]\n" 365 | ] 366 | } 367 | ], 368 | "source": [ 369 | "# Print dengan tambahkan berat dari basket_2d (kolom kedua) dengan 5 \n", 370 | "print(basket_2d[1]+5)\n", 371 | "\n", 372 | "# Print dengan mengubah tinggi basket_2d (kolom pertama) yang awalnya satuannya cm menjadi m\n", 373 | "print(basket_2d[0]/100)\n", 374 | "\n" 375 | ] 376 | }, 377 | { 378 | "cell_type": "markdown", 379 | "metadata": {}, 380 | "source": [ 381 | "#### Statisika dasar dengan menggunakan NumPy\n", 382 | "(10)" 383 | ] 384 | }, 385 | { 386 | "cell_type": "code", 387 | "execution_count": 43, 388 | "metadata": { 389 | "collapsed": true 390 | }, 391 | "outputs": [ 392 | { 393 | "data": { 394 | "text/plain": [ 395 | "204.5" 396 | ] 397 | }, 398 | "execution_count": 43, 399 | "metadata": {}, 400 | "output_type": "execute_result" 401 | } 402 | ], 403 | "source": [ 404 | "# Berapakah mean dari np_tinggi? Kemudian print\n", 405 | "np.mean(np_tinggi)\n", 406 | "\n", 407 | "# Berapakah median dari np_tinggi? Kemudian print\n", 408 | "np.median(np_tinggi)" 409 | ] 410 | }, 411 | { 412 | "cell_type": "markdown", 413 | "metadata": {}, 414 | "source": [ 415 | "(11)" 416 | ] 417 | }, 418 | { 419 | "cell_type": "code", 420 | "execution_count": 46, 421 | "metadata": { 422 | "collapsed": true 423 | }, 424 | "outputs": [ 425 | { 426 | "name": "stdout", 427 | "output_type": "stream", 428 | "text": [ 429 | "Rata - Rata: 129.2\n", 430 | "Median: 141.35\n", 431 | "Standard Deviation: 56.390973346804365\n", 432 | "Korealasi: [[1. 1. 1. 1.]\n", 433 | " [1. 1. 1. 1.]\n", 434 | " [1. 1. 1. 1.]\n", 435 | " [1. 1. 1. 1.]]\n" 436 | ] 437 | } 438 | ], 439 | "source": [ 440 | "# Print tinggi dari basket_2d (kolom pertama)\n", 441 | "rata_rata = np.mean(basket_2d[0])\n", 442 | "print(\"Rata - Rata: \" + str(rata_rata) )\n", 443 | "\n", 444 | "# Print median dari tinggi basket_2d\n", 445 | "med = np.median(basket_2d)\n", 446 | "print(\"Median: \" + str(med) )\n", 447 | "\n", 448 | "# Print standar deviasi dari basket_2d\n", 449 | "stddev = np.std(basket_2d)\n", 450 | "print(\"Standard Deviation: \" + str(stddev))\n", 451 | "\n", 452 | "# Print korelasi antara kolom pertama dengan kedua dari basket_2d\n", 453 | "korelasi = np.corrcoef(basket_2d)\n", 454 | "print(\"Korealasi: \" + str(korelasi))" 455 | ] 456 | }, 457 | { 458 | "cell_type": "code", 459 | "execution_count": null, 460 | "metadata": {}, 461 | "outputs": [], 462 | "source": [] 463 | } 464 | ], 465 | "metadata": { 466 | "kernelspec": { 467 | "display_name": "Python 3", 468 | "language": "python", 469 | "name": "python3" 470 | }, 471 | "language_info": { 472 | "codemirror_mode": { 473 | "name": "ipython", 474 | "version": 3 475 | }, 476 | "file_extension": ".py", 477 | "mimetype": "text/x-python", 478 | "name": "python", 479 | "nbconvert_exporter": "python", 480 | "pygments_lexer": "ipython3", 481 | "version": "3.7.0" 482 | } 483 | }, 484 | "nbformat": 4, 485 | "nbformat_minor": 2 486 | } 487 | -------------------------------------------------------------------------------- /Bagian 2 - Python Lanjutan/negara.csv: -------------------------------------------------------------------------------- 1 | ,country,capital,area,population 2 | BR,Brazil,Brasilia,8.516,200.4 3 | RU,Russia,Moscow,17.10,143.5 4 | IN,India,New Delhi,3.286,1252 5 | CH,China,Beijing,9.597,1357 6 | SA,South Africa,Pretoria,1.221,52.98 -------------------------------------------------------------------------------- /Bagian 2 - Python Lanjutan/tabular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 2 - Python Lanjutan/tabular.png -------------------------------------------------------------------------------- /Bagian 3 - Hacker Statistics/1. Koin.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /Bagian 3 - Hacker Statistics/2. Dadu.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "collapsed": true 8 | }, 9 | "outputs": [], 10 | "source": [] 11 | } 12 | ], 13 | "metadata": { 14 | "kernelspec": { 15 | "display_name": "Python 3", 16 | "language": "python", 17 | "name": "python3" 18 | }, 19 | "language_info": { 20 | "codemirror_mode": { 21 | "name": "ipython", 22 | "version": 3 23 | }, 24 | "file_extension": ".py", 25 | "mimetype": "text/x-python", 26 | "name": "python", 27 | "nbconvert_exporter": "python", 28 | "pygments_lexer": "ipython3", 29 | "version": "3.6.1" 30 | } 31 | }, 32 | "nbformat": 4, 33 | "nbformat_minor": 2 34 | } 35 | -------------------------------------------------------------------------------- /Bagian 4 - Fundamental Pandas/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 4 - Fundamental Pandas/.DS_Store -------------------------------------------------------------------------------- /Bagian 4 - Fundamental Pandas/iris.csv: -------------------------------------------------------------------------------- 1 | sepal_length,sepal_width,petal_length,petal_width,species 2 | 5.1,3.5,1.4,0.2,setosa 3 | 4.9,3,1.4,0.2,setosa 4 | 4.7,3.2,1.3,0.2,setosa 5 | 4.6,3.1,1.5,0.2,setosa 6 | 5,3.6,1.4,0.2,setosa 7 | 5.4,3.9,1.7,0.4,setosa 8 | 4.6,3.4,1.4,0.3,setosa 9 | 5,3.4,1.5,0.2,setosa 10 | 4.4,2.9,1.4,0.2,setosa 11 | 4.9,3.1,1.5,0.1,setosa 12 | 5.4,3.7,1.5,0.2,setosa 13 | 4.8,3.4,1.6,0.2,setosa 14 | 4.8,3,1.4,0.1,setosa 15 | 4.3,3,1.1,0.1,setosa 16 | 5.8,4,1.2,0.2,setosa 17 | 5.7,4.4,1.5,0.4,setosa 18 | 5.4,3.9,1.3,0.4,setosa 19 | 5.1,3.5,1.4,0.3,setosa 20 | 5.7,3.8,1.7,0.3,setosa 21 | 5.1,3.8,1.5,0.3,setosa 22 | 5.4,3.4,1.7,0.2,setosa 23 | 5.1,3.7,1.5,0.4,setosa 24 | 4.6,3.6,1,0.2,setosa 25 | 5.1,3.3,1.7,0.5,setosa 26 | 4.8,3.4,1.9,0.2,setosa 27 | 5,3,1.6,0.2,setosa 28 | 5,3.4,1.6,0.4,setosa 29 | 5.2,3.5,1.5,0.2,setosa 30 | 5.2,3.4,1.4,0.2,setosa 31 | 4.7,3.2,1.6,0.2,setosa 32 | 4.8,3.1,1.6,0.2,setosa 33 | 5.4,3.4,1.5,0.4,setosa 34 | 5.2,4.1,1.5,0.1,setosa 35 | 5.5,4.2,1.4,0.2,setosa 36 | 4.9,3.1,1.5,0.1,setosa 37 | 5,3.2,1.2,0.2,setosa 38 | 5.5,3.5,1.3,0.2,setosa 39 | 4.9,3.1,1.5,0.1,setosa 40 | 4.4,3,1.3,0.2,setosa 41 | 5.1,3.4,1.5,0.2,setosa 42 | 5,3.5,1.3,0.3,setosa 43 | 4.5,2.3,1.3,0.3,setosa 44 | 4.4,3.2,1.3,0.2,setosa 45 | 5,3.5,1.6,0.6,setosa 46 | 5.1,3.8,1.9,0.4,setosa 47 | 4.8,3,1.4,0.3,setosa 48 | 5.1,3.8,1.6,0.2,setosa 49 | 4.6,3.2,1.4,0.2,setosa 50 | 5.3,3.7,1.5,0.2,setosa 51 | 5,3.3,1.4,0.2,setosa 52 | 7,3.2,4.7,1.4,versicolor 53 | 6.4,3.2,4.5,1.5,versicolor 54 | 6.9,3.1,4.9,1.5,versicolor 55 | 5.5,2.3,4,1.3,versicolor 56 | 6.5,2.8,4.6,1.5,versicolor 57 | 5.7,2.8,4.5,1.3,versicolor 58 | 6.3,3.3,4.7,1.6,versicolor 59 | 4.9,2.4,3.3,1,versicolor 60 | 6.6,2.9,4.6,1.3,versicolor 61 | 5.2,2.7,3.9,1.4,versicolor 62 | 5,2,3.5,1,versicolor 63 | 5.9,3,4.2,1.5,versicolor 64 | 6,2.2,4,1,versicolor 65 | 6.1,2.9,4.7,1.4,versicolor 66 | 5.6,2.9,3.6,1.3,versicolor 67 | 6.7,3.1,4.4,1.4,versicolor 68 | 5.6,3,4.5,1.5,versicolor 69 | 5.8,2.7,4.1,1,versicolor 70 | 6.2,2.2,4.5,1.5,versicolor 71 | 5.6,2.5,3.9,1.1,versicolor 72 | 5.9,3.2,4.8,1.8,versicolor 73 | 6.1,2.8,4,1.3,versicolor 74 | 6.3,2.5,4.9,1.5,versicolor 75 | 6.1,2.8,4.7,1.2,versicolor 76 | 6.4,2.9,4.3,1.3,versicolor 77 | 6.6,3,4.4,1.4,versicolor 78 | 6.8,2.8,4.8,1.4,versicolor 79 | 6.7,3,5,1.7,versicolor 80 | 6,2.9,4.5,1.5,versicolor 81 | 5.7,2.6,3.5,1,versicolor 82 | 5.5,2.4,3.8,1.1,versicolor 83 | 5.5,2.4,3.7,1,versicolor 84 | 5.8,2.7,3.9,1.2,versicolor 85 | 6,2.7,5.1,1.6,versicolor 86 | 5.4,3,4.5,1.5,versicolor 87 | 6,3.4,4.5,1.6,versicolor 88 | 6.7,3.1,4.7,1.5,versicolor 89 | 6.3,2.3,4.4,1.3,versicolor 90 | 5.6,3,4.1,1.3,versicolor 91 | 5.5,2.5,4,1.3,versicolor 92 | 5.5,2.6,4.4,1.2,versicolor 93 | 6.1,3,4.6,1.4,versicolor 94 | 5.8,2.6,4,1.2,versicolor 95 | 5,2.3,3.3,1,versicolor 96 | 5.6,2.7,4.2,1.3,versicolor 97 | 5.7,3,4.2,1.2,versicolor 98 | 5.7,2.9,4.2,1.3,versicolor 99 | 6.2,2.9,4.3,1.3,versicolor 100 | 5.1,2.5,3,1.1,versicolor 101 | 5.7,2.8,4.1,1.3,versicolor 102 | 6.3,3.3,6,2.5,virginica 103 | 5.8,2.7,5.1,1.9,virginica 104 | 7.1,3,5.9,2.1,virginica 105 | 6.3,2.9,5.6,1.8,virginica 106 | 6.5,3,5.8,2.2,virginica 107 | 7.6,3,6.6,2.1,virginica 108 | 4.9,2.5,4.5,1.7,virginica 109 | 7.3,2.9,6.3,1.8,virginica 110 | 6.7,2.5,5.8,1.8,virginica 111 | 7.2,3.6,6.1,2.5,virginica 112 | 6.5,3.2,5.1,2,virginica 113 | 6.4,2.7,5.3,1.9,virginica 114 | 6.8,3,5.5,2.1,virginica 115 | 5.7,2.5,5,2,virginica 116 | 5.8,2.8,5.1,2.4,virginica 117 | 6.4,3.2,5.3,2.3,virginica 118 | 6.5,3,5.5,1.8,virginica 119 | 7.7,3.8,6.7,2.2,virginica 120 | 7.7,2.6,6.9,2.3,virginica 121 | 6,2.2,5,1.5,virginica 122 | 6.9,3.2,5.7,2.3,virginica 123 | 5.6,2.8,4.9,2,virginica 124 | 7.7,2.8,6.7,2,virginica 125 | 6.3,2.7,4.9,1.8,virginica 126 | 6.7,3.3,5.7,2.1,virginica 127 | 7.2,3.2,6,1.8,virginica 128 | 6.2,2.8,4.8,1.8,virginica 129 | 6.1,3,4.9,1.8,virginica 130 | 6.4,2.8,5.6,2.1,virginica 131 | 7.2,3,5.8,1.6,virginica 132 | 7.4,2.8,6.1,1.9,virginica 133 | 7.9,3.8,6.4,2,virginica 134 | 6.4,2.8,5.6,2.2,virginica 135 | 6.3,2.8,5.1,1.5,virginica 136 | 6.1,2.6,5.6,1.4,virginica 137 | 7.7,3,6.1,2.3,virginica 138 | 6.3,3.4,5.6,2.4,virginica 139 | 6.4,3.1,5.5,1.8,virginica 140 | 6,3,4.8,1.8,virginica 141 | 6.9,3.1,5.4,2.1,virginica 142 | 6.7,3.1,5.6,2.4,virginica 143 | 6.9,3.1,5.1,2.3,virginica 144 | 5.8,2.7,5.1,1.9,virginica 145 | 6.8,3.2,5.9,2.3,virginica 146 | 6.7,3.3,5.7,2.5,virginica 147 | 6.7,3,5.2,2.3,virginica 148 | 6.3,2.5,5,1.9,virginica 149 | 6.5,3,5.2,2,virginica 150 | 6.2,3.4,5.4,2.3,virginica 151 | 5.9,3,5.1,1.8,virginica 152 | -------------------------------------------------------------------------------- /Bagian 4 - Fundamental Pandas/sales-feb-2015.csv: -------------------------------------------------------------------------------- 1 | Date,Company,Product,Units 2 | 2015-02-02 08:33:01,Hooli,Software,3 3 | 2015-02-02 20:54:49,Mediacore,Hardware,9 4 | 2015-02-03 14:14:18,Initech,Software,13 5 | 2015-02-04 15:36:29,Streeplex,Software,13 6 | 2015-02-04 21:52:45,Acme Coporation,Hardware,14 7 | 2015-02-05 01:53:06,Acme Coporation,Software,19 8 | 2015-02-05 22:05:03,Hooli,Service,10 9 | 2015-02-07 22:58:10,Acme Coporation,Hardware,1 10 | 2015-02-09 08:57:30,Streeplex,Service,19 11 | 2015-02-09 13:09:55,Mediacore,Software,7 12 | 2015-02-11 20:03:08,Initech,Software,7 13 | 2015-02-11 22:50:44,Hooli,Software,4 14 | 2015-02-16 12:09:19,Hooli,Software,10 15 | 2015-02-19 10:59:33,Mediacore,Hardware,16 16 | 2015-02-19 16:02:58,Mediacore,Service,10 17 | 2015-02-21 05:01:26,Mediacore,Software,3 18 | 2015-02-21 20:41:47,Hooli,Hardware,3 19 | 2015-02-25 00:29:00,Initech,Service,10 20 | 2015-02-26 08:57:45,Streeplex,Service,4 21 | 2015-02-26 08:58:51,Streeplex,Service,1 22 | -------------------------------------------------------------------------------- /Bagian 5 - Statistik dan Python 1/2008_swing_states.csv: -------------------------------------------------------------------------------- 1 | state,county,total_votes,dem_votes,rep_votes,dem_share 2 | PA,Erie County,127691,75775,50351,60.08 3 | PA,Bradford County,25787,10306,15057,40.64 4 | PA,Tioga County,17984,6390,11326,36.07 5 | PA,McKean County,15947,6465,9224,41.21 6 | PA,Potter County,7507,2300,5109,31.04 7 | PA,Wayne County,22835,9892,12702,43.78 8 | PA,Susquehanna County,19286,8381,10633,44.08 9 | PA,Warren County,18517,8537,9685,46.85 10 | OH,Ashtabula County,44874,25027,18949,56.94 11 | OH,Lake County,121335,60155,59142,50.46 12 | PA,Crawford County,38134,16780,20750,44.71 13 | OH,Lucas County,219830,142852,73706,65.99 14 | OH,Fulton County,21973,9900,11689,45.88 15 | OH,Geauga County,51102,21250,29096,42.23 16 | OH,Williams County,18397,8174,9880,45.26 17 | PA,Wyoming County,13138,5985,6983,46.15 18 | PA,Lackawanna County,107876,67520,39488,63.10 19 | PA,Elk County,14271,7290,6676,52.20 20 | PA,Forest County,2444,1038,1366,43.18 21 | PA,Venango County,23307,9238,13718,40.24 22 | OH,Erie County,41229,23148,17432,57.01 23 | OH,Wood County,65022,34285,29648,53.61 24 | PA,Cameron County,2245,879,1323,39.92 25 | PA,Pike County,24284,11493,12518,47.87 26 | PA,Lycoming County,49237,18381,30280,37.77 27 | PA,Sullivan County,3120,1233,1841,40.11 28 | OH,Lorain County,146859,85276,59068,59.10 29 | OH,Trumbull County,106911,64145,40164,61.48 30 | PA,Mercer County,53821,26411,26565,49.85 31 | OH,Henry County,14840,6320,8239,43.43 32 | PA,Clinton County,14791,7097,7504,48.61 33 | PA,Clarion County,17766,6756,10737,38.62 34 | PA,Luzerne County,135175,72492,61127,54.25 35 | OH,Defiance County,19195,8399,10407,44.69 36 | PA,Jefferson County,18802,6447,12057,34.84 37 | OH,Portage County,78206,41856,34822,54.59 38 | PA,Columbia County,28063,13230,14477,47.75 39 | OH,Huron County,25582,12076,12884,48.36 40 | OH,Medina County,90451,40924,48189,45.89 41 | OH,Seneca County,27449,13087,13823,48.62 42 | PA,Clearfield County,33813,14555,18662,43.82 43 | PA,Centre County,75763,41950,32992,55.97 44 | PA,Monroe County,68443,39453,28293,58.23 45 | OH,Paulding County,9769,4165,5317,43.92 46 | PA,Northumberland County,33939,14329,19018,42.97 47 | PA,Montour County,8023,3364,4574,42.38 48 | PA,Butler County,90425,32260,57074,36.11 49 | PA,Armstrong County,30081,11138,18542,37.53 50 | OH,Hancock County,36981,13870,22420,38.23 51 | OH,Putnam County,18680,5281,13072,28.79 52 | PA,Union County,17400,7333,9859,42.65 53 | OH,Mahoning County,127032,79173,45319,63.57 54 | PA,Carbon County,26923,13464,12957,50.96 55 | PA,Lawrence County,42103,19711,21851,47.43 56 | OH,Ashland County,25168,9300,15158,38.07 57 | OH,Crawford County,21173,8288,12316,40.18 58 | OH,Richland County,61122,25727,34034,43.05 59 | OH,Wyandot County,10977,4461,6270,41.56 60 | OH,Wayne County,52142,21712,29342,42.49 61 | OH,Van Wert County,14652,5178,9168,36.06 62 | OH,Stark County,187545,96990,86743,52.76 63 | PA,Northampton County,135587,75255,58551,56.24 64 | PA,Schuylkill County,63057,28300,33767,45.60 65 | OH,Columbiana County,48487,21882,25585,46.07 66 | OH,Allen County,50263,19522,29940,39.43 67 | PA,Indiana County,37302,17065,19727,46.39 68 | PA,Snyder County,15479,5382,9900,35.22 69 | PA,Beaver County,84488,40499,42895,48.56 70 | PA,Mifflin County,16502,5375,10929,32.97 71 | OH,Hardin County,13114,5013,7749,39.26 72 | PA,Lehigh County,152473,87089,63382,57.88 73 | PA,Huntingdon County,18632,6621,11745,36.05 74 | PA,Blair County,53102,19813,32708,37.72 75 | OH,Carroll County,13953,6423,7097,47.47 76 | OH,Mercer County,21271,5853,15100,27.92 77 | PA,Cambria County,65670,32451,31995,50.36 78 | OH,Morrow County,16643,6177,10067,38.01 79 | OH,Marion County,29017,12870,15454,45.45 80 | PA,Juniata County,9711,3068,6484,32.12 81 | OH,Auglaize County,23486,6727,16395,29.07 82 | PA,Westmoreland County,176873,72721,102294,41.55 83 | PA,Berks County,180000,97047,80513,54.66 84 | PA,Allegheny County,651436,373153,272347,57.81 85 | OH,Holmes County,11113,3141,7720,28.94 86 | OH,Tuscarawas County,42950,21498,20454,51.28 87 | PA,Dauphin County,129529,69975,58238,54.58 88 | PA,Perry County,19745,6396,13058,32.88 89 | PA,Bucks County,332924,179031,150248,54.37 90 | OH,Jefferson County,35939,17635,17559,50.10 91 | OH,Knox County,28231,11014,16640,39.84 92 | PA,Lebanon County,58297,23310,34314,40.45 93 | OH,Logan County,22217,7936,13848,36.43 94 | OH,Union County,24928,8761,15744,35.71 95 | OH,Shelby County,23668,7317,15924,31.47 96 | PA,Washington County,98047,46122,50752,47.61 97 | OH,Coshocton County,16863,7689,8675,47.01 98 | PA,Montgomery County,422419,253393,165552,60.49 99 | OH,Delaware County,92416,36653,54778,40.10 100 | OH,Harrison County,7787,3683,3872,48.76 101 | OH,Darke County,25793,7964,17290,31.56 102 | PA,Cumberland County,113304,48306,63739,43.11 103 | PA,Bedford County,22443,6059,16124,27.32 104 | PA,Lancaster County,228137,99586,126568,44.03 105 | PA,Franklin County,63641,21169,41906,33.56 106 | PA,Somerset County,35168,12878,21686,37.26 107 | OH,Champaign County,18887,7385,11141,39.86 108 | PA,Chester County,254354,137833,114421,54.64 109 | PA,York County,194210,82839,109268,43.12 110 | OH,Guernsey County,17325,7625,9197,45.31 111 | OH,Miami County,52807,18372,33417,35.47 112 | OH,Belmont County,32411,16302,15422,51.38 113 | OH,Muskingum County,39071,17730,20549,46.33 114 | PA,Fulton County,6306,1576,4642,25.34 115 | PA,Fayette County,52560,25866,26081,49.79 116 | PA,Philadelphia County,717329,595980,117221,83.56 117 | PA,Adams County,44491,17633,26349,40.09 118 | PA,Delaware County,297004,178870,115273,60.81 119 | OH,Clark County,66770,31958,33634,48.73 120 | PA,Greene County,15976,7829,7889,49.81 121 | OH,Noble County,6172,2474,3450,41.77 122 | OH,Fairfield County,71945,29250,41580,41.32 123 | OH,Perry County,15404,7261,7721,48.46 124 | OH,Montgomery County,278511,145997,128679,53.14 125 | OH,Preble County,21002,6999,13562,34.01 126 | OH,Monroe County,6982,3705,3066,54.74 127 | OH,Greene County,83589,33540,48936,40.67 128 | OH,Pickaway County,23726,9077,14228,38.96 129 | OH,Morgan County,6608,2966,3440,46.29 130 | OH,Fayette County,11694,4401,7102,38.25 131 | OH,Washington County,18802,1238,17019,6.80 132 | OH,Warren County,106216,33398,71691,31.75 133 | OH,Ross County,31840,14455,16759,46.33 134 | OH,Vinton County,5646,2463,3021,44.90 135 | OH,Clermont County,95480,31611,62559,33.57 136 | OH,Brown County,20113,7503,12192,38.10 137 | OH,Jackson County,13993,5397,8219,39.67 138 | OH,Meigs County,10354,4094,6015,40.47 139 | OH,Pike County,12506,6033,6162,49.44 140 | OH,Adams County,11388,4170,6914,37.62 141 | OH,Gallia County,13318,4777,8247,36.71 142 | OH,Scioto County,32571,14926,16994,46.73 143 | OH,Lawrence County,27194,11262,15415,42.20 144 | FL,Jackson County,21565,7671,13717,35.86 145 | FL,Escambia County,154447,61572,91411,40.25 146 | FL,Santa Rosa County,76185,19470,55972,25.81 147 | FL,Okaloosa County,95529,25872,68789,27.33 148 | FL,Holmes County,8589,1446,7033,17.06 149 | FL,Walton County,27046,7174,19561,26.84 150 | FL,Washington County,11131,2863,8178,25.93 151 | FL,Nassau County,38304,10618,27403,27.93 152 | FL,Gadsden County,22510,15582,6811,69.58 153 | FL,Leon County,148608,91747,55705,62.23 154 | FL,Jefferson County,7957,4088,3797,51.85 155 | FL,Madison County,8907,4270,4544,48.44 156 | FL,Hamilton County,5587,2364,3179,42.65 157 | FL,Calhoun County,6244,1821,4345,29.53 158 | FL,Liberty County,3278,895,2339,27.67 159 | FL,Columbia County,28128,9171,18670,32.94 160 | FL,Duval County,415761,202618,210537,49.04 161 | FL,Baker County,11059,2327,8672,21.15 162 | FL,Bay County,81127,23653,56683,29.45 163 | FL,Suwannee County,17662,4916,12534,28.17 164 | FL,Taylor County,9366,2803,6457,30.27 165 | FL,Wakulla County,14376,5311,8877,37.43 166 | FL,Lafayette County,3359,642,2679,19.33 167 | FL,Saint Johns County,105844,35791,69222,34.08 168 | FL,Gulf County,7205,2149,4980,30.15 169 | FL,Clay County,94577,26697,67203,28.43 170 | FL,Bradford County,11676,3430,8136,29.66 171 | FL,Union County,5293,1300,3940,24.81 172 | FL,Franklin County,6029,2134,3818,35.86 173 | FL,Alachua County,125519,75565,48513,60.90 174 | FL,Gilchrist County,7819,1996,5656,26.09 175 | FL,Putnam County,33171,13236,19637,40.26 176 | FL,Dixie County,7264,1925,5194,27.04 177 | FL,Flagler County,49031,24726,23951,50.80 178 | FL,Levy County,18725,6711,11754,36.35 179 | FL,Marion County,162022,70839,89628,44.14 180 | FL,Volusia County,243824,127795,113938,52.86 181 | FL,Lake County,146926,62948,82802,43.19 182 | FL,Citrus County,76158,31460,43706,41.85 183 | FL,Sumter County,48868,17655,30866,36.39 184 | FL,Seminole County,205895,99335,105070,48.60 185 | FL,Brevard County,287859,127620,157589,44.74 186 | FL,Orange County,462711,273009,186832,59.37 187 | FL,Hernando County,87901,41886,45021,48.19 188 | FL,Pasco County,214866,102417,110104,48.20 189 | FL,Polk County,244833,113865,128878,46.91 190 | FL,Osceola County,100670,59962,40086,59.93 191 | FL,Pinellas County,463282,248299,210066,54.17 192 | FL,Hillsborough County,513312,272963,236355,53.59 193 | FL,Indian River County,70591,29710,40176,42.52 194 | FL,Highlands County,44783,18135,26221,40.89 195 | FL,Hardee County,7412,2568,4763,35.03 196 | FL,Manatee County,151994,70034,80721,46.46 197 | FL,Okeechobee County,12786,5108,7561,40.32 198 | FL,Saint Lucie County,120579,67125,52512,56.11 199 | FL,Sarasota County,207353,102686,102897,49.95 200 | FL,DeSoto County,10131,4383,5632,43.76 201 | FL,Martin County,78294,33508,44143,43.15 202 | FL,Glades County,3358,1381,1938,41.61 203 | FL,Charlotte County,85158,39031,45205,46.34 204 | FL,Palm Beach County,590500,361271,226037,61.51 205 | FL,Hendry County,10879,4998,5780,46.37 206 | FL,Lee County,269276,119701,147608,44.78 207 | FL,Collier County,141988,54450,86379,38.66 208 | FL,Broward County,733899,492640,237729,67.45 209 | FL,Miami-Dade County,863486,499831,360551,58.09 210 | FL,Monroe County,40272,20907,18933,52.48 211 | OH,Ottawa County,23069,12049,10618,53.16 212 | OH,Sandusky County,30373,15601,14190,52.40 213 | OH,Summit County,269059,155105,110499,58.36 214 | OH,Athens County,31098,20722,9742,68.02 215 | OH,Butler County,173777,66030,105341,38.53 216 | OH,Clinton County,19305,6558,12409,34.58 217 | OH,Cuyahoga County,665352,458422,199880,69.64 218 | OH,Franklin County,560325,334709,218486,60.50 219 | OH,Hamilton County,425086,225213,195530,53.53 220 | OH,Highland County,19186,6856,11907,36.54 221 | OH,Hocking County,12961,6259,6364,49.58 222 | OH,Licking County,82356,33932,46918,41.97 223 | OH,Madison County,17454,6532,10606,38.11 224 | -------------------------------------------------------------------------------- /Bagian 5 - Statistik dan Python 1/Gaussian-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 5 - Statistik dan Python 1/Gaussian-1.png -------------------------------------------------------------------------------- /Bagian 5 - Statistik dan Python 1/Gaussian-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 5 - Statistik dan Python 1/Gaussian-2.png -------------------------------------------------------------------------------- /Bagian 5 - Statistik dan Python 1/belmont.csv: -------------------------------------------------------------------------------- 1 | Year,Winner,Jockey,Trainer,Owner,Time,Track,miles 2 | 2016,Creator,"Irad Ortiz, Jr",Steve Asmussen,WinStar Farm LLC,2:28.51,Belmont,1.5 3 | 2015,American Pharoah,Victor Espinoza,Bob Baffert,"Zayat Stables, LLC",2:26.65,Belmont,1.5 4 | 2014,Tonalist,Joel Rosario,Christophe Clement,Robert S. Evans,2:28.52,Belmont,1.5 5 | 2013,Palace Malice,Mike Smith,Todd Pletcher,Dogwood Stable,2:30.70,Belmont,1.5 6 | 2012,Union Rags,John Velazquez,Michael Matz,Phyllis M. Wyeth,2:30.42,Belmont,1.5 7 | 2011,Ruler on Ice,"Jose Valdivia, Jr.",Kelly Breen,George and Lori Hall,2:30.88,Belmont,1.5 8 | 2010,Drosselmeyer,Mike Smith,William Mott,WinStar Farm LLC,2:31.57,Belmont,1.5 9 | 2009,Summer Bird,Kent Desormeaux,Tim Ice,Kalarikkal & Vilasini Jayaraman,2:27.54,Belmont,1.5 10 | 2008,Da'Tara,Alan Garcia,Nick Zito,Robert V. LaPenta,2:29.65,Belmont,1.5 11 | 2007,Rags to Riches ‡,John Velazquez,Todd Pletcher,M. Tabor & D. Smith,2:28.74,Belmont,1.5 12 | 2006,Jazil,Fernando Jara,Kiaran McLaughlin,Shadwell Farm,2:27.86,Belmont,1.5 13 | 2005,Afleet Alex,Jeremy Rose,Timothy Ritchey,Cash is King LLC,2:28.75,Belmont,1.5 14 | 2004,Birdstone,Edgar Prado,Nick Zito,Marylou Whitney Stables,2:27.50,Belmont,1.5 15 | 2003,Empire Maker,Jerry Bailey,Robert Frankel,Juddmonte Farms,2:28.26,Belmont,1.5 16 | 2002,Sarava,Edgar Prado,Kenneth McPeek,New Phoenix Stable,2:29.71,Belmont,1.5 17 | 2001,Point Given,Gary Stevens,Bob Baffert,The Thoroughbred Corp.,2:26.56,Belmont,1.5 18 | 2000,Commendable,Pat Day,D. Wayne Lukas,Bob & Beverly Lewis,2:31.19,Belmont,1.5 19 | 1999,Lemon Drop Kid,Jose Santos,Scotty Schulhofer,Jeanne G. Vance,2:27.88,Belmont,1.5 20 | 1998,Victory Gallop,Gary Stevens,W. Elliott Walden,Prestonwood Farm,2:29.16,Belmont,1.5 21 | 1997,Touch Gold,Chris McCarron,David Hofmans,Frank Stronach,2:28.82,Belmont,1.5 22 | 1996,Editor's Note,Rene R. Douglas,D. Wayne Lukas,Overbrook Farm,2:28.96,Belmont,1.5 23 | 1995,Thunder Gulch,Gary Stevens,D. Wayne Lukas,Michael Tabor,2:32.02,Belmont,1.5 24 | 1994,Tabasco Cat,Pat Day,D. Wayne Lukas,Reynolds/Overbrook,2:26.82,Belmont,1.5 25 | 1993,Colonial Affair,Julie Krone,Scotty Schulhofer,Centennial Farms,2:29.97,Belmont,1.5 26 | 1992,A.P. Indy,Ed Delahoussaye,Neil Drysdale,Tomonori Tsurumaki,2:26.13,Belmont,1.5 27 | 1991,Hansel,Jerry Bailey,Frank L. Brothers,Lazy Lane Farm,2:28.10,Belmont,1.5 28 | 1990,Go And Go,Michael Kinane,Dermot K. Weld,Moyglare Stud Farm,2:27.20,Belmont,1.5 29 | 1989,Easy Goer,Pat Day,C. R. McGaughey III,Ogden Phipps,2:26.00,Belmont,1.5 30 | 1988,Risen Star,Ed Delahoussaye,Louie J. Roussel III,Louie J. Roussel III,2:26.40,Belmont,1.5 31 | 1987,Bet Twice,Craig Perret,Jimmy Croll,Blanche P. Levy,2:28.20,Belmont,1.5 32 | 1986,Danzig Connection,Chris McCarron,Woody Stephens,Henryk de Kwiatkowski,2:29.80,Belmont,1.5 33 | 1985,Creme Fraiche,Eddie Maple,Woody Stephens,Brushwood Stables,2:27.00,Belmont,1.5 34 | 1984,Swale,"Laffit Pincay, Jr.",Woody Stephens,Claiborne Farm,2:27.20,Belmont,1.5 35 | 1983,Caveat,"Laffit Pincay, Jr.",Woody Stephens,August Belmont IV,2:27.80,Belmont,1.5 36 | 1982,Conquistador Cielo,"Laffit Pincay, Jr.",Woody Stephens,Henryk de Kwiatkowski,2:28.20,Belmont,1.5 37 | 1981,Summing,George Martens,Luis Barrera,"Charles T. Wilson, Jr.",2:29.00,Belmont,1.5 38 | 1980,Temperence Hill,Eddie Maple,Joseph B. Cantey,Loblolly Stable,2:29.80,Belmont,1.5 39 | 1979,Coastal,Ruben Hernandez,David A. Whiteley,William Haggin Perry,2:28.60,Belmont,1.5 40 | 1978,Affirmed,Steve Cauthen,Laz Barrera,Harbor View Farm,2:26.80,Belmont,1.5 41 | 1977,Seattle Slew,Jean Cruguet,"William H. Turner, Jr.",Karen L. Taylor,2:29.60,Belmont,1.5 42 | 1976,Bold Forbes,"Angel Cordero, Jr.",Laz Barrera,E. Rodriguez Tizol,2:29.00,Belmont,1.5 43 | 1975,Avatar,Bill Shoemaker,Tommy Doyle,"Arthur A. Seeligson, Jr.",2:28.20,Belmont,1.5 44 | 1974,Little Current,Miguel A. Rivera,Lou Rondinello,Darby Dan Farm,2:29.20,Belmont,1.5 45 | 1973,Secretariat,Ron Turcotte,Lucien Laurin,Meadow Stable,2:24.00,Belmont,1.5 46 | 1972,Riva Ridge,Ron Turcotte,Lucien Laurin,Meadow Stud,2:28.00,Belmont,1.5 47 | 1971,Pass Catcher,Walter Blum,Eddie Yowell,October House Farm,2:30.40,Belmont,1.5 48 | 1970,High Echelon,John L. Rotz,John W. Jacobs,Ethel D. Jacobs,2:34.00,Belmont,1.5 49 | 1969,Arts and Letters,Braulio Baeza,J. Elliott Burch,Rokeby Stables,2:28.80,Belmont,1.5 50 | 1968,Stage Door Johnny,Heliodoro Gustines,"John M. Gaver, Sr.",Greentree Stable,2:27.20,Belmont,1.5 51 | 1967,Damascus,Bill Shoemaker,"Frank Y. Whiteley, Jr.",Edith W. Bancroft,2:28.80,Aqueduct,1.5 52 | 1966,Amberoid,William Boland,Lucien Laurin,Reginald N. Webster,2:29.60,Aqueduct,1.5 53 | 1965,Hail To All,Johnny Sellers,Eddie Yowell,Zelda Cohen,2:28.40,Aqueduct,1.5 54 | 1964,Quadrangle,Manuel Ycaza,J. Elliott Burch,Rokeby Stables,2:28.40,Aqueduct,1.5 55 | 1963,Chateaugay,Braulio Baeza,James P. Conway,Darby Dan Farm,2:30.20,Aqueduct,1.5 56 | 1962,Jaipur,Bill Shoemaker,Bert Mulholland,"George D. Widener, Jr.",2:28.80,Belmont,1.5 57 | 1961,Sherluck,Braulio Baeza,Harold Young,Jacob Sher,2:29.20,Belmont,1.5 58 | 1960,Celtic Ash,Bill Hartack,Thomas J. Barry,Joseph E. O'Connell,2:29.20,Belmont,1.5 59 | 1959,Sword Dancer,Bill Shoemaker,J. Elliott Burch,Brookmeade Stable,2:28.40,Belmont,1.5 60 | 1958,Cavan,Pete Anderson,Thomas J. Barry,Joseph E. O'Connell,2:30.20,Belmont,1.5 61 | 1957,Gallant Man,Bill Shoemaker,John A. Nerud,Ralph Lowe,2:26.60,Belmont,1.5 62 | 1956,Needles,David Erb,Hugh L. Fontaine,D & H Stable,2:29.80,Belmont,1.5 63 | 1955,Nashua,Eddie Arcaro,Jim Fitzsimmons,Belair Stud,2:29.00,Belmont,1.5 64 | 1954,High Gun,Eric Guerin,Max Hirsch,King Ranch,2:30.80,Belmont,1.5 65 | 1953,Native Dancer,Eric Guerin,Bill Winfrey,Alfred G. Vanderbilt II,2:28.60,Belmont,1.5 66 | 1952,One Count,Eddie Arcaro,Oscar White,Sarah F. Jeffords,2:30.20,Belmont,1.5 67 | 1951,Counterpoint,David Gorman,Sylvester Veitch,C. V. Whitney,2:29.00,Belmont,1.5 68 | 1950,Middleground,William Boland,Max Hirsch,King Ranch,2:28.60,Belmont,1.5 69 | 1949,Capot,Ted Atkinson,"John M. Gaver, Sr.",Greentree Stable,2:30.20,Belmont,1.5 70 | 1948,Citation,Eddie Arcaro,Horace A. Jones,Calumet Farm,2:28.20,Belmont,1.5 71 | 1947,Phalanx,Ruperto Donoso,Sylvester Veitch,C. V. Whitney,2:29.40,Belmont,1.5 72 | 1946,Assault,Warren Mehrtens,Max Hirsch,King Ranch,2:30.80,Belmont,1.5 73 | 1945,Pavot,Eddie Arcaro,Oscar White,"Walter M. Jeffords, Sr.",2:30.20,Belmont,1.5 74 | 1944,Bounding Home,Gayle Smith,Matt Brady,"William Ziegler, Jr.",2:32.20,Belmont,1.5 75 | 1943,Count Fleet,Johnny Longden,Don Cameron,Fannie Hertz,2:28.20,Belmont,1.5 76 | 1942,Shut Out,Eddie Arcaro,"John M. Gaver, Sr.",Greentree Stable,2:29.20,Belmont,1.5 77 | 1941,Whirlaway,Eddie Arcaro,Ben A. Jones,Calumet Farm,2:31.00,Belmont,1.5 78 | 1940,Bimelech,Fred A. Smith,William A. Hurley,Edward R. Bradley,2:29.60,Belmont,1.5 79 | 1939,Johnstown,James Stout,Jim Fitzsimmons,Belair Stud,2:29.60,Belmont,1.5 80 | 1938,Pasteurized,James Stout,George M. Odom,Carol Harriman Plunkett,2:29.40,Belmont,1.5 81 | 1937,War Admiral,Charley Kurtsinger,George Conway,Glen Riddle Farm,2:28.60,Belmont,1.5 82 | 1936,Granville,James Stout,Jim Fitzsimmons,Belair Stud,2:30.00,Belmont,1.5 83 | 1935,Omaha,Willie Saunders,Jim Fitzsimmons,Belair Stud,2:30.60,Belmont,1.5 84 | 1934,Peace Chance,Wayne D. Wright,Pete Coyne,Joseph E. Widener,2:29.20,Belmont,1.5 85 | 1933,Hurryoff,Mack Garner,Henry McDaniel,Joseph E. Widener,2:32.60,Belmont,1.5 86 | 1932,Faireno,Tommy Malley,Jim Fitzsimmons,Belair Stud,2:32.80,Belmont,1.5 87 | 1931,Twenty Grand,Charley Kurtsinger,"James G. Rowe, Jr.",Greentree Stable,2:29.60,Belmont,1.5 88 | 1930,Gallant Fox,Earl Sande,Jim Fitzsimmons,Belair Stud,2:31.60,Belmont,1.5 89 | 1929,Blue Larkspur,Mack Garner,Herbert J. Thompson,Edward R. Bradley,2:32.80,Belmont,1.5 90 | 1928,Vito,Clarence Kummer,Max Hirsch,Alfred H. Cosden,2:33.20,Belmont,1.5 91 | 1927,Chance Shot,Earl Sande,Pete Coyne,Joseph E. Widener,2:32.40,Belmont,1.5 92 | 1926,Crusader,Albert Johnson,George Conway,Glen Riddle Farm,2:32.20,Belmont,1.5 93 | -------------------------------------------------------------------------------- /Bagian 5 - Statistik dan Python 1/iris.csv: -------------------------------------------------------------------------------- 1 | sepal_length,sepal_width,petal_length,petal_width,species 2 | 5.1,3.5,1.4,0.2,setosa 3 | 4.9,3,1.4,0.2,setosa 4 | 4.7,3.2,1.3,0.2,setosa 5 | 4.6,3.1,1.5,0.2,setosa 6 | 5,3.6,1.4,0.2,setosa 7 | 5.4,3.9,1.7,0.4,setosa 8 | 4.6,3.4,1.4,0.3,setosa 9 | 5,3.4,1.5,0.2,setosa 10 | 4.4,2.9,1.4,0.2,setosa 11 | 4.9,3.1,1.5,0.1,setosa 12 | 5.4,3.7,1.5,0.2,setosa 13 | 4.8,3.4,1.6,0.2,setosa 14 | 4.8,3,1.4,0.1,setosa 15 | 4.3,3,1.1,0.1,setosa 16 | 5.8,4,1.2,0.2,setosa 17 | 5.7,4.4,1.5,0.4,setosa 18 | 5.4,3.9,1.3,0.4,setosa 19 | 5.1,3.5,1.4,0.3,setosa 20 | 5.7,3.8,1.7,0.3,setosa 21 | 5.1,3.8,1.5,0.3,setosa 22 | 5.4,3.4,1.7,0.2,setosa 23 | 5.1,3.7,1.5,0.4,setosa 24 | 4.6,3.6,1,0.2,setosa 25 | 5.1,3.3,1.7,0.5,setosa 26 | 4.8,3.4,1.9,0.2,setosa 27 | 5,3,1.6,0.2,setosa 28 | 5,3.4,1.6,0.4,setosa 29 | 5.2,3.5,1.5,0.2,setosa 30 | 5.2,3.4,1.4,0.2,setosa 31 | 4.7,3.2,1.6,0.2,setosa 32 | 4.8,3.1,1.6,0.2,setosa 33 | 5.4,3.4,1.5,0.4,setosa 34 | 5.2,4.1,1.5,0.1,setosa 35 | 5.5,4.2,1.4,0.2,setosa 36 | 4.9,3.1,1.5,0.1,setosa 37 | 5,3.2,1.2,0.2,setosa 38 | 5.5,3.5,1.3,0.2,setosa 39 | 4.9,3.1,1.5,0.1,setosa 40 | 4.4,3,1.3,0.2,setosa 41 | 5.1,3.4,1.5,0.2,setosa 42 | 5,3.5,1.3,0.3,setosa 43 | 4.5,2.3,1.3,0.3,setosa 44 | 4.4,3.2,1.3,0.2,setosa 45 | 5,3.5,1.6,0.6,setosa 46 | 5.1,3.8,1.9,0.4,setosa 47 | 4.8,3,1.4,0.3,setosa 48 | 5.1,3.8,1.6,0.2,setosa 49 | 4.6,3.2,1.4,0.2,setosa 50 | 5.3,3.7,1.5,0.2,setosa 51 | 5,3.3,1.4,0.2,setosa 52 | 7,3.2,4.7,1.4,versicolor 53 | 6.4,3.2,4.5,1.5,versicolor 54 | 6.9,3.1,4.9,1.5,versicolor 55 | 5.5,2.3,4,1.3,versicolor 56 | 6.5,2.8,4.6,1.5,versicolor 57 | 5.7,2.8,4.5,1.3,versicolor 58 | 6.3,3.3,4.7,1.6,versicolor 59 | 4.9,2.4,3.3,1,versicolor 60 | 6.6,2.9,4.6,1.3,versicolor 61 | 5.2,2.7,3.9,1.4,versicolor 62 | 5,2,3.5,1,versicolor 63 | 5.9,3,4.2,1.5,versicolor 64 | 6,2.2,4,1,versicolor 65 | 6.1,2.9,4.7,1.4,versicolor 66 | 5.6,2.9,3.6,1.3,versicolor 67 | 6.7,3.1,4.4,1.4,versicolor 68 | 5.6,3,4.5,1.5,versicolor 69 | 5.8,2.7,4.1,1,versicolor 70 | 6.2,2.2,4.5,1.5,versicolor 71 | 5.6,2.5,3.9,1.1,versicolor 72 | 5.9,3.2,4.8,1.8,versicolor 73 | 6.1,2.8,4,1.3,versicolor 74 | 6.3,2.5,4.9,1.5,versicolor 75 | 6.1,2.8,4.7,1.2,versicolor 76 | 6.4,2.9,4.3,1.3,versicolor 77 | 6.6,3,4.4,1.4,versicolor 78 | 6.8,2.8,4.8,1.4,versicolor 79 | 6.7,3,5,1.7,versicolor 80 | 6,2.9,4.5,1.5,versicolor 81 | 5.7,2.6,3.5,1,versicolor 82 | 5.5,2.4,3.8,1.1,versicolor 83 | 5.5,2.4,3.7,1,versicolor 84 | 5.8,2.7,3.9,1.2,versicolor 85 | 6,2.7,5.1,1.6,versicolor 86 | 5.4,3,4.5,1.5,versicolor 87 | 6,3.4,4.5,1.6,versicolor 88 | 6.7,3.1,4.7,1.5,versicolor 89 | 6.3,2.3,4.4,1.3,versicolor 90 | 5.6,3,4.1,1.3,versicolor 91 | 5.5,2.5,4,1.3,versicolor 92 | 5.5,2.6,4.4,1.2,versicolor 93 | 6.1,3,4.6,1.4,versicolor 94 | 5.8,2.6,4,1.2,versicolor 95 | 5,2.3,3.3,1,versicolor 96 | 5.6,2.7,4.2,1.3,versicolor 97 | 5.7,3,4.2,1.2,versicolor 98 | 5.7,2.9,4.2,1.3,versicolor 99 | 6.2,2.9,4.3,1.3,versicolor 100 | 5.1,2.5,3,1.1,versicolor 101 | 5.7,2.8,4.1,1.3,versicolor 102 | 6.3,3.3,6,2.5,virginica 103 | 5.8,2.7,5.1,1.9,virginica 104 | 7.1,3,5.9,2.1,virginica 105 | 6.3,2.9,5.6,1.8,virginica 106 | 6.5,3,5.8,2.2,virginica 107 | 7.6,3,6.6,2.1,virginica 108 | 4.9,2.5,4.5,1.7,virginica 109 | 7.3,2.9,6.3,1.8,virginica 110 | 6.7,2.5,5.8,1.8,virginica 111 | 7.2,3.6,6.1,2.5,virginica 112 | 6.5,3.2,5.1,2,virginica 113 | 6.4,2.7,5.3,1.9,virginica 114 | 6.8,3,5.5,2.1,virginica 115 | 5.7,2.5,5,2,virginica 116 | 5.8,2.8,5.1,2.4,virginica 117 | 6.4,3.2,5.3,2.3,virginica 118 | 6.5,3,5.5,1.8,virginica 119 | 7.7,3.8,6.7,2.2,virginica 120 | 7.7,2.6,6.9,2.3,virginica 121 | 6,2.2,5,1.5,virginica 122 | 6.9,3.2,5.7,2.3,virginica 123 | 5.6,2.8,4.9,2,virginica 124 | 7.7,2.8,6.7,2,virginica 125 | 6.3,2.7,4.9,1.8,virginica 126 | 6.7,3.3,5.7,2.1,virginica 127 | 7.2,3.2,6,1.8,virginica 128 | 6.2,2.8,4.8,1.8,virginica 129 | 6.1,3,4.9,1.8,virginica 130 | 6.4,2.8,5.6,2.1,virginica 131 | 7.2,3,5.8,1.6,virginica 132 | 7.4,2.8,6.1,1.9,virginica 133 | 7.9,3.8,6.4,2,virginica 134 | 6.4,2.8,5.6,2.2,virginica 135 | 6.3,2.8,5.1,1.5,virginica 136 | 6.1,2.6,5.6,1.4,virginica 137 | 7.7,3,6.1,2.3,virginica 138 | 6.3,3.4,5.6,2.4,virginica 139 | 6.4,3.1,5.5,1.8,virginica 140 | 6,3,4.8,1.8,virginica 141 | 6.9,3.1,5.4,2.1,virginica 142 | 6.7,3.1,5.6,2.4,virginica 143 | 6.9,3.1,5.1,2.3,virginica 144 | 5.8,2.7,5.1,1.9,virginica 145 | 6.8,3.2,5.9,2.3,virginica 146 | 6.7,3.3,5.7,2.5,virginica 147 | 6.7,3,5.2,2.3,virginica 148 | 6.3,2.5,5,1.9,virginica 149 | 6.5,3,5.2,2,virginica 150 | 6.2,3.4,5.4,2.3,virginica 151 | 5.9,3,5.1,1.8,virginica 152 | -------------------------------------------------------------------------------- /Bagian 5 - Statistik dan Python 1/michelson_speed_of_light.csv: -------------------------------------------------------------------------------- 1 | ,date,distinctness of image,temperature (F),position of deflected image,position of slit,displacement of image in divisions,difference between greatest and least,B,Cor,revolutions per second,radius (ft),value of one turn of screw,velocity of light in air (km/s),remarks 2 | 0,June 5,3,76,114.85,0.3,114.55,0.17,1.423,-0.132,257.36,28.671999999999997,0.9961399999999999,299850,Electric light. 3 | 1, June 7,2,72,114.64,0.07400000000000001,114.56,0.10,1.5330000000000001,-0.084,257.52,28.655,0.9961399999999999,299740,P.M. Frame inclined at various angles 4 | 2, June 7,2,72,114.58,0.07400000000000001,114.50,0.08,1.5330000000000001,-0.084,257.52,28.647,0.9961399999999999,299900,P.M. Frame inclined at various angles 5 | 3, June 7,2,72,85.91,0.07400000000000001, 85.84,0.12,1.5330000000000001,-0.084,193.14,28.647,0.99598,300070,P.M. Frame inclined at various angles 6 | 4, June 7,2,72,85.97,0.07400000000000001, 85.89,O.07,1.5330000000000001,-0.084,193.14,28.65,0.99598,299930,P.M. Frame inclined at various angles 7 | 5, June 7,2,72,114.61,0.07400000000000001,114-53,0.07,1.5330000000000001,-0.084,257.42,28.65,0.9961399999999999,299850,P.M. Frame inclined at various angles 8 | 6, June 9,3,83,114.54,0.07400000000000001,114.47,0.07,1.5330000000000001,-0.21600000000000003,257.39,28.658,0.9961399999999999,299950,P.M. Frame inclined at various angles 9 | 7, June 9,3,83,114.54,0.07400000000000001,114.46,0.10,1.5330000000000001,-0.21600000000000003,257.39,28.658,0.9961399999999999,299980,P.M. Frame inclined at various angles 10 | 8, June 9,3,83,114.57,0.07400000000000001,114.47,0.08,1.5330000000000001,-0.21600000000000003,257.39,28.662,0.9961399999999999,299980,P.M. Frame inclined at various angles 11 | 9, June 9,3,83,114.57,0.07400000000000001,114.50,0.06,1.5330000000000001,-0.21600000000000003,257.39,28.66,0.9961399999999999,299880,P.M. Frame inclined at various angles 12 | 10, June 9,2,83,114.61,0.07400000000000001,114.53,0.13,1.5330000000000001,-0.21600000000000003,257.39,28.678,0.9961399999999999,300000,P.M. Frame inclined at various angles 13 | 11, June 10,2,90,114.6,0.07400000000000001,114.52,0.11,1.517,-0.3,257.29,28.685,0.9961399999999999,299980,P.M. 14 | 12, June 10,2,90,114.62,0.07400000000000001,114.54,0.08,1.517,-0.3,257.29,28.685,0.9961399999999999,299930,P.M. 15 | 13, June 12,2,71,114.81,0.07400000000000001,114.74,0.09,1.45,-0.07200000000000001,257.45,28.69,0.9961399999999999,299650,A.M. 16 | 14, June 12,2,71,114.78,0.07400000000000001,114.70,0.05,1.45,-0.07200000000000001,257.45,28.69,0.9961399999999999,299760,A.M. 17 | 15, June 12,1,71,114.76,0.07400000000000001,114.68,0.09,1.45,-0.07200000000000001,257.45,28.69,0.9961399999999999,299810,A.M. 18 | 16, June 13,3,72,112.64,0.07400000000000001,112.56,0.09,1.5,-0.084,257.49,28.171999999999997,0.9961399999999999,300000,A.M. 19 | 17, June 13,3,72,112.63,0.07400000000000001,112.56,0.10,1.5,-0.084,257.49,28.171999999999997,0.9961399999999999,300000,A.M. 20 | 18, June 13,2,72,112.65,0.07400000000000001,112.57,0.08,1.5,-0.084,257.49,28.171999999999997,0.9961399999999999,299960,A.M. 21 | 19, June 13,3,79,112.82,0.26,112.56,0.06,1.517,-0.168,257.42,28.178,0.9961399999999999,299960,P.M. 22 | 20, June 13,3,79,112.82,0.26,112.56,0.13,1.517,-0.168,257.42,28.178,0.9961399999999999,299960,P.M. 23 | 21, June 13,3,79,112.83,0.26,112.57,0.07,1.517,-0.168,257.42,28.178,0.9961399999999999,299940,P.M. 24 | 22, June 13,3,79,112.82,0.26,112.56,0.06,1.517,-0.168,257.42,28.178,0.9961399999999999,299960,P.M. 25 | 23, June 13,3,79,112.83,0.26,112.57,0.11,1.517,-0.168,257.42,28.178,0.9961399999999999,299940,P.M. 26 | 24, June 13,3,79,113.41,0.26,113.15,11 ,1.517,-0.168,258.70,28.151999999999997,0.9961399999999999,299880,P.M. Set micrometer and counted oscillations. 27 | 25, June 13,3,79,112.14,0.26,111.88,6 ,1.517,-0.168,255.69,28.151999999999997,0.9961399999999999,299800,Oscillations of image of revolving mirror. 28 | 26, June 14,1,64,112.83,0.26,112.57,0.12,1.5,0.012,257.58,28.151999999999997,0.9961399999999999,299850,A.M. 29 | 27, June 14,1,64,112.83,0.26,112.57,0.05,1.517,0.012,257.60,28.151999999999997,0.9961399999999999,299880,A.M. 30 | 28, June 14,1,65,112.81,0.26,112.55,0.11,1.517,0.0,257.59,28.151999999999997,0.9961399999999999,299900,A.M. 31 | 29, June 14,1,66,112.83,0.26,112.57,0.09,1.517,-0.012,257.57,28.151999999999997,0.9961399999999999,299840,A.M. 32 | 30, June 14,1,67,112.83,0.26,112.57,0.12,1.517,-0.024,257.56,28.151999999999997,0.9961399999999999,299830,A.M. 33 | 31, June 14,1,84,112.78,0.26,112.52,0.06,1.517,-0.228,257.36,28.159000000000002,0.9961399999999999,299790,P.M. Readings taken by Lieut. Nazro. 34 | 32, June 14,1,85,112.76,0.26,112.50,0.08,1.5,-0.24,257.33,28.159000000000002,0.9961399999999999,299810,P.M. Readings taken by Lieut. Nazro. 35 | 33, June 14,1,84,112.72,0.26,112.46,0.08,1.483,-0.228,257.32,28.159000000000002,0.9961399999999999,299880,P.M. Readings taken by Lieut. Nazro. 36 | 34, June 14,1,84,112.73,0.26,112.47,0.09,1.483,-0.228,257.32,28.159000000000002,0.9961399999999999,299880,P.M. 37 | 35, June 14,1,84,112.75,0.26,112.49,0.09,1.483,-0.228,257.32,28.129,0.9961399999999999,299830,P.M. 38 | 36, June 17,2,62,112.85,0.26,112.59,0.09,1.517,0.036000000000000004,257.62,28.149,0.9961399999999999,299800,A.M. 39 | 37, June 17,2,63,112.84,0.26,112.58,0.06,1.5,0.024,257.59,28.149,0.9961399999999999,299790,A.M. 40 | 38, June 17,1,64,112.85,0.26,112.59,0.07,1.5,0.012,257.58,28.149,0.9961399999999999,299760,A.M. 41 | 39, June 17,3,77,112.8,0.26,112.54,0.07,1.5,-0.14400000000000002,257-43,28.156999999999996,0.9961399999999999,299800,P.M. Readings taken by Mr. Clason. 42 | 40, June 17,3,77,112.77,0.26,112.51,0.08,1.5,-0.14400000000000002,257.43,28.156999999999996,0.9961399999999999,299880,P.M. Readings taken by Mr. Clason. 43 | 41, June 17,3,77,112.77,0.26,112.51,0.11,1.5,-0.14400000000000002,257.43,28.156999999999996,0.9961399999999999,299880,P.M. Readings taken by Mr. Clason. 44 | 42, June 17,3,77,112.77,0.26,112.51,0.09,1.5,-0.14400000000000002,257.43,28.156999999999996,0.9961399999999999,299880,P.M. Readings taken by Mr. Clason. 45 | 43, June 17,3,77,112.78,0.26,112.52,0.08,1.5,-0.14400000000000002,257 43,28.156999999999996,0.9961399999999999,299860,P.M. Readings taken by Mr. Clason. 46 | 44, June 18,1,58,112.9,0.265,112.64,0.07,1.5,0.084,257.65,28.15,0.9961399999999999,299720,A.M. 47 | 45, June 18,1,58,112.9,0.265,112.64,0.10,1.5,0.084,257.65,28.15,0.9961399999999999,299720,A.M. 48 | 46, June 18,1,59,112.92,0.265,112.66,0.07,1.483,0.07200000000000001,257.62,28.15,0.9961399999999999,299620,A.M. 49 | 47, June 18,2,75,112.79,0.265,112.52,0.09,1.483,-0.12,257-43,28.158,0.9961399999999999,299860,P.M. 50 | 48, June 18,2,75,112.75,0.265,112.48,0.10,1.483,-0.12,257-43,28.158,0.9961399999999999,299970,P.M. 51 | 49, June 18,2,75,112.76,0.265,112.49,0.08,1.483,-0.12,257-43,28.158,0.9961399999999999,299950,P.M. 52 | 50, June 20,3,60,112.94,0.265,112.67,0.07,1.517,0.063,257.65,28.171999999999997,0.9961399999999999,299880,A.M. 53 | 51, June 20,3,61,112.92,0.265,112.65,0.09,1.517,0.048,257.63,28.171999999999997,0.9961399999999999,299910,A.M. 54 | 52, June 20,2,62,112.94,0.265,112.67,0.07,1.517,0.036000000000000004,257.62,28.171999999999997,0.9961399999999999,299850,A.M. 55 | 53, June 20,2,63,112.93,0.265,112.66,0.03,1.517,0.024,257.61,28.171999999999997,0.9961399999999999,299870,A.M. 56 | 54, June 20,2,78,133.48,0.265,133.21,0.13,1.45,-0.156,257.36,33.345,0.9962700000000001,299840,P.M. 57 | 55, June 20,2,79,133.49,0.265,133.23,0.09,1.5,-0.168,257.40,33.345,0.9962700000000001,299840,P.M. 58 | 56, June 20,2,80,133.49,0.265,133.22,0.07,1.5,-0.18,257.39,33.345,0.9962700000000001,299850,P.M. 59 | 57, June 20,2,79,133.5,0.265,133.24,0.13,1.483,-0.168,257.39,33.345,0.9962700000000001,299840,P.M. 60 | 58, June 20,2,79,133.49,0.265,133.22,0.06,1.483,-0.168,257.38,33.345,0.9962700000000001,299840,P.M. 61 | 59, June 20,2,79,133.49,0.265,133.22,0.10,1.483,-0.168,257.38,33.345,0.9962700000000001,299840,P.M. 62 | 60, June 21,2,61,133.56,0.265,133.29,0.12,1.5330000000000001,0.048,257.65,33.332,0.9962700000000001,299890,A.M. 63 | 61, June 21,2,62,133.58,0.265,133.31,0.08,1.5330000000000001,0.036000000000000004,257.64,33.332,0.9962700000000001,299810,A.M. 64 | 62, June 21,2,63,133.57,0.265,133.31,0.09,1.5330000000000001,0.024,257.63,33.332,0.9962700000000001,299810,A.M. 65 | 63, June 21,2,64,133.57,0.265,133.30,0.11,1.5330000000000001,0.012,257.61,33.332,0.9962700000000001,299820,A.M. 66 | 64, June 21,2,65,133.56,0.265,133.30,0.13,1.5330000000000001,0.0,257.60,33.332,0.9962700000000001,299800,A.M. 67 | 65, June 21,3,80,133.48,0.265,133.21,0.06,1.5330000000000001,-0.18,257.42,33.33,0.9962700000000001,299770,P.M. 68 | 66, June 21,3,81,133.46,0.265,133.19,0.10,1.5,-0.192,257.38,33.33,0.9962700000000001,299760,P.M. 69 | 67, June 21,3,82,133.46,0.265,133.20,0.05,1.5,-0.204,257.37,33.33,0.9962700000000001,299740,P.M. 70 | 68, June 21,3,82,133.46,0.265,133.20,0.08,1.517,-0.204,257.38,33.33,0.9962700000000001,299750,P.M. 71 | 69, June 21,3,81,133.46,0.265,133.19,0.08,1.5,-0.192,257.38,33.33,0.9962700000000001,299760,P.M. 72 | 70, June 23,3,89,133.43,0.265,133.16,0.08,1.5419999999999998,-0.28800000000000003,257.32,33.345,0.9962700000000001,299910,P.M. 73 | 71, June 23,3,89,133.42,0.265,133.15,0.06,1.55,-0.28800000000000003,257.33,33.345,0.9962700000000001,299920,P.M. 74 | 72, June 23,3,90,133.43,0.265,133.17,0.09,1.55,-0.3,257.32,33.345,0.9962700000000001,299890,P.M. 75 | 73, June 23,3,90,133.43,0.265,133.16,0.07,1.5330000000000001,-0.3,257.30,33.345,0.9962700000000001,299860,P.M. 76 | 74, June 23,3,90,133.42,0.265,133.16,0.07,1.517,-0.3,257.29,33.345,0.9962700000000001,299880,P.M. 77 | 75, June 24,3,72,133.47,0.265,133.20,0.15,1.517,-0.084,257.50,33.319,0.9962700000000001,299720,A.M. 78 | 76, June 24,3,73,133.44,0.265,133.17,0.04,1.517,-0.096,257.49,33.319,0.9962700000000001,299840,A.M. 79 | 77, June 24,3,74,133.42,0.265,133.16,0.11,1.517,-0.10800000000000001,257.48,33.319,0.9962700000000001,299850,A.M. 80 | 78, June 24,3,75,133.42,0.265,133.16,0.06,1.517,-0.12,257.47,33.319,0.9962700000000001,299850,A.M. 81 | 79, June 24,3,76,133.44,0.265,133.18,0.10,1.517,-0.132,257.45,33.319,0.9962700000000001,299780,A.M. 82 | 80, June 26,2,86,133.42,0.265,133.15,0.05,1.508,-0.252,257.33,33.339,0.9962700000000001,299890,P.M. 83 | 81, June 26,2,86,133.44,0.265,133.17,0.08,1.508,-0.252,257.33,33.339,0.9962700000000001,299840,P.M. 84 | 82, June 27,3,73,133.49,0.265,133.22,0.11,1.483,-0.096,257.46,33.328,0.9962700000000001,299780,A.M. 85 | 83, June 27,3,74,133.47,0.265,133.20,0.06,1.483,-0.10800000000000001,257.44,33.328,0.9962700000000001,299810,A.M. 86 | 84, June 27,3,75,133.47,0.265,133.21,0.09,1.483,-0.12,257.43,33.328,0.9962700000000001,299760,A.M. 87 | 85, June 27,3,75,133.45,0.265,133.19,0.09,1.4669999999999999,-0.12,257.42,33.328,0.9962700000000001,299810,A.M. 88 | 86, June 27,3,76,133.47,0.265,133.20,0.08,1.483,-0.132,257.42,33.328,0.9962700000000001,299790,A.M. 89 | 87, June 27,3,76,133.45,0.265,133.19,0.10,1.483,-0.132,257.42,33.328,0.9962700000000001,299810,A.M. 90 | 88, June 30,2,85,35.32,135.0, 99.68,0.05,1.5,-0.24,193.00,33.274,0.99645,299820,P.M. Mirror inverted. 91 | 89, June 30,2,86,35.34,135.0, 99.67,0.06,1.508,-0.252,193.00,33.274,0.99645,299850,P.M. Mirror inverted. 92 | 90, June 30,2,86,35.34,135.0, 99.66,0.10,1.508,-0.252,193.00,33.274,0.99645,299870,P.M. Mirror inverted. 93 | 91, June 30,2,86,35.34,135.0, 99.66,0.09,1.517,-0.252,193.00,33.274,0.99645,299870,P.M. Mirror inverted. 94 | 92, July 1,2,83,2.17,135.145,132.98,0.07,1.5,-0.21600000000000003,257.35,33.282,0.9962700000000001,299810,P.M. Mirror inverted. 95 | 93, July 1,2,84,2.15,135.145,133.00,0.09,1.5,-0.228,257.34,33.282,0.9962700000000001,299740,P.M. Mirror inverted. 96 | 94, July 1,2,86,2.14,135.145,133.01,0.06,1.4669999999999999,-0.252,257.28,33.311,0.9962700000000001,299810,P.M. Mirror inverted. 97 | 95, July 1,2,86,2.14,135.145,133.00,0.08,1.4669999999999999,-0.252,257.28,33.311,0.9962700000000001,299940,P.M. Mirror inverted. 98 | 96, July 2,3,86,99.85,0.4, 99.45,0.05,1.45,-0.252,192.95,33.205,0.9960600000000001,299950,P.M. Mirror erect. 99 | 97, July 2,3,86,66.74,0.4, 66.34,0.03,1.45,-0.252,128.63,33.205,0.9958600000000001,299800,P.M. Mirror erect. 100 | 98, July 2,3,86,50.16,0.4, 47.96,0.07,1.4669999999999999,-0.252, 96.48,33.205,0.9958,299810,P.M. Mirror erect. 101 | 99, July 2,3,85,33.57,0.4, 33.17,0.06,1.45,-0.24, 64.32,33.205,0.99574,299870,P.M. Mirror erect. 102 | -------------------------------------------------------------------------------- /Bagian 5 - Statistik dan Python 1/pearson_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 5 - Statistik dan Python 1/pearson_r.png -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/2008_swing_states.csv: -------------------------------------------------------------------------------- 1 | state,county,total_votes,dem_votes,rep_votes,dem_share 2 | PA,Erie County,127691,75775,50351,60.08 3 | PA,Bradford County,25787,10306,15057,40.64 4 | PA,Tioga County,17984,6390,11326,36.07 5 | PA,McKean County,15947,6465,9224,41.21 6 | PA,Potter County,7507,2300,5109,31.04 7 | PA,Wayne County,22835,9892,12702,43.78 8 | PA,Susquehanna County,19286,8381,10633,44.08 9 | PA,Warren County,18517,8537,9685,46.85 10 | OH,Ashtabula County,44874,25027,18949,56.94 11 | OH,Lake County,121335,60155,59142,50.46 12 | PA,Crawford County,38134,16780,20750,44.71 13 | OH,Lucas County,219830,142852,73706,65.99 14 | OH,Fulton County,21973,9900,11689,45.88 15 | OH,Geauga County,51102,21250,29096,42.23 16 | OH,Williams County,18397,8174,9880,45.26 17 | PA,Wyoming County,13138,5985,6983,46.15 18 | PA,Lackawanna County,107876,67520,39488,63.10 19 | PA,Elk County,14271,7290,6676,52.20 20 | PA,Forest County,2444,1038,1366,43.18 21 | PA,Venango County,23307,9238,13718,40.24 22 | OH,Erie County,41229,23148,17432,57.01 23 | OH,Wood County,65022,34285,29648,53.61 24 | PA,Cameron County,2245,879,1323,39.92 25 | PA,Pike County,24284,11493,12518,47.87 26 | PA,Lycoming County,49237,18381,30280,37.77 27 | PA,Sullivan County,3120,1233,1841,40.11 28 | OH,Lorain County,146859,85276,59068,59.10 29 | OH,Trumbull County,106911,64145,40164,61.48 30 | PA,Mercer County,53821,26411,26565,49.85 31 | OH,Henry County,14840,6320,8239,43.43 32 | PA,Clinton County,14791,7097,7504,48.61 33 | PA,Clarion County,17766,6756,10737,38.62 34 | PA,Luzerne County,135175,72492,61127,54.25 35 | OH,Defiance County,19195,8399,10407,44.69 36 | PA,Jefferson County,18802,6447,12057,34.84 37 | OH,Portage County,78206,41856,34822,54.59 38 | PA,Columbia County,28063,13230,14477,47.75 39 | OH,Huron County,25582,12076,12884,48.36 40 | OH,Medina County,90451,40924,48189,45.89 41 | OH,Seneca County,27449,13087,13823,48.62 42 | PA,Clearfield County,33813,14555,18662,43.82 43 | PA,Centre County,75763,41950,32992,55.97 44 | PA,Monroe County,68443,39453,28293,58.23 45 | OH,Paulding County,9769,4165,5317,43.92 46 | PA,Northumberland County,33939,14329,19018,42.97 47 | PA,Montour County,8023,3364,4574,42.38 48 | PA,Butler County,90425,32260,57074,36.11 49 | PA,Armstrong County,30081,11138,18542,37.53 50 | OH,Hancock County,36981,13870,22420,38.23 51 | OH,Putnam County,18680,5281,13072,28.79 52 | PA,Union County,17400,7333,9859,42.65 53 | OH,Mahoning County,127032,79173,45319,63.57 54 | PA,Carbon County,26923,13464,12957,50.96 55 | PA,Lawrence County,42103,19711,21851,47.43 56 | OH,Ashland County,25168,9300,15158,38.07 57 | OH,Crawford County,21173,8288,12316,40.18 58 | OH,Richland County,61122,25727,34034,43.05 59 | OH,Wyandot County,10977,4461,6270,41.56 60 | OH,Wayne County,52142,21712,29342,42.49 61 | OH,Van Wert County,14652,5178,9168,36.06 62 | OH,Stark County,187545,96990,86743,52.76 63 | PA,Northampton County,135587,75255,58551,56.24 64 | PA,Schuylkill County,63057,28300,33767,45.60 65 | OH,Columbiana County,48487,21882,25585,46.07 66 | OH,Allen County,50263,19522,29940,39.43 67 | PA,Indiana County,37302,17065,19727,46.39 68 | PA,Snyder County,15479,5382,9900,35.22 69 | PA,Beaver County,84488,40499,42895,48.56 70 | PA,Mifflin County,16502,5375,10929,32.97 71 | OH,Hardin County,13114,5013,7749,39.26 72 | PA,Lehigh County,152473,87089,63382,57.88 73 | PA,Huntingdon County,18632,6621,11745,36.05 74 | PA,Blair County,53102,19813,32708,37.72 75 | OH,Carroll County,13953,6423,7097,47.47 76 | OH,Mercer County,21271,5853,15100,27.92 77 | PA,Cambria County,65670,32451,31995,50.36 78 | OH,Morrow County,16643,6177,10067,38.01 79 | OH,Marion County,29017,12870,15454,45.45 80 | PA,Juniata County,9711,3068,6484,32.12 81 | OH,Auglaize County,23486,6727,16395,29.07 82 | PA,Westmoreland County,176873,72721,102294,41.55 83 | PA,Berks County,180000,97047,80513,54.66 84 | PA,Allegheny County,651436,373153,272347,57.81 85 | OH,Holmes County,11113,3141,7720,28.94 86 | OH,Tuscarawas County,42950,21498,20454,51.28 87 | PA,Dauphin County,129529,69975,58238,54.58 88 | PA,Perry County,19745,6396,13058,32.88 89 | PA,Bucks County,332924,179031,150248,54.37 90 | OH,Jefferson County,35939,17635,17559,50.10 91 | OH,Knox County,28231,11014,16640,39.84 92 | PA,Lebanon County,58297,23310,34314,40.45 93 | OH,Logan County,22217,7936,13848,36.43 94 | OH,Union County,24928,8761,15744,35.71 95 | OH,Shelby County,23668,7317,15924,31.47 96 | PA,Washington County,98047,46122,50752,47.61 97 | OH,Coshocton County,16863,7689,8675,47.01 98 | PA,Montgomery County,422419,253393,165552,60.49 99 | OH,Delaware County,92416,36653,54778,40.10 100 | OH,Harrison County,7787,3683,3872,48.76 101 | OH,Darke County,25793,7964,17290,31.56 102 | PA,Cumberland County,113304,48306,63739,43.11 103 | PA,Bedford County,22443,6059,16124,27.32 104 | PA,Lancaster County,228137,99586,126568,44.03 105 | PA,Franklin County,63641,21169,41906,33.56 106 | PA,Somerset County,35168,12878,21686,37.26 107 | OH,Champaign County,18887,7385,11141,39.86 108 | PA,Chester County,254354,137833,114421,54.64 109 | PA,York County,194210,82839,109268,43.12 110 | OH,Guernsey County,17325,7625,9197,45.31 111 | OH,Miami County,52807,18372,33417,35.47 112 | OH,Belmont County,32411,16302,15422,51.38 113 | OH,Muskingum County,39071,17730,20549,46.33 114 | PA,Fulton County,6306,1576,4642,25.34 115 | PA,Fayette County,52560,25866,26081,49.79 116 | PA,Philadelphia County,717329,595980,117221,83.56 117 | PA,Adams County,44491,17633,26349,40.09 118 | PA,Delaware County,297004,178870,115273,60.81 119 | OH,Clark County,66770,31958,33634,48.73 120 | PA,Greene County,15976,7829,7889,49.81 121 | OH,Noble County,6172,2474,3450,41.77 122 | OH,Fairfield County,71945,29250,41580,41.32 123 | OH,Perry County,15404,7261,7721,48.46 124 | OH,Montgomery County,278511,145997,128679,53.14 125 | OH,Preble County,21002,6999,13562,34.01 126 | OH,Monroe County,6982,3705,3066,54.74 127 | OH,Greene County,83589,33540,48936,40.67 128 | OH,Pickaway County,23726,9077,14228,38.96 129 | OH,Morgan County,6608,2966,3440,46.29 130 | OH,Fayette County,11694,4401,7102,38.25 131 | OH,Washington County,18802,1238,17019,6.80 132 | OH,Warren County,106216,33398,71691,31.75 133 | OH,Ross County,31840,14455,16759,46.33 134 | OH,Vinton County,5646,2463,3021,44.90 135 | OH,Clermont County,95480,31611,62559,33.57 136 | OH,Brown County,20113,7503,12192,38.10 137 | OH,Jackson County,13993,5397,8219,39.67 138 | OH,Meigs County,10354,4094,6015,40.47 139 | OH,Pike County,12506,6033,6162,49.44 140 | OH,Adams County,11388,4170,6914,37.62 141 | OH,Gallia County,13318,4777,8247,36.71 142 | OH,Scioto County,32571,14926,16994,46.73 143 | OH,Lawrence County,27194,11262,15415,42.20 144 | FL,Jackson County,21565,7671,13717,35.86 145 | FL,Escambia County,154447,61572,91411,40.25 146 | FL,Santa Rosa County,76185,19470,55972,25.81 147 | FL,Okaloosa County,95529,25872,68789,27.33 148 | FL,Holmes County,8589,1446,7033,17.06 149 | FL,Walton County,27046,7174,19561,26.84 150 | FL,Washington County,11131,2863,8178,25.93 151 | FL,Nassau County,38304,10618,27403,27.93 152 | FL,Gadsden County,22510,15582,6811,69.58 153 | FL,Leon County,148608,91747,55705,62.23 154 | FL,Jefferson County,7957,4088,3797,51.85 155 | FL,Madison County,8907,4270,4544,48.44 156 | FL,Hamilton County,5587,2364,3179,42.65 157 | FL,Calhoun County,6244,1821,4345,29.53 158 | FL,Liberty County,3278,895,2339,27.67 159 | FL,Columbia County,28128,9171,18670,32.94 160 | FL,Duval County,415761,202618,210537,49.04 161 | FL,Baker County,11059,2327,8672,21.15 162 | FL,Bay County,81127,23653,56683,29.45 163 | FL,Suwannee County,17662,4916,12534,28.17 164 | FL,Taylor County,9366,2803,6457,30.27 165 | FL,Wakulla County,14376,5311,8877,37.43 166 | FL,Lafayette County,3359,642,2679,19.33 167 | FL,Saint Johns County,105844,35791,69222,34.08 168 | FL,Gulf County,7205,2149,4980,30.15 169 | FL,Clay County,94577,26697,67203,28.43 170 | FL,Bradford County,11676,3430,8136,29.66 171 | FL,Union County,5293,1300,3940,24.81 172 | FL,Franklin County,6029,2134,3818,35.86 173 | FL,Alachua County,125519,75565,48513,60.90 174 | FL,Gilchrist County,7819,1996,5656,26.09 175 | FL,Putnam County,33171,13236,19637,40.26 176 | FL,Dixie County,7264,1925,5194,27.04 177 | FL,Flagler County,49031,24726,23951,50.80 178 | FL,Levy County,18725,6711,11754,36.35 179 | FL,Marion County,162022,70839,89628,44.14 180 | FL,Volusia County,243824,127795,113938,52.86 181 | FL,Lake County,146926,62948,82802,43.19 182 | FL,Citrus County,76158,31460,43706,41.85 183 | FL,Sumter County,48868,17655,30866,36.39 184 | FL,Seminole County,205895,99335,105070,48.60 185 | FL,Brevard County,287859,127620,157589,44.74 186 | FL,Orange County,462711,273009,186832,59.37 187 | FL,Hernando County,87901,41886,45021,48.19 188 | FL,Pasco County,214866,102417,110104,48.20 189 | FL,Polk County,244833,113865,128878,46.91 190 | FL,Osceola County,100670,59962,40086,59.93 191 | FL,Pinellas County,463282,248299,210066,54.17 192 | FL,Hillsborough County,513312,272963,236355,53.59 193 | FL,Indian River County,70591,29710,40176,42.52 194 | FL,Highlands County,44783,18135,26221,40.89 195 | FL,Hardee County,7412,2568,4763,35.03 196 | FL,Manatee County,151994,70034,80721,46.46 197 | FL,Okeechobee County,12786,5108,7561,40.32 198 | FL,Saint Lucie County,120579,67125,52512,56.11 199 | FL,Sarasota County,207353,102686,102897,49.95 200 | FL,DeSoto County,10131,4383,5632,43.76 201 | FL,Martin County,78294,33508,44143,43.15 202 | FL,Glades County,3358,1381,1938,41.61 203 | FL,Charlotte County,85158,39031,45205,46.34 204 | FL,Palm Beach County,590500,361271,226037,61.51 205 | FL,Hendry County,10879,4998,5780,46.37 206 | FL,Lee County,269276,119701,147608,44.78 207 | FL,Collier County,141988,54450,86379,38.66 208 | FL,Broward County,733899,492640,237729,67.45 209 | FL,Miami-Dade County,863486,499831,360551,58.09 210 | FL,Monroe County,40272,20907,18933,52.48 211 | OH,Ottawa County,23069,12049,10618,53.16 212 | OH,Sandusky County,30373,15601,14190,52.40 213 | OH,Summit County,269059,155105,110499,58.36 214 | OH,Athens County,31098,20722,9742,68.02 215 | OH,Butler County,173777,66030,105341,38.53 216 | OH,Clinton County,19305,6558,12409,34.58 217 | OH,Cuyahoga County,665352,458422,199880,69.64 218 | OH,Franklin County,560325,334709,218486,60.50 219 | OH,Hamilton County,425086,225213,195530,53.53 220 | OH,Highland County,19186,6856,11907,36.54 221 | OH,Hocking County,12961,6259,6364,49.58 222 | OH,Licking County,82356,33932,46918,41.97 223 | OH,Madison County,17454,6532,10606,38.11 224 | -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/ans1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 6 - Statistik dan Python 2/ans1.png -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/ans2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 6 - Statistik dan Python 2/ans2.png -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/ans3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 6 - Statistik dan Python 2/ans3.png -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/ans4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 6 - Statistik dan Python 2/ans4.png -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/ans5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 6 - Statistik dan Python 2/ans5.png -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/anscombe.csv: -------------------------------------------------------------------------------- 1 | 0,0,1,1,2,2,3,3 2 | x,y,x,y,x,y,x,y 3 | 10.0,8.04,10.0,9.14,10.0,7.46,8.0,6.58 4 | 8.0,6.95,8.0,8.14,8.0,6.77,8.0,5.76 5 | 13.0,7.58,13.0,8.74,13.0,12.74,8.0,7.71 6 | 9.0,8.81,9.0,8.77,9.0,7.11,8.0,8.84 7 | 11.0,8.33,11.0,9.26,11.0,7.81,8.0,8.47 8 | 14.0,9.96,14.0,8.10,14.0,8.84,8.0,7.04 9 | 6.0,7.24,6.0,6.13,6.0,6.08,8.0,5.25 10 | 4.0,4.26,4.0,3.10,4.0,5.39,19.0,12.50 11 | 12.0,10.84,12.0,9.13,12.0,8.15,8.0,5.56 12 | 7.0,4.82,7.0,7.26,7.0,6.42,8.0,7.91 13 | 5.0,5.68,5.0,4.74,5.0,5.73,8.0,6.89 14 | -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/female_literacy_fertility.csv: -------------------------------------------------------------------------------- 1 | Country ,Continent,female literacy,fertility,population 2 | Chine,ASI,90.5,1.769,"1,324,655,000" 3 | Inde,ASI,50.8,2.682,"1,139,964,932" 4 | USA,NAM,99,2.077,"304,060,000" 5 | Indonésie,ASI,88.8,2.132,"227,345,082" 6 | Brésil,LAT,90.2,1.827,"191,971,506" 7 | Pakistan,ASI,40,3.872,"166,111,487" 8 | Bangladesh,ASI,49.8,2.288,"160,000,128" 9 | Nigéria,AF,48.8,5.173,"151,212,254" 10 | Fédération de Russie,EUR,99.4,1.393,"141,950,000" 11 | Japan,ASI,99,1.262,"127,704,000" 12 | Mexique,LAT,91.5,2.156,"106,350,434" 13 | Philippines,ASI,93.9,3.026,"90,348,437" 14 | Viet Nam,ASI,90.2,2.033,"86,210,781" 15 | Germany,EUR,99,1.324,"82,110,097" 16 | Egypte,AF,57.8,2.816,"81,527,172" 17 | Ethiopie,AF,22.8,5.211,"80,713,434" 18 | Turquie,ASI,81.3,2.1,"73,914,260" 19 | "Iran, République islamique d'",ASI,77.2,1.781,"71,956,322" 20 | Thaïlande,ASI,91.5,1.822,"67,386,383" 21 | Rép. Démocratique du Congo,AF,56.1,5.908,"64,256,635" 22 | France,EUR,99,1.881,"62,277,432" 23 | UK,EUR,99,1.852,"61,414,062" 24 | Italie,EUR,98.5,1.39,"59,832,179" 25 | Myanmar,ASI,89.2,2.281,"49,563,019" 26 | Afrique du Sud,AF,88.1,2.505,"48,687,000" 27 | South Korea,ASI,96.6,1.224,"48,607,000" 28 | Ukraine,EUR,99.6,1.361,"46,258,200" 29 | Espagne,EUR,96.9,1.468,"45,555,716" 30 | Colombie,LAT,93.4,2.404,"45,012,096" 31 | République-Unie de Tanzanie,AF,66.3,5.52,"42,483,923" 32 | Soudan,AF,59.6,4.058,"41,347,723" 33 | Argentine,LAT,97.7,2.223,"39,882,980" 34 | Kenya,AF,82.8,4.859,"38,765,312" 35 | Pologne,EUR,99.3,1.267,"38,125,759" 36 | Algérie,AF,63.9,2.342,"34,373,426" 37 | Canada,NAM,99,1.579,"33,311,400" 38 | Ouganda,AF,66.8,6.254,"31,656,865" 39 | Maroc,AF,44.1,2.334,"31,605,616" 40 | Iraq,ASI,69.2,3.961,"30,711,152" 41 | Afghanistan,ASI,12.6,6.505,"29,021,099" 42 | Pérou,LAT,84.6,2.53,"28,836,700" 43 | Népal,ASI,45.4,2.823,"28,809,526" 44 | Venezuela,LAT,94.9,2.498,"27,935,000" 45 | Ouzbékistan,ASI,98.9,2.248,"27,313,700" 46 | Malaisie,ASI,89.8,2.508,"27,014,337" 47 | Arabie saoudite,ASI,80.2,3.04,"24,645,686" 48 | Rép. populaire démocratique de Corée,ASI,100,1.854,"23,818,753" 49 | Ghana,AF,59.3,4.22,"23,350,927" 50 | Yémen,ASI,42.8,5.1,"22,917,485" 51 | Mozambique,AF,40.1,4.967,"22,382,533" 52 | Roumanie,EUR,96.9,1.325,"21,513,622" 53 | Côte d'Ivoire,AF,44.3,4.514,"20,591,302" 54 | République arabe syrienne,ASI,77.2,3.173,"20,581,290" 55 | Sri Lanka,ASI,89.1,2.308,"20,156,204" 56 | Madagascar,AF,65.3,4.62,"19,110,941" 57 | Cameroun,AF,67.8,4.541,"19,088,385" 58 | Angola,AF,57,5.637,"18,020,668" 59 | Chili,LAT,98.7,1.926,"16,803,952" 60 | Netherlands,EUR,99,1.747,"16,445,593" 61 | Kazakhstan,ASI,99.5,2.294,"15,674,833" 62 | Burkina Faso,AF,21.6,5.841,"15,233,884" 63 | Malawi,AF,65.8,5.455,"14,846,182" 64 | Niger,AF,15.1,7.069,"14,704,318" 65 | Cambodge,ASI,70.9,2.859,"14,562,008" 66 | Guatemala,LAT,68.7,4.018,"13,686,128" 67 | Equateur,LAT,81.7,2.513,"13,481,424" 68 | Mali,AF,18.2,5.405,"12,705,736" 69 | Zambie,AF,61,5.737,"12,620,219" 70 | Zimbabwe,AF,88.8,3.363,"12,462,879" 71 | Sénégal,AF,33,4.89,"12,211,181" 72 | Grèce,EUR,95.9,1.385,"11,237,094" 73 | Cuba,LAT,99.8,1.505,"11,204,735" 74 | Tchad,AF,21.9,6.081,"10,913,667" 75 | Belgium,EUR,99,1.784,"10,708,433" 76 | Portugal,EUR,92.9,1.378,"10,622,413" 77 | Czech rep,EUR,99,1.45,"10,424,336" 78 | Tunisie,AF,71,1.841,"10,327,800" 79 | Hongrie,EUR,98.9,1.37,"10,038,188" 80 | République dominicaine,LAT,88.3,2.612,"9,952,711" 81 | Guinée,AF,26.4,5.329,"9,833,055" 82 | Rwanda,AF,66.1,5.33,"9,720,694" 83 | Bolivie,LAT,86,3.371,"9,694,113" 84 | Bélarus,EUR,99.7,1.281,"9,680,850" 85 | Sweden,EUR,99,1.871,"9,219,637" 86 | Azerbaïdjan,ASI,99.2,2.153,"8,680,100" 87 | Bénin,AF,28.1,5.378,"8,662,086" 88 | Burundi,AF,59.9,4.45,"8,074,254" 89 | Switzerland,EUR,99,1.46,"7,647,675" 90 | Bulgarie,EUR,97.9,1.436,"7,623,395" 91 | Serbie,EUR,96.2,1.612,"7,350,221" 92 | Honduras,LAT,83.5,3.19,"7,318,789" 93 | Israel,ASI,95.9,2.752,"7,308,800" 94 | Tadjikistan,ASI,99.5,3.35,"6,836,083" 95 | Papouasie-Nouvelle-Guinée,OCE,55.6,4.01,"6,576,822" 96 | Togo,AF,53.7,4.166,"6,458,605" 97 | Jamahiriya arabe libyenne,AF,81.3,2.642,"6,294,181" 98 | Paraguay,LAT,93.5,2.977,"6,237,855" 99 | Rép. démocratique populaire lao,ASI,63.2,3.415,"6,205,341" 100 | El Salvador,LAT,81.4,2.295,"6,133,910" 101 | Jordanie,ASI,88.9,3.019,"5,906,043" 102 | Nicaragua,LAT,77.9,2.683,"5,667,325" 103 | Sierra Leone,AF,28.9,5.165,"5,559,853" 104 | Denmark,EUR,99,1.849,"5,493,621" 105 | Finland,EUR,100,1.836,"5,313,399" 106 | Kirghizistan,ASI,99.1,2.518,"5,277,900" 107 | Turkménistan,ASI,99.3,2.43,"5,043,618" 108 | Erythrée,AF,54.5,4.528,"4,926,877" 109 | Singapour,ASI,91.6,1.263,"4,839,400" 110 | Norway,EUR,100,1.885,"4,768,212" 111 | Costa Rica,LAT,96.2,1.943,"4,519,126" 112 | Emirats arabes unis,ASI,91.5,1.899,"4,484,935" 113 | Croatie,EUR,98,1.442,"4,434,000" 114 | Ireland,EUR,99,1.953,"4,425,675" 115 | République centrafricaine,AF,41.1,4.697,"4,339,263" 116 | Géorgie,ASI,99.7,1.582,"4,307,011" 117 | New Zealand,OCE,99,2.025,"4,268,900" 118 | Liban,ASI,86,1.841,"4,193,758" 119 | Libéria,AF,53,5.011,"3,793,400" 120 | Bosnie-Herzégovine,EUR,95.9,1.212,"3,773,100" 121 | République de Moldova,EUR,97.8,1.502,"3,633,369" 122 | Panama,LAT,92.8,2.516,"3,398,823" 123 | Lituanie,EUR,99.7,1.367,"3,358,115" 124 | Uruguay,LAT,98.5,2.089,"3,334,052" 125 | Mauritanie,AF,49.5,4.388,"3,215,043" 126 | Albanie,EUR,98.7,1.854,"3,143,291" 127 | Arménie,ASI,99.4,1.748,"3,077,087" 128 | Oman,ASI,80.9,2.978,"2,785,361" 129 | Koweït,ASI,93.1,2.152,"2,728,041" 130 | Jamaïque,LAT,90.8,2.362,"2,687,200" 131 | Mongolie,ASI,97.8,1.988,"2,641,216" 132 | Lettonie,EUR,99.8,1.426,"2,266,094" 133 | Namibie,AF,87.7,3.29,"2,129,854" 134 | Lesotho,AF,95.1,3.264,"2,049,429" 135 | L'ex-Rép. yougoslave de Macédoine,EUR,95.4,1.436,"2,041,342" 136 | Slovénie,EUR,99.7,1.393,"2,021,316" 137 | Botswana,AF,83.5,2.822,"1,921,122" 138 | Gambie,AF,34.3,4.969,"1,660,200" 139 | Guinée-Bissau,AF,36.5,5.659,"1,575,446" 140 | Gabon,AF,83.2,3.24,"1,448,159" 141 | Estonie,EUR,99.8,1.693,"1,340,675" 142 | Trinité-et-Tobago,LAT,98.2,1.647,"1,333,388" 143 | Qatar,ASI,90.4,2.36,"1,280,862" 144 | Maurice,AF,84.8,1.792,"1,268,854" 145 | Swaziland,AF,85.6,3.45,"1,167,834" 146 | Chypre,EUR,96.7,1.516,"862,434" 147 | Bahreïn,ASI,89.4,2.233,"775,585" 148 | Bhoutan,ASI,38.7,2.563,"686,789" 149 | Guinée équatoriale,AF,89.1,5.283,"659,197" 150 | Comores,AF,67.8,3.885,"643,571" 151 | "Macao, Chine",ASI,90.7,0.966,"526,178" 152 | Suriname,LAT,88.4,2.373,"515,124" 153 | Cap-Vert,AF,79.3,2.663,"498,672" 154 | Malte,EUR,93.5,1.251,"411,950" 155 | Brunéi Darussalam,ASI,93.3,2.052,"392,280" 156 | Bahamas,LAT,96.5,3.371,"337,668" 157 | Iceland,EUR,99,2.093,"317,414" 158 | Maldives,ASI,98.4,2,"305,027" 159 | Vanuatu,OCE,79.5,3.883,"233,866" 160 | Samoa,OCE,98.5,3.852,"178,869" 161 | Sao Tomé-et-Principe,AF,83.3,3.718,"160,174" 162 | Aruba,LAT,98,1.732,"105,455" 163 | Tonga,ASI,99.1,3.928,"103,566" -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/finch_beaks_1975.csv: -------------------------------------------------------------------------------- 1 | band,species,"Beak length, mm","Beak depth, mm" 2,fortis,9.4,8 9,fortis,9.2,8.3 12,fortis,9.5,7.5 15,fortis,9.5,8 305,fortis,11.5,9.9 307,fortis,11.1,8.6 308,fortis,9.9,8.4 309,fortis,11.5,9.8 311,fortis,10.8,9.2 312,fortis,11.3,9 313,fortis,11.5,9.5 314,fortis,11.5,8.9 315,fortis,9.7,8.8 316,fortis,10.9,9.7 316,fortis,10.9,9.85 320,fortis,10.1,8.9 321,fortis,10.6,8.5 323,fortis,9.6,8.2 324,fortis,10.3,9.3 326,fortis,10.5,9.1 328,fortis,10.5,8.8 329,fortis,10.9,9.4 330,fortis,11.2,9.6 340,fortis,9.4,8.5 341,fortis,10.1,8.1 342,fortis,9.6,8 343,fortis,10.5,9.7 344,fortis,9.9,8.2 345,fortis,9.9,8.4 346,fortis,9.6,7.9 347,fortis,10.7,9.3 348,fortis,11.8,10.5 349,fortis,10.2,9.7 350,fortis,10.9,9.6 352,fortis,9.3,7.7 354,fortis,11.6,9.8 355,fortis,11.2,9.8 356,fortis,10.1,8.5 360,fortis,10.7,9.2 366,fortis,11,10.1 368,fortis,10.8,9 369,fortis,10.2,9 401,fortis,10.8,9.4 402,fortis,10.4,8.8 403,fortis,11.2,9.9 405,fortis,11.4,9.9 410,fortis,10.9,8.9 411,fortis,10.4,9.4 413,fortis,9.7,8.2 414,fortis,10.2,8.2 415,fortis,9.2,8.1 416,fortis,10.1,8.4 417,fortis,11,10.1 418,fortis,10.3,8.6 419,fortis,10.2,8.5 420,fortis,11,9.7 422,fortis,11,10.3 423,fortis,10.1,8.6 424,fortis,10.7,9.3 425,fortis,10.7,8.9 426,fortis,11,9.7 427,fortis,12,10.2 428,fortis,11.6,10.2 450,fortis,9.9,8.5 451,fortis,10.8,8.8 452,fortis,10.5,8.9 453,fortis,10,8.7 454,fortis,9.6,9.3 455,fortis,11,9.7 456,fortis,10.2,9.6 457,fortis,9.7,7.85 458,fortis,11.1,9.6 459,fortis,10.4,9.3 461,fortis,11.1,9.8 462,fortis,10.2,8.8 463,fortis,10.3,9.1 465,fortis,9.9,9 466,fortis,11,10.4 468,fortis,10.8,9 473,fortis,10.5,9.5 474,fortis,10.5,8.7 475,fortis,11.2,9.6 476,fortis,11.2,9.4 477,fortis,11.7,9.5 479,fortis,10.5,8.6 501,fortis,10.5,9.9 502,fortis,11.2,9.4 503,fortis,10,9.1 504,fortis,10.4,8.6 505,fortis,10.8,9.3 506,fortis,11.1,9.2 507,fortis,10.3,8.8 509,fortis,11.1,9.2 510,fortis,9.8,8.3 511,fortis,10.5,8.8 512,fortis,11,9.4 513,fortis,11.2,10.4 514,fortis,9.8,8.5 515,fortis,9.8,7.9 516,fortis,9.8,7.9 517,fortis,10.3,10.1 518,fortis,11.3,9.8 519,fortis,10,8.3 520,fortis,11.1,9.4 521,fortis,10,9 522,fortis,10.3,8.4 524,fortis,10.2,8.7 526,fortis,10.4,9.2 527,fortis,11,9.5 528,fortis,11.5,10.1 529,fortis,11.8,9.8 560,fortis,10.2,8.5 561,fortis,11.7,10.2 563,fortis,10.1,8.6 564,fortis,10.2,9.3 565,fortis,9.8,8.7 566,fortis,10.6,8.9 567,fortis,10,8.4 572,fortis,12.1,10.3 574,fortis,11.1,9.9 576,fortis,10.5,8.9 578,fortis,10,9.1 579,fortis,10.2,8.6 601,fortis,9.7,7.8 602,fortis,10,8.6 603,fortis,10.7,9.5 604,fortis,11,9.5 605,fortis,10.9,10.2 606,fortis,10.5,9.1 607,fortis,10.9,9.7 608,fortis,10.7,9.4 609,fortis,11.9,10.5 610,fortis,10.2,9 611,fortis,10.5,9.8 615,fortis,11.2,10 616,fortis,10.7,9.6 617,fortis,10.3,9.6 618,fortis,11.6,9.9 619,fortis,10.5,9.3 620,fortis,10.9,9.6 621,fortis,9.8,7.6 622,fortis,10.9,9.2 623,fortis,10.3,8.8 624,fortis,11.7,10.1 625,fortis,11,8.9 626,fortis,9.8,9.5 627,fortis,10.4,8.2 628,fortis,10.8,9.7 629,fortis,11,9.8 670,fortis,10.6,9.3 671,fortis,11.3,9.8 672,fortis,10.1,8.8 673,fortis,11.4,10.1 674,fortis,11.8,10.5 675,fortis,9.9,8.6 676,fortis,11,9.7 677,fortis,10.8,10 678,fortis,11.3,9.7 679,fortis,11.1,10.5 680,fortis,11,10.4 681,fortis,10.4,9.2 682,fortis,9.1,8.1 683,fortis,10.8,9.4 684,fortis,10.6,8.9 685,fortis,8.7,8.2 686,fortis,10.7,9.3 687,fortis,10.3,8.6 688,fortis,10.5,9 689,fortis,9.1,7.6 701,fortis,9.5,8.7 702,fortis,10.8,9.8 703,fortis,10.6,9.4 704,fortis,9.9,9.9 705,fortis,11.5,10.1 706,fortis,11.2,9.8 707,fortis,9.7,7.9 708,fortis,12.2,10.8 709,fortis,9.2,7.9 710,fortis,10.5,10 711,fortis,10.5,8.4 712,fortis,10.8,9.5 713,fortis,10.7,8.8 714,fortis,11.8,10.4 715,fortis,9.1,8.1 716,fortis,10.1,9.8 717,fortis,10,8.2 719,fortis,11,9.5 720,fortis,12.2,10.5 721,fortis,11.4,9.7 723,fortis,10.9,9.6 725,fortis,10.6,9.6 726,fortis,9.3,7.9 780,fortis,10.9,10.1 781,fortis,10.6,9.3 785,fortis,11,10.3 786,fortis,9,7.9 787,fortis,11,9.1 788,fortis,10.4,8.9 789,fortis,10.4,8.3 790,fortis,9.6,9.4 801,fortis,10.6,9.5 802,fortis,10.1,8.5 803,fortis,9.7,8.6 804,fortis,9.6,8.5 805,fortis,10.1,8.2 807,fortis,9.9,7.9 808,fortis,11,10 809,fortis,10.9,9.4 810,fortis,9.7,8 811,fortis,10,8.6 812,fortis,10.4,9 813,fortis,11.6,9.9 814,fortis,9.6,8 815,fortis,10.8,9.6 817,fortis,10.9,9.2 818,fortis,10.2,9 818,fortis,10.2,9 819,fortis,10.4,9.2 820,fortis,11,9.5 821,fortis,10.7,9.2 822,fortis,11.1,9.7 823,fortis,10.8,9.1 824,fortis,10.9,9.4 825,fortis,9.9,8.6 826,fortis,11.8,9.8 827,fortis,9.7,8 828,fortis,11.9,10.4 829,fortis,9.6,8.1 830,fortis,10.9,9.9 831,fortis,10.2,8.6 891,fortis,9.9,8 892,fortis,11.3,9 893,fortis,10.9,9.7 894,fortis,9.8,8.1 895,fortis,10.3,8.8 896,fortis,8.8,7.5 897,fortis,11.6,10.2 898,fortis,9.9,8.2 899,fortis,9.9,8.6 900,fortis,9.9,8.7 902,fortis,10.4,8.6 903,fortis,11.2,9.9 904,fortis,10.8,9.5 905,fortis,9.9,8.4 906,fortis,9.9,8.7 907,fortis,10.2,8.2 908,fortis,10.4,9.2 909,fortis,9.4,8.2 910,fortis,10.2,9.2 911,fortis,11,9.3 912,fortis,10.6,8.9 913,fortis,10.5,9 914,fortis,10.4,9.1 915,fortis,10.2,8.8 917,fortis,10.2,8.8 919,fortis,11,9.6 921,fortis,11.1,10.2 922,fortis,9.7,8.2 923,fortis,10.5,8.9 924,fortis,10.9,9 925,fortis,10.7,8.8 926,fortis,11,9.9 927,fortis,10.9,9.3 928,fortis,11.2,9.9 929,fortis,11.5,9.5 930,fortis,10.8,10 931,fortis,10.2,8.9 932,fortis,11,9.8 933,fortis,10.9,9.9 934,fortis,10.5,8.7 936,fortis,10.8,9.2 941,fortis,9.8,8.2 942,fortis,9.7,7.9 943,fortis,10.3,9.1 944,fortis,10.3,8.3 944,fortis,10.3,8.3 945,fortis,11.6,10.8 945,fortis,11.6,10.8 951,fortis,10.9,9.9 952,fortis,10.6,9 954,fortis,11.5,9.3 991,fortis,10.8,9.6 1040,fortis,10.83,9.3 1368,fortis,11.73,10.2 1420,fortis,10.23,8.6 1433,fortis,11.83,10.98 1560,fortis,11.43,10.28 1581,fortis,10.73,9.6 1770,fortis,10.33,9.28 1857,fortis,10.23,9.5 1860,fortis,11.53,9.4 1884,fortis,11.03,9.15 2102,fortis,11.73,9.8 2105,fortis,10.53,9.35 2220,fortis,9.93,8.5 2381,fortis,11.23,10.5 2482,fortis,9.83,8.5 2939,fortis,9.63,8.31 2955,fortis,10.6,9.9 2974,fortis,11.88,10.36 3642,fortis,11.03,10.28 8016,fortis,10.73,8.9 8020,fortis,10.13,8.7 20139,fortis,10.15,9.15 20165,fortis,10.85,10.35 20166,fortis,10.95,8.85 20168,fortis,9.85,8.55 20204,fortis,10.25,8.95 20238,fortis,11.75,10.75 20267,fortis,10.95,10.05 20273,fortis,10.95,10.15 20283,fortis,10.55,8.45 20285,fortis,9.65,8.85 20286,fortis,11.45,10.25 20293,fortis,10.25,9.75 20298,fortis,10.05,8.95 302,scandens,13.9,8.4 304,scandens,14,8.8 306,scandens,12.9,8.4 310,scandens,13.5,8 317,scandens,12.9,7.9 318,scandens,14.6,8.9 319,scandens,13,8.6 322,scandens,14.2,8.5 325,scandens,14,8.9 327,scandens,14.2,9.1 351,scandens,13.1,8.6 353,scandens,15.1,9.8 357,scandens,13.5,8.2 358,scandens,14.4,9 359,scandens,14.9,9.7 361,scandens,12.9,8.6 362,scandens,13,8.2 363,scandens,14.9,9 364,scandens,14,8.4 365,scandens,13.8,8.6 367,scandens,13,8.9 404,scandens,14.75,9.1 406,scandens,13.7,8.3 407,scandens,13.8,8.7 408,scandens,14,9.6 409,scandens,14.6,8.5 412,scandens,15.2,9.1 421,scandens,13.5,9 429,scandens,15.1,9.2 460,scandens,15,9.9 464,scandens,12.8,8.6 467,scandens,14.9,9.2 469,scandens,15.3,8.4 470,scandens,13.4,8.9 471,scandens,14.2,8.5 472,scandens,15.1,10.4 478,scandens,15.1,9.6 508,scandens,14,9.1 523,scandens,13.6,9.3 525,scandens,14,9.3 562,scandens,14,8.8 568,scandens,13.9,8.3 569,scandens,14,8.8 570,scandens,14.9,9.1 571,scandens,15.6,10.1 573,scandens,13.8,8.9 575,scandens,14.4,9.2 577,scandens,12.8,8.5 612,scandens,14.2,10.2 613,scandens,13.4,10.1 614,scandens,14,9.2 718,scandens,14.8,9.7 722,scandens,14.2,9.1 724,scandens,13.5,8.5 727,scandens,13.4,8.2 728,scandens,14.6,9 729,scandens,13.5,9.3 782,scandens,13.7,8 783,scandens,13.9,9.1 784,scandens,13.1,8.1 806,scandens,13.4,8.3 816,scandens,13.8,8.7 890,scandens,13.6,8.8 901,scandens,14,8.6 916,scandens,13.5,8.7 918,scandens,12.8,8 920,scandens,14,8.8 935,scandens,13.4,9 953,scandens,14.9,9.1 1014,scandens,15.54,9.74 1642,scandens,14.63,9.1 1748,scandens,14.73,9.8 1841,scandens,15.73,10.4 1842,scandens,14.83,8.3 2084,scandens,15.94,9.44 2397,scandens,15.14,9.04 8110,scandens,14.23,9 20122,scandens,14.15,9.05 20151,scandens,14.35,9.65 20188,scandens,14.95,9.45 20210,scandens,13.95,8.65 20223,scandens,14.05,9.45 20225,scandens,14.55,9.45 20252,scandens,14.05,9.05 20255,scandens,14.45,8.75 20266,scandens,15.05,9.45 20279,scandens,13.25,8.35 -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/finch_beaks_2012.csv: -------------------------------------------------------------------------------- 1 | band,species,blength,bdepth 19022,fortis,10,8.5 19028,fortis,12.5,8.9 19032,fortis,9.3,7.5 19041,fortis,10.3,9.6 19044,fortis,11,9.2 19048,fortis,10.1,8.2 19072,fortis,9.6,7.8 19082,fortis,10.9,8.6 19104,fortis,10.3,8.4 19114,fortis,9.8,7.7 19121,fortis,10.1,8 19126,fortis,10.4,8.7 19146,fortis,9.6,8.1 19164,fortis,10.6,8.8 19174,fortis,10.6,9.4 19203,fortis,11.9,10 19210,fortis,11.3,9.6 19217,fortis,11.3,9.6 19224,fortis,9.7,8.1 19226,fortis,9.7,7.5 19252,fortis,10.1,8.4 19263,fortis,10,7.9 19274,fortis,10,8.3 19280,fortis,10,8.9 19288,fortis,11.5,9.1 19328,fortis,9.5,7.7 19349,fortis,11.2,8.3 19362,fortis,10.7,8.6 19372,fortis,10,8.4 19382,fortis,9.8,7.7 19384,fortis,10.9,9.1 19392,fortis,9.2,7.7 19394,fortis,10.2,9 19422,fortis,11.3,10.2 19439,fortis,10.3,8.1 19461,fortis,10.7,8.6 19482,fortis,10,8.4 19502,fortis,9.7,8.1 19511,fortis,9.9,8 19536,fortis,10.7,8.3 19563,fortis,11,10.3 19568,fortis,9.7,8 19602,fortis,10.5,8.8 19604,fortis,11.7,9 19614,fortis,10.8,9.3 19623,fortis,9.1,7.6 19627,fortis,10.9,8.2 19642,fortis,12.2,10 19649,fortis,10.9,8.2 19654,fortis,10.7,8.2 19674,fortis,10.4,8.3 19682,fortis,9.7,7.8 19712,fortis,10.3,8 19734,fortis,9.8,8.4 19746,fortis,10.6,9.3 19749,fortis,10.5,8.9 19774,fortis,12.5,9.7 19782,fortis,9.2,7.6 19815,fortis,10.1,9 19820,fortis,10.6,8.6 19821,fortis,11.5,8.9 19829,fortis,10.8,8.6 19832,fortis,10.5,8.8 19835,fortis,10.1,8.5 19840,fortis,10.7,9.2 19849,fortis,9.6,8 19874,fortis,10.7,9.4 19878,fortis,10.1,7.7 19889,fortis,10,8.4 19914,fortis,10,8.5 19921,fortis,10.4,9 19922,fortis,10.4,9 19928,fortis,11.7,9.3 19932,fortis,10.6,8.7 19942,fortis,11.5,8.1 19946,fortis,10.7,8.7 19947,fortis,10.4,7.9 19952,fortis,10.1,7.7 19974,fortis,10.8,8.4 19993,fortis,11.5,9.25 19994,fortis,11.1,8.1 21049,fortis,9.9,8.3 21052,fortis,10.5,8.5 21080,fortis,12.2,9.9 21082,fortis,10.9,8.4 21087,fortis,12.9,9.9 21088,fortis,9.7,7.2 21089,fortis,9.7,8.2 21090,fortis,10,8.2 21129,fortis,10.1,8.3 21160,fortis,10.2,8.4 21161,fortis,9.6,7.5 21162,fortis,9.9,8.2 21165,fortis,10.6,8.6 21169,fortis,9.8,8.2 21191,fortis,11.1,8.8 21244,fortis,10,8.5 21247,fortis,10.9,8.1 21249,fortis,10,8.3 21258,fortis,10.6,8.5 21259,fortis,10.7,8.1 21261,fortis,9.4,7.3 21262,fortis,10.1,8 21265,fortis,11.8,10.2 21266,fortis,12.2,11.1 21272,fortis,12.9,9.9 21273,fortis,10.1,8.7 21276,fortis,10.1,8.3 21277,fortis,9,7.8 21282,fortis,11.7,9.9 21283,fortis,10.9,10.3 21287,fortis,10.4,8.4 21293,fortis,12.7,8.7 21294,fortis,10.5,9.8 21296,fortis,9.6,8.7 21298,fortis,10.6,9 21299,fortis,10.4,7.8 21341,fortis,10.5,8.5 21343,fortis,10.1,8.2 21349,fortis,10.6,9.2 22000,fortis,10.6,9 19026,scandens,14.3,9.4 19028,scandens,12.5,8.9 19029,scandens,13.7,9.5 19094,scandens,13.8,11 19122,scandens,12,8.7 19125,scandens,13,8.4 19129,scandens,13,9.1 19172,scandens,13.6,8.7 19182,scandens,12.8,10.2 19212,scandens,13.6,9.6 19214,scandens,12.95,8.85 19244,scandens,13.1,8.8 19251,scandens,13.4,9.5 19260,scandens,13.9,9.2 19270,scandens,12.3,9 19278,scandens,14,9.8 19289,scandens,12.5,9.3 19299,scandens,12.3,9 19312,scandens,13.9,10.2 19326,scandens,13.1,7.7 19343,scandens,12.5,9 19374,scandens,13.9,9.5 19401,scandens,13.7,9.4 19406,scandens,12,8 19408,scandens,14.4,8.9 19426,scandens,13.5,9.4 19430,scandens,13.8,9.5 19433,scandens,13,8 19438,scandens,14.9,10 19452,scandens,12.5,8.95 19466,scandens,12.3,8.2 19469,scandens,12.8,8.8 19486,scandens,13.4,9.2 19492,scandens,13.8,9.4 19493,scandens,13.5,9.5 19494,scandens,13.5,8.1 19495,scandens,13.4,9.5 19496,scandens,12.3,8.4 19497,scandens,14.35,9.3 19510,scandens,13.2,9.3 19513,scandens,13.8,9.6 19518,scandens,14.6,9.2 19526,scandens,14.3,10 19527,scandens,13.8,8.9 19528,scandens,13.6,10.5 19543,scandens,12.9,8.9 19553,scandens,13,8.6 19554,scandens,13.5,8.8 19573,scandens,13.2,9.15 19592,scandens,13.7,9.5 19594,scandens,13.1,9.1 19597,scandens,13.2,10.2 19598,scandens,12.6,8.4 19599,scandens,13,10 19619,scandens,13.9,10.2 19622,scandens,13.2,9.3 19652,scandens,15,10.8 19653,scandens,13.37,8.3 19664,scandens,11.4,7.8 19692,scandens,13.8,9.8 19720,scandens,13,7.9 19740,scandens,13,8.9 19747,scandens,13.1,7.7 19766,scandens,12.8,8.9 19783,scandens,13.3,9.4 19844,scandens,13.5,9.4 19848,scandens,12.4,8.5 19852,scandens,13.1,8.5 19854,scandens,14,9.6 19855,scandens,13.5,10.2 19868,scandens,11.8,8.8 19882,scandens,13.7,9.5 19900,scandens,13.2,9.3 19910,scandens,12.2,9 19936,scandens,13,9.2 19940,scandens,13.1,8.7 19941,scandens,14.7,9 19951,scandens,13.7,9.1 19955,scandens,13.5,8.7 19956,scandens,13.3,9.4 21040,scandens,14.1,9.8 21041,scandens,12.5,8.6 21045,scandens,13.7,10.6 21047,scandens,14.6,9 21053,scandens,14.1,9.5 21057,scandens,12.9,8.1 21070,scandens,13.9,9.3 21081,scandens,13.4,9.6 21092,scandens,13,8.5 21093,scandens,12.7,8.2 21106,scandens,12.1,8 21109,scandens,14,9.5 21111,scandens,14.9,9.7 21113,scandens,13.9,9.9 21131,scandens,12.9,9.1 21135,scandens,14.6,9.5 21136,scandens,14,9.8 21159,scandens,13,8.4 21167,scandens,12.7,8.3 21176,scandens,14,9.6 21248,scandens,14.1,9.4 21253,scandens,14.1,10 21255,scandens,13,8.9 21256,scandens,13.5,9.1 21257,scandens,13.4,9.8 21260,scandens,13.9,9.3 21263,scandens,13.1,9.9 21267,scandens,12.9,8.9 21268,scandens,14,8.5 21270,scandens,14,10.6 21271,scandens,14.1,9.3 21278,scandens,14.7,8.9 21279,scandens,13.4,8.9 21280,scandens,13.8,9.7 21281,scandens,13.4,9.8 21285,scandens,13.8,10.5 21286,scandens,12.4,8.4 21288,scandens,14.1,10 21289,scandens,12.9,9 21290,scandens,13.9,8.7 21291,scandens,14.3,8.8 21292,scandens,13.2,8.4 21295,scandens,14.2,9.3 21297,scandens,13,9.8 21340,scandens,14.6,8.9 21342,scandens,13.1,9.8 21347,scandens,15.2,9.1 -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/fortis_beak_depth_heredity.csv: -------------------------------------------------------------------------------- 1 | Mid-offspr,Male BD,Female BD 2 | 10.7,10.9,9.3 3 | 9.78,10.7,8.4 4 | 9.48,10.7,8.1 5 | 9.6,10.7,9.8 6 | 10.27,9.85,10.4 7 | 9.5,9.8,9.6 8 | 9,9.9,8.2 9 | 7.46,9.3,5.5 10 | 7.65,9.4,8.6 11 | 8.63,9.4,7.9 12 | 9.81,9.4,9.85 13 | 9.4,10.1,9.7 14 | 9.48,10.1,9 15 | 8.75,8.3,9.8 16 | 7.6,8.7,8 17 | 10,10.1,10.1 18 | 10.09,10.1,10.1 19 | 9.74,9.7,10.1 20 | 9.64,9.7,10.75 21 | 8.49,11.8,8.2 22 | 10.15,10.4,10.7 23 | 10.28,10.5,10.4 24 | 9.2,10.3,8.1 25 | 10.01,10.3,10.1 26 | 9.03,8.6,9.3 27 | 9.94,9.5,10.6 28 | 10.5,10,10.4 29 | 9.7,10,9 30 | 10.02,9.1,10.75 31 | 10.04,11.2,8.7 32 | 9.43,10,10.1 33 | 8.1,9.6,7.9 34 | 9.5,10.3,8.1 35 | 9.9,10.5,9.8 36 | 9.48,11,8.6 37 | 10.18,11,10.4 38 | 10.16,11,10 39 | 9.08,9,10.1 40 | 10.39,10.6,10.5 41 | 9.9,10.6,10.35 42 | 8.4,8.1,9.2 43 | 10.6,10.2,11.2 44 | 8.75,8.6,9.6 45 | 9.46,9.4,9.4 46 | 9.6,10.3,10.3 47 | 9.6,10.3,9 48 | 9.95,10.3,8.7 49 | 10.05,9.9,9.5 50 | 10.16,10.3,10.75 51 | 10.1,10.6,9.3 52 | 9.83,10.6,9.6 53 | 9.46,9.5,10 54 | 9.7,10.4,9.7 55 | 9.82,10.4,9.4 56 | 10.34,10,10 57 | 8.02,10,8.2 58 | 9.65,9.1,9.8 59 | 9.87,9.1,9.4 60 | 9,9.9,9.1 61 | 11.14,9.9,10.1 62 | 9.25,10.1,10.95 63 | 8.14,10.1,9.7 64 | 10.23,10.7,10.1 65 | 8.7,9.3,8.6 66 | 9.8,8.3,10.5 67 | 10.54,11.4,10.5 68 | 11.19,11.4,10.1 69 | 9.85,11.4,8.8 70 | 8.1,8.1,8 71 | 9.3,8.1,10.1 72 | 9.34,9.3,9.8 73 | 9.19,9.3,8.8 74 | 9.52,11.2,9.2 75 | 9.36,10.8,9.2 76 | 8.8,10.8,10.3 77 | 8.6,11.1,10.4 78 | 8,8.6,7.75 79 | 8.5,9.4,10 80 | 8.3,9,8.6 81 | 10.38,11.3,10.2 82 | 8.54,8.9,9.7 83 | 8.94,9.8,9.6 84 | 10,9.8,9.4 85 | 9.76,9.9,9.6 86 | 9.45,9.9,9.3 87 | 9.89,11.6,9.3 88 | 10.9,11.6,10.4 89 | 9.91,11.6,10.1 90 | 9.39,11.6,8.7 91 | 9.86,10.9,9.8 92 | 9.74,10.8,10 93 | 9.9,10.8,9.1 94 | 9.09,10.1,8.1 95 | 9.69,10.1,10.1 96 | 10.24,9.2,10.5 97 | 8.9,8.95,10.3 98 | 9.67,8.95,10 99 | 8.93,9.3,8.7 100 | 9.3,9.3,9.2 101 | 8.67,9.3,8.9 102 | 9.15,10.3,8.2 103 | 9.23,9.7,8.7 104 | 9.59,9.7,10.2 105 | 9.03,10.1,7.2 106 | 9.58,10.1,9.5 107 | 8.97,9.3,9.5 108 | 8.57,9.3,8.7 109 | 8.47,9.2,7.9 110 | 8.71,9.2,8.3 111 | 9.21,9.3,10 112 | 9.13,9.3,8.6 113 | 8.5,9.9,8.4 114 | 9.58,10.85,8.85 115 | 9.21,10.85,9.6 116 | 9.6,10.85,8.8 117 | 9.32,8.8,11.2 118 | 8.7,10.45,8.4 119 | 10.46,10.8,10 120 | 9.29,9,10.75 121 | 9.24,9,8.9 122 | 9.45,9,8.8 123 | 9.35,9.8,8.9 124 | 10.19,9.55,11.3 125 | 9.91,10,10 126 | 9.18,9.6,10.75 127 | 9.89,9.6,10.15 128 | 9.6,9.6,10.15 129 | 10.3,8.9,9.4 130 | 9.45,9.5,9.4 131 | 8.79,9.5,8.55 132 | 9.2,9.5,9.9 133 | 8.8,9.9,9.5 134 | 9.69,10.3,9.8 135 | 10.61,10.3,10.3 136 | 9.6,9.6,9.6 137 | 9.9,10.6,9.4 138 | 9.26,10.6,9 139 | 10.2,9.6,10.5 140 | 8.79,8.6,8.9 141 | 9.28,11.8,9.3 142 | 8.83,10.8,8.6 143 | 9.76,10.8,9.2 144 | 10.2,9.7,10 145 | 9.43,9.7,9.9 146 | 9.4,9.7,8.65 147 | 9.9,9.7,9.6 148 | 9.5,9.8,9.3 149 | 8.95,9.8,10 150 | 9.98,12.7,10.4 151 | 9.72,12.7,9.9 152 | 9.86,11.4,9.4 153 | 11.1,11.4,10.2 154 | 9.14,11.4,8.2 155 | 10.49,10.3,10.6 156 | 9.75,10.4,9.6 157 | 10.35,11.1,10.4 158 | 9.73,8.8,9.9 159 | 9.83,11.5,10 160 | 8.69,9.75,8.6 161 | 9.58,8.9,10.4 162 | 8.42,8.9,8.7 163 | 9.25,10.9,10.2 164 | 10.12,10.9,10.45 165 | 9.31,10.6,9.3 166 | 9.99,8.6,10.5 167 | 8.59,8.6,9.05 168 | 8.74,10.4,9 169 | 8.79,9.8,9.9 170 | 9.6,9.6,10 171 | 9.52,9.4,9.7 172 | 8.93,9.85,8.7 173 | 10.23,10.2,10.45 174 | 9.35,9.9,8.4 175 | 9.35,9.2,9.5 176 | 9.09,8.7,9.6 177 | 9.04,9.8,9.5 178 | 9.75,10.55,10.6 179 | 10.5,10.55,9.4 180 | 9.09,9.7,9.4 181 | 9.05,9.7,8.7 182 | 9.54,9.7,10.15 183 | 9.3,9.7,8.7 184 | 9.06,9.7,8.9 185 | 8.7,9.05,8.5 186 | 9.32,9.05,9.6 187 | 8.4,9.05,9.3 188 | 8.67,9.05,9.6 189 | 8.6,9.05,8.9 190 | 9.53,10.3,9.1 191 | 9.77,10.3,8.7 192 | 9.65,10.3,10.15 193 | 9.43,10.05,10 194 | 8.35,7.5,8.9 195 | 8.26,6.4,10 196 | 9.5,9.8,9.3 197 | 8.6,9.8,8.3 198 | 9.57,9.8,9.4 199 | 9.14,9.3,9.9 200 | 10.79,10.3,10 201 | 8.91,10.3,9.45 202 | 9.93,12.37,8.6 203 | 10.7,12.37,10.6 204 | 9.3,12.37,9.6 205 | 9.93,9.6,9.8 206 | 9.51,9,10.3 207 | 9.44,9,9.7 208 | 10.05,9.6,10.5 209 | 10.13,10.9,9.3 210 | 9.24,9.8,10 211 | 8.21,9.8,8.1 212 | 8.9,9.8,8.8 213 | 9.34,9.2,10.7 214 | 8.77,9.9,9 215 | 9.4,8.4,10.6 216 | 8.82,8.4,8.5 217 | 8.83,8.4,9.2 218 | 8.6,8.4,8.65 219 | 9.5,9.6,9.15 220 | 10.2,10.6,9.8 221 | 8.09,7.65,7.6 222 | 9.07,7.65,9.1 223 | 9.29,9.7,8.8 224 | 9.1,9.9,8.9 225 | 10.19,10.6,10.5 226 | 9.25,8.9,8.9 227 | 8.98,8.9,8.7 228 | 9.02,8.9,9.1 229 | 8.6,8.9,8.25 230 | 8.25,9.15,8 231 | 8.7,10.3,8.9 232 | 9.9,10.3,8.45 233 | 9.65,10.3,8.9 234 | 9.45,9.9,10 235 | 9.38,10.1,9.1 236 | 10.4,10.4,10 237 | 9.96,10.3,9.4 238 | 9.46,10.05,9.2 239 | 8.26,10.05,8 240 | 10.05,10.05,10.7 241 | 8.92,10.6,9.9 242 | 9.5,9.9,8.7 243 | 9.43,9.9,9.1 244 | 8.97,9.9,9.2 245 | 8.44,9.2,7.9 246 | 8.92,9.2,8.9 247 | 10.3,11,8.8 248 | 8.4,10,9.6 249 | 9.37,10,9.5 250 | 9.91,11.4,9.1 251 | 10,9,9.2 252 | 9.21,10,9.3 253 | 9.95,10,10.6 254 | 8.84,10,7.8 255 | 9.82,10,9.9 256 | 9.5,8.9,10.1 257 | 10.29,9.7,9.85 258 | 8.4,10.65,8.2 259 | 8.31,6.7,8.8 260 | 9.29,6.7,8.4 261 | 8.86,8.6,9.6 262 | 9.4,10.6,8.6 263 | 9.62,9.95,9.2 264 | 8.62,9.5,8.4 265 | 8.3,10.2,9.1 266 | 9.8,10.3,9 267 | 8.48,11,8.3 268 | 9.61,10.5,8.55 269 | 9.5,10.5,9.2 270 | 9.37,9.3,8.8 271 | 8.74,9.2,9.4 272 | 9.31,9.2,8.6 273 | 9.5,9.2,9.7 274 | 9.49,9.7,10.3 275 | 9.74,9.7,10 276 | 9.2,9.7,8.8 277 | 9.24,10,10.2 278 | 9.7,9.9,8.35 279 | 9.64,9.9,9.4 280 | 9.2,9.9,8.3 281 | 7.5,6.4,9.7 282 | 7.5,6.4,8.4 283 | 8.7,7.7,10 284 | 8.31,7.7,10.45 285 | 9,9.7,8.3 286 | 9.74,9.1,10.3 287 | 9.31,8.9,8.5 288 | 10.5,8.9,10 289 | 9.3,9.4,10 290 | 8.12,9.4,7.3 291 | 9.34,8.6,9.1 292 | 9.72,9.8,9.6 293 | 9,9.8,9.1 294 | 9.65,10.6,10 295 | 9.9,9.7,10.3 296 | 10,10.1,10.8 297 | 10.1,10.1,8.8 298 | 8,8.5,8.5 299 | 9.07,7.7,8.9 300 | 9.75,9.4,10.6 301 | 9.33,10.1,8.35 302 | 8.11,8.9,10.6 303 | 9.36,9.1,9.2 304 | 9.74,10.2,8.9 305 | 9.9,9.5,8.5 306 | 9.23,9.1,9.45 307 | 9.7,9.5,9.2 308 | 8.2,9.5,8.4 309 | 9.35,9.85,9.9 310 | 9.49,7.9,9 311 | 9.34,7.9,9.3 312 | 8.87,8.6,10.8 313 | 9.03,8.6,8.5 314 | 9.07,8.1,10 315 | 9.43,10.3,8.9 316 | 8.2,8.5,8.8 317 | 9.19,9.2,9.2 318 | 9,9.2,8.7 319 | 9.2,10,9.2 320 | 9.06,9.3,9 321 | 9.81,9.1,9.7 322 | 8.89,9,8.9 323 | 9.4,11.5,8.4 324 | 10.45,11.4,9.7 325 | 9.64,10.3,9.1 326 | 9.03,8.9,8.8 327 | 8.71,8.9,8.7 328 | 9.91,9.6,10.4 329 | 8.33,9.6,8.5 330 | 8.2,7.2,9.2 331 | 7.83,7.2,9 332 | 7.14,7.2,7.3 333 | 8.91,7.2,9.4 334 | 9.18,8.9,9.4 335 | 8.8,8.9,8.3 336 | 9.9,11,8 337 | 7.73,7,9.1 338 | 9.25,9.85,9 339 | 8.7,9.8,8.8 340 | 9.5,9.8,9.8 341 | 9.3,10.2,8.4 342 | 9.05,10.2,9.5 343 | 10.18,9.6,9.4 344 | 8.85,8.3,9 345 | 9.24,9.5,10.15 346 | 9.15,9.5,8.5 347 | 9.98,10.9,10 348 | 8.77,9.5,8.7 349 | 9.8,10,9.1 350 | 8.65,8.5,9.6 351 | 10,8.8,11.2 352 | 8.81,9.8,8.9 353 | 8.01,8.8,7.95 354 | 7.9,8.8,7.8 355 | 9.41,8.9,8.7 356 | 10.18,9.8,10.4 357 | 9.55,9.6,9.4 358 | 9.08,10.4,9.1 359 | 8.4,10.4,9.8 360 | 9.75,9.45,9.7 361 | 8.9,9.45,9.4 362 | 9.07,10.4,8.9 363 | 9.35,8.45,9 364 | 8.9,9.5,8.55 365 | 8.19,9.7,7.3 366 | 8.65,9.6,8.3 367 | 9.19,8.7,9.9 368 | 8.9,10.4,7.3 369 | 9.28,9.6,8.3 370 | 10.58,9.1,10.5 371 | 9,9.2,9.8 372 | 9.4,8.4,8.9 373 | 8.91,9.9,8.3 374 | 9.93,9.1,9.7 375 | 10,7.95,9 376 | 9.37,9.6,9.1 377 | 7.4,8.5,7.4 378 | 9,8.8,9.9 379 | 8.8,7.8,9.35 380 | 9.18,9,9.1 381 | 8.3,7.9,8.45 382 | 10.08,9.9,9.8 383 | 7.9,8.2,7.5 384 | 9.96,9.3,10.4 385 | 10.4,10.1,10.1 386 | 9.65,9.4,9.3 387 | 8.8,9.4,8.3 388 | 8.65,9.1,8.4 389 | 9.7,9.9,9.35 390 | 9.23,9.5,9 391 | 9.43,9.3,9.8 392 | 9.93,10.35,10.3 393 | 8.47,9.8,7.3 394 | 9.55,9.8,9.55 395 | 9.28,9.5,8.8 396 | 8.85,9.6,8.4 397 | 8.9,10.1,9.2 398 | 8.75,8.5,8.7 399 | 8.63,9.25,8.35 400 | 9,8.7,9.3 401 | 9.43,10.3,9.6 402 | 8.28,8.9,7.9 403 | 9.23,9.5,9.2 404 | 10.4,10.1,10.5 405 | 9,8.3,9.8 406 | 9.8,9.45,10.5 407 | 9.77,10.8,9.15 408 | 8.97,8.5,8.8 409 | 8.37,8.8,8.65 410 | 7.7,7.4,9 411 | 7.9,7.4,8.3 412 | 9.5,8.85,8.7 413 | 8.2,9.3,7.7 414 | 8.8,9.4,9.4 -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/frog_tongue.csv: -------------------------------------------------------------------------------- 1 | # These data are from the paper, 2 | # Kleinteich and Gorb, Sci. Rep., 4, 5225, 2014. 3 | # It was featured in the New York Times. 4 | # http://www.nytimes.com/2014/08/25/science/a-frog-thats-a-living-breathing-pac-man.html 5 | # 6 | # The authors included the data in their supplemental information. 7 | # 8 | # Importantly, the ID refers to the identifites of the frogs they tested. 9 | # I: adult, 63 mm snout-vent-length (SVL) and 63.1 g body weight, 10 | # Ceratophrys cranwelli crossed with Ceratophrys cornuta 11 | # II: adult, 70 mm SVL and 72.7 g body weight, 12 | # Ceratophrys cranwelli crossed with Ceratophrys cornuta 13 | # III: juvenile, 28 mm SVL and 12.7 g body weight, Ceratophrys cranwelli 14 | # IV: juvenile, 31 mm SVL and 12.7 g body weight, Ceratophrys cranwelli 15 | date,ID,trial number,impact force (mN),impact time (ms),impact force / body weight,adhesive force (mN),time frog pulls on target (ms),adhesive force / body weight,adhesive impulse (N-s),total contact area (mm2),contact area without mucus (mm2),contact area with mucus / contact area without mucus,contact pressure (Pa),adhesive strength (Pa) 16 | 2013_02_26,I,3,1205,46,1.95,-785,884,1.27,-0.290,387,70,0.82,3117,-2030 17 | 2013_02_26,I,4,2527,44,4.08,-983,248,1.59,-0.181,101,94,0.07,24923,-9695 18 | 2013_03_01,I,1,1745,34,2.82,-850,211,1.37,-0.157,83,79,0.05,21020,-10239 19 | 2013_03_01,I,2,1556,41,2.51,-455,1025,0.74,-0.170,330,158,0.52,4718,-1381 20 | 2013_03_01,I,3,493,36,0.80,-974,499,1.57,-0.423,245,216,0.12,2012,-3975 21 | 2013_03_01,I,4,2276,31,3.68,-592,969,0.96,-0.176,341,106,0.69,6676,-1737 22 | 2013_03_05,I,1,556,43,0.90,-512,835,0.83,-0.285,359,110,0.69,1550,-1427 23 | 2013_03_05,I,2,1928,46,3.11,-804,508,1.30,-0.285,246,178,0.28,7832,-3266 24 | 2013_03_05,I,3,2641,50,4.27,-690,491,1.12,-0.239,269,224,0.17,9824,-2568 25 | 2013_03_05,I,4,1897,41,3.06,-462,839,0.75,-0.328,266,176,0.34,7122,-1733 26 | 2013_03_12,I,1,1891,40,3.06,-766,1069,1.24,-0.380,408,33,0.92,4638,-1879 27 | 2013_03_12,I,2,1545,48,2.50,-715,649,1.15,-0.298,141,112,0.21,10947,-5064 28 | 2013_03_12,I,3,1307,29,2.11,-613,1845,0.99,-0.768,455,92,0.80,2874,-1348 29 | 2013_03_12,I,4,1692,31,2.73,-677,917,1.09,-0.457,186,129,0.31,9089,-3636 30 | 2013_03_12,I,5,1543,38,2.49,-528,750,0.85,-0.353,153,148,0.03,10095,-3453 31 | 2013_03_15,I,1,1282,31,2.07,-452,785,0.73,-0.253,290,105,0.64,4419,-1557 32 | 2013_03_15,I,2,775,34,1.25,-430,837,0.70,-0.276,257,124,0.52,3019,-1677 33 | 2013_03_15,I,3,2032,60,3.28,-652,486,1.05,-0.257,147,134,0.09,13784,-4425 34 | 2013_03_15,I,4,1240,34,2.00,-692,906,1.12,-0.317,364,260,0.28,3406,-1901 35 | 2013_03_15,I,5,473,40,0.76,-536,1218,0.87,-0.382,259,168,0.35,1830,-2073 36 | 2013_03_19,II,1,1612,18,3.79,-655,3087,1.54,-0.385,348,15,0.96,4633,-1881 37 | 2013_03_19,II,2,605,55,1.42,-292,1261,0.69,-0.294,248,24,0.90,2441,-1177 38 | 2013_03_19,II,3,327,51,0.77,-246,1508,0.58,-0.282,130,34,0.74,2517,-1894 39 | 2013_03_19,II,4,946,59,2.23,-245,1841,0.58,-0.340,106,26,0.76,8893,-2301 40 | 2013_03_21,II,1,541,33,1.27,-553,3126,1.30,-0.432,276,16,0.94,1959,-2004 41 | 2013_03_21,II,2,1539,43,3.62,-664,741,1.56,-0.046,85,24,0.72,18073,-7802 42 | 2013_03_21,II,3,529,28,1.24,-261,2482,0.61,-0.414,325,33,0.90,1627,-803 43 | 2013_03_21,II,4,628,31,1.48,-691,998,1.63,-0.071,242,67,0.72,2600,-2860 44 | 2013_03_25,II,1,1453,72,3.42,-92,1652,0.22,-0.008,136,0,1.00,10645,-678 45 | 2013_03_25,II,2,297,42,0.70,-566,936,1.33,-0.084,126,4,0.97,2367,-4506 46 | 2013_03_25,II,3,703,33,1.65,-223,2152,0.52,-0.209,237,8,0.97,2972,-942 47 | 2013_03_25,II,4,269,57,0.63,-512,189,1.20,-0.055,29,28,0.03,9279,-17652 48 | 2013_03_28,II,1,751,39,1.77,-227,1195,0.53,-0.026,206,0,1.00,3647,-1101 49 | 2013_03_28,II,2,245,21,0.58,-573,1466,1.35,-0.215,190,46,0.76,1288,-3014 50 | 2013_04_03,II,1,1182,28,2.78,-522,1197,1.23,-0.118,281,0,1.00,4213,-1860 51 | 2013_04_03,II,2,515,29,1.21,-599,1486,1.41,-0.226,217,0,1.00,2369,-2757 52 | 2013_04_08,II,1,435,26,1.02,-364,1017,0.86,-0.211,189,89,0.53,2302,-1927 53 | 2013_04_08,II,2,383,31,0.90,-469,974,1.10,-0.260,221,72,0.67,1737,-2129 54 | 2013_04_08,II,3,457,15,1.08,-844,780,1.99,-0.328,171,106,0.38,2665,-4925 55 | 2013_04_12,II,1,730,42,1.72,-648,786,1.52,-0.121,142,43,0.70,5149,-4573 56 | 2013_05_27,III,1,614,88,4.94,-94,683,0.76,-0.001,97,15,0.83,6326,-967 57 | 2013_05_27,III,2,414,143,3.33,-163,245,1.31,-0.032,108,10,0.60,3824,-1507 58 | 2013_05_27,III,3,324,105,2.61,-172,619,1.38,-0.079,55,23,0.37,5946,-3149 59 | 2013_06_11,III,1,776,35,6.24,-225,1823,1.81,-0.132,124,17,0.77,6272,-1818 60 | 2013_06_11,III,2,611,29,4.91,-301,918,2.42,-0.155,128,43,0.02,4770,-2354 61 | 2013_06_11,III,3,544,16,4.38,-93,1351,0.75,-0.110,43,34,0.71,12699,-2181 62 | 2013_06_14,III,1,538,38,4.32,-131,1790,1.05,-0.036,130,74,1.00,4130,-1005 63 | 2013_06_14,III,2,579,31,4.66,-289,1006,2.33,-0.073,113,4,0.48,5110,-2555 64 | 2013_06_18,III,1,806,29,6.49,-104,883,0.84,-0.055,115,55,0.66,6993,-902 65 | 2013_06_18,III,2,459,32,3.70,-229,1218,1.85,-0.137,89,6,0.95,5165,-2580 66 | 2013_06_18,III,3,458,30,3.69,-259,910,2.08,-0.194,91,88,0.15,5048,-2855 67 | 2013_06_18,III,4,626,16,5.04,-231,550,1.86,-0.042,82,23,0.01,7633,-2819 68 | 2013_06_21,III,1,621,27,4.99,-267,2081,2.14,-0.183,120,58,0.90,5152,-2213 69 | 2013_06_21,III,2,544,30,4.38,-178,376,1.43,-0.034,19,17,0.05,28641,-9364 70 | 2013_06_21,III,3,535,35,4.30,-123,289,0.99,-0.029,21,29,0.05,25471,-5843 71 | 2013_06_21,III,4,385,39,3.09,-151,607,1.22,-0.082,31,126,0.03,12409,-4882 72 | 2013_06_26,III,1,401,36,3.23,-127,2932,1.02,-0.215,142,12,0.86,2835,-896 73 | 2013_06_26,III,2,614,34,4.94,-372,680,2.99,-0.140,72,1,0.42,8475,-5136 74 | 2013_06_26,III,3,665,40,5.35,-236,685,1.90,-0.118,129,0,0.16,5171,-1834 75 | 2013_06_26,III,4,488,34,3.93,-390,1308,3.14,-0.208,112,58,0.39,4376,-3492 76 | 2013_05_27,IV,2,172,26,1.28,-456,462,3.40,-0.050,133,0,0.88,1297,-3440 77 | 2013_05_27,IV,3,142,20,1.05,-193,250,1.44,-0.047,57,74,0.83,2498,-3400 78 | 2013_05_27,IV,4,37,55,0.28,-236,743,1.76,-0.119,51,44,0.54,735,-4647 79 | 2013_05_30,IV,1,453,38,3.37,-225,844,1.68,-0.110,142,108,0.48,3177,-1581 80 | 2013_05_30,IV,2,355,31,2.64,-217,728,1.61,-0.023,174,39,0.98,2037,-1245 81 | 2013_05_30,IV,3,22,33,0.17,-161,472,1.20,-0.052,56,4,0.02,397,-2866 82 | 2013_06_03,IV,1,502,74,3.74,-139,959,1.04,-0.089,65,77,0.91,7713,-2141 83 | 2013_06_11,IV,1,273,26,2.03,-264,844,1.97,-0.160,124,81,0.29,2205,-2136 84 | 2013_06_11,IV,2,720,27,5.36,-342,1515,2.55,-0.226,137,0,0.83,5259,-2497 85 | 2013_06_11,IV,3,582,33,4.34,-231,279,1.72,-0.033,60,4,0.03,9705,-3847 86 | 2013_06_11,IV,4,198,23,1.47,-209,1427,1.55,-0.151,110,69,0.84,1793,-1889 87 | 2013_06_14,IV,1,198,6,1.47,-292,2874,2.17,-0.232,145,50,0.99,1369,-2018 88 | 2013_06_18,IV,1,597,29,4.44,-339,4251,2.53,-0.281,191,12,1.00,3116,-1772 89 | 2013_06_18,IV,2,516,31,3.84,-371,626,2.76,-0.094,83,18,0.12,6184,-4447 90 | 2013_06_18,IV,3,815,34,6.07,-331,1254,2.47,-0.077,151,20,0.71,5386,-2190 91 | 2013_06_18,IV,4,402,38,3.00,-302,986,2.25,-0.122,117,30,0.07,3446,-2591 92 | 2013_06_21,IV,1,605,39,4.50,-216,1627,1.61,-0.139,123,20,1.00,4928,-1759 93 | 2013_06_21,IV,2,711,76,5.30,-163,2021,1.21,-0.217,129,42,0.97,5498,-1257 94 | 2013_06_21,IV,3,614,33,4.57,-367,1366,2.73,-0.198,128,108,0.46,4776,-2857 95 | 2013_06_21,IV,4,468,36,3.48,-218,1269,1.63,-0.122,129,68,0.61,3617,-1688 -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/mlb_nohitters.csv: -------------------------------------------------------------------------------- 1 | date,game_number,winning_team,losing_team,winning_pitcher 2 | 18760715,140,,, 3 | 18800612,1035,,, 4 | 18800617,1046,,, 5 | 18800819,1177,,, 6 | 18800820,1179,,, 7 | 18820911,2114,,, 8 | 18820919,2144,,, 9 | 18820920,2151,,, 10 | 18830725,2637,,, 11 | 18830913,2892,,, 12 | 18840529,3265,,, 13 | 18840605,3347,,, 14 | 18840627,3539,,, 15 | 18840804,3895,,, 16 | 18840826,4076,,, 17 | 18840928,4363,,, 18 | 18841004,4411,,, 19 | 18850524,4681,,, 20 | 18850727,5043,,, 21 | 18850829,5217,,, 22 | 18860501,5464,,, 23 | 18860724,5957,,, 24 | 18861006,6420,,, 25 | 18880527,7740,,, 26 | 18880606,7799,,, 27 | 18880726,8097,,, 28 | 18880731,8129,,, 29 | 18900915,11100,,, 30 | 18910622,11741,,, 31 | 18910731,11979,,, 32 | 18911004,12414,,, 33 | 18920806,12985,,, 34 | 18920822,13063,,, 35 | 18921015,13335,,, 36 | 18930816,13899,,, 37 | 18970918,17265,,, 38 | 18980422,17355,,, 39 | 18980422,17356,,, 40 | 18980708,17736,,, 41 | 18980821,17958,,, 42 | 18990525,18438,,, 43 | 18990807,18806,,, 44 | 19000712,19435,,, 45 | 19010715,20279,,, 46 | 19020920,21893,,, 47 | 19030918,22995,,, 48 | 19040505,23211,,, 49 | 19040817,23896,,, 50 | 19050613,24711,,, 51 | 19050722,24990,,, 52 | 19050906,25315,,, 53 | 19050927,25477,,, 54 | 19060501,25697,,, 55 | 19060720,26243,,, 56 | 19070508,26959,,, 57 | 19070920,27926,,, 58 | 19080630,28551,,, 59 | 19080704,28581,,, 60 | 19080905,29032,,, 61 | 19080918,29140,,, 62 | 19080920,29161,,, 63 | 19081002,29253,,, 64 | 19100420,30579,,, 65 | 19100512,30704,,, 66 | 19110729,32173,,, 67 | 19110827,32278,,, 68 | 19120704,33588,DET,SLA,George Mullin 69 | 19120830,34018,SLA,DET,Earl Hamilton 70 | 19120906,34081,NY1,PHI,Jeff Tesreau 71 | 19140531,35960,CHA,CLE,Joe Benz 72 | 19140909,37065,BSN,PHI,Iron Davis 73 | 19140919,37189,BRF,KCF,Ed Lafitte 74 | 19150415,37441,NY1,BRO,Rube Marquard 75 | 19150424,37535,PTF,SLF,Frank Allen 76 | 19150515,37724,CHF,PTF,Claude Hendrix 77 | 19150816,38708,KCF,BUF,Alex Main 78 | 19150831,38875,CHN,NY1,Jimmy Lavender 79 | 19150907,38972,SLF,CHF,Dave Davenport 80 | 19160616,39675,BSN,PIT,Tom Hughes 81 | 19160621,39699,BOS,NYA,Rube Foster 82 | 19160826,40224,PHA,CLE,Bullet Joe Bush 83 | 19160830,40251,BOS,SLA,Dutch Leonard 84 | 19170414,40551,CHA,SLA,Eddie Cicotte 85 | 19170424,40611,NYA,BOS,George Mogridge 86 | 19170502,40651,CIN,CHN,Fred Toney 87 | 19170505,40664,SLA,CHA,Ernie Koob 88 | 19170506,40667,SLA,CHA,Bob Groom 89 | 19170623,40976,BOS,WS1,Ernie Shore 90 | 19180603,42091,BOS,DET,Dutch Leonard 91 | 19190511,42905,CIN,SLN,Hod Eller 92 | 19190910,43793,CLE,NYA,Ray Caldwell 93 | 19200701,44439,WS1,BOS,Walter Johnson 94 | 19220430,46528,CHA,DET,Charlie Robertson 95 | 19220507,46571,NY1,PHI,Jesse Barnes 96 | 19230904,48662,NYA,PHA,Sad Sam Jones 97 | 19230907,48674,BOS,PHA,Howard Ehmke 98 | 19240717,49561,SLN,BSN,Jesse Haines 99 | 19250913,51227,BRO,PHI,Dazzy Vance 100 | 19260821,52312,CHA,BOS,Ted Lyons 101 | 19290508,55213,NY1,PIT,Carl Hubbell 102 | 19310429,57646,CLE,SLA,Wes Ferrell 103 | 19310808,58397,WS1,BOS,Bobby Burke 104 | 19340921,62419,SLN,BRO,Paul Dean 105 | 19350831,63490,CHA,CLE,Vern Kennedy 106 | 19370601,65256,CHA,SLA,Bill Dietrich 107 | 19380611,66579,CIN,BSN,Johnny Vander Meer 108 | 19380615,66606,CIN,BRO,Johnny Vander Meer 109 | 19380827,67155,NYA,CLE,Monte Pearson 110 | 19400416,68681,CLE,CHA,Bob Feller 111 | 19400430,68759,BRO,CIN,Tex Carleton 112 | 19410830,70941,SLN,CIN,Lon Warneke 113 | 19440427,73694,BSN,BRO,Jim Tobin 114 | 19440515,73822,CIN,BSN,Clyde Shoun 115 | 19450909,75970,PHA,SLA,Dick Fowler 116 | 19460423,76182,BRO,BSN,Ed Head 117 | 19460430,76224,CLE,NYA,Bob Feller 118 | 19470618,77800,CIN,BSN,Ewell Blackwell 119 | 19470710,77952,CLE,PHA,Don Black 120 | 19470903,78432,PHA,WS1,Bill McCahan 121 | 19480630,79130,CLE,DET,Bob Lemon 122 | 19480909,79688,BRO,NY1,Rex Barney 123 | 19500811,81956,BSN,BRO,Vern Bickford 124 | 19510506,82499,PIT,BSN,Cliff Chambers 125 | 19510701,82892,CLE,DET,Bob Feller 126 | 19510712,82966,NYA,CLE,Allie Reynolds 127 | 19510928,83570,NYA,BOS,Allie Reynolds 128 | 19520515,83804,DET,WS1,Virgil Trucks 129 | 19520619,84060,BRO,CHN,Carl Erskine 130 | 19520825,84589,DET,NYA,Virgil Trucks 131 | 19530506,84987,SLA,PHA,Bobo Holloman 132 | 19540612,86517,MLN,PHI,Jim Wilson 133 | 19550512,87541,CHN,PIT,Sam Jones 134 | 19560512,88736,BRO,NY1,Carl Erskine 135 | 19560714,89199,BOS,CHA,Mel Parnell 136 | 19560925,89783,BRO,PHI,Sal Maglie 137 | 19561008,89821,NYA,BRO,Don Larsen 138 | 19570820,90765,CHA,WS1,Bob Keegan 139 | 19580720,91762,DET,BOS,Jim Bunning 140 | 19580920,92243,BAL,NYA,Hoyt Wilhelm 141 | 19600515,93741,CHN,SLN,Don Cardwell 142 | 19600818,94459,MLN,PHI,Lew Burdette 143 | 19600916,94684,MLN,PHI,Warren Spahn 144 | 19610428,94904,MLN,SFN,Warren Spahn 145 | 19620505,96436,LAA,BAL,Bo Belinsky 146 | 19620626,96935,BOS,LAA,Earl Wilson 147 | 19620630,96980,LAN,NYN,Sandy Koufax 148 | 19620801,97269,BOS,CHA,Bill Monbouquette 149 | 19620826,97537,MIN,KC1,Jack Kralick 150 | 19630511,98138,LAN,SFN,Sandy Koufax 151 | 19630517,98191,HOU,PHI,Don Nottebart 152 | 19630615,98461,SFN,HOU,Juan Marichal 153 | 19640423,99548,CIN,HOU,Joe Nuxhall 154 | 19640604,99935,LAN,PHI,Sandy Koufax 155 | 19640621,100112,PHI,NYN,Jim Bunning 156 | 19650819,102312,CIN,CHN,Jim Maloney 157 | 19650909,102529,LAN,CHN,Sandy Koufax 158 | 19650916,102584,BOS,CLE,Dave Morehead 159 | 19660610,103260,CLE,WS2,Sonny Siebert 160 | 19670430,104504,DET,BAL,Earl Wilson 161 | 19670618,104968,HOU,ATL,Don Wilson 162 | 19670825,105619,MIN,CLE,Dean Chance 163 | 19670910,105791,CHA,DET,Joe Horlen 164 | 19680427,106119,BAL,BOS,Tom Phoebus 165 | 19680508,106230,OAK,MIN,Catfish Hunter 166 | 19680729,107005,CIN,PHI,George Culver 167 | 19680917,107515,SFN,SLN,Gaylord Perry 168 | 19680918,107524,SLN,SFN,Ray Washburn 169 | 19690417,107722,MON,PHI,Bill Stoneman 170 | 19690430,107859,CIN,HOU,Jim Maloney 171 | 19690501,107872,HOU,CIN,Don Wilson 172 | 19690813,108997,BAL,OAK,Jim Palmer 173 | 19690819,109062,CHN,ATL,Ken Holtzman 174 | 19690920,109443,PIT,NYN,Bob Moose 175 | 19700612,110255,PIT,SDN,Dock Ellis 176 | 19700703,110488,CAL,OAK,Clyde Wright 177 | 19700720,110681,LAN,PHI,Bill Singer 178 | 19700921,111413,OAK,MIN,Vida Blue 179 | 19710603,112129,CHN,CIN,Ken Holtzman 180 | 19710623,112356,PHI,CIN,Rick Wise 181 | 19710814,112962,SLN,PIT,Bob Gibson 182 | 19720416,113502,CHN,PHI,Burt Hooton 183 | 19720902,114994,CHN,SDN,Milt Pappas 184 | 19721002,115318,MON,NYN,Bill Stoneman 185 | 19730427,115559,KCA,DET,Steve Busby 186 | 19730515,115739,CAL,KCA,Nolan Ryan 187 | 19730715,116442,CAL,DET,Nolan Ryan 188 | 19730730,116599,TEX,OAK,Jim Bibby 189 | 19730805,116682,ATL,SDN,Phil Niekro 190 | 19740619,118080,KCA,MIL,Steve Busby 191 | 19740719,118435,CLE,OAK,Dick Bosman 192 | 19740928,119214,CAL,MIN,Nolan Ryan 193 | 19750601,119818,CAL,BAL,Nolan Ryan 194 | 19750824,120820,SFN,NYN,Ed Halicki 195 | 19750928,121206,OAK,CAL,Vida Blue 196 | 19760709,122193,HOU,MON,Larry Dierker 197 | 19760728,122397,CHA,OAK,Blue Moon Odom 198 | 19760809,122547,PIT,LAN,John Candelaria 199 | 19760929,123124,SFN,ATL,John Montefusco 200 | 19770514,123570,KCA,TEX,Jim Colborn 201 | 19770530,123751,CLE,CAL,Dennis Eckersley 202 | 19770922,125155,TEX,CAL,Bert Blyleven 203 | 19780416,125408,SLN,PHI,Bob Forsch 204 | 19780616,126084,CIN,SLN,Tom Seaver 205 | 19790407,127436,HOU,ATL,Ken Forsch 206 | 19800627,130420,LAN,SFN,Jerry Reuss 207 | 19810510,131989,MON,SFN,Charlie Lea 208 | 19810515,132035,CLE,TOR,Len Barker 209 | 19810926,132935,HOU,LAN,Nolan Ryan 210 | 19830704,136196,NYA,BOS,Dave Righetti 211 | 19830926,137222,SLN,MON,Bob Forsch 212 | 19830929,137254,OAK,CHA,Mike Warren 213 | 19840407,137355,DET,CHA,Jack Morris 214 | 19840930,139411,CAL,TEX,Mike Witt 215 | 19860919,143455,CHA,CAL,Joe Cowley 216 | 19860925,143535,HOU,SFN,Mike Scott 217 | 19870415,143774,MIL,BAL,Juan Nieves 218 | 19880916,147706,CIN,LAN,Tom Browning 219 | 19900411,150058,CAL,SEA,Mark Langston 220 | 19900602,150654,SEA,DET,Randy Johnson 221 | 19900611,150765,TEX,OAK,Nolan Ryan 222 | 19900629,150981,OAK,TOR,Dave Stewart 223 | 19900629,150982,LAN,SLN,Fernando Valenzuela 224 | 19900815,151546,PHI,SFN,Terry Mulholland 225 | 19900902,151753,TOR,CLE,Dave Stieb 226 | 19910501,152414,TEX,TOR,Nolan Ryan 227 | 19910523,152657,PHI,MON,Tommy Greene 228 | 19910713,153235,BAL,OAK,Bob Milacki 229 | 19910728,153415,MON,LAN,Dennis Martinez 230 | 19910811,153573,CHA,BAL,Wilson Alvarez 231 | 19910826,153766,KCA,CHA,Bret Saberhagen 232 | 19910911,153959,ATL,SDN,Kent Mercker 233 | 19920817,155808,LAN,SFN,Kevin Gross 234 | 19930422,156601,SEA,BOS,Chris Bosio 235 | 19930904,158295,NYA,CLE,Jim Abbott 236 | 19930908,158351,HOU,NYN,Darryl Kile 237 | 19940408,158740,ATL,LAN,Kent Mercker 238 | 19940427,158966,MIN,MIL,Scott Erickson 239 | 19940728,160101,TEX,CAL,Kenny Rogers 240 | 19950714,161274,LAN,FLO,Ramon Martinez 241 | 19960511,162830,FLO,COL,Al Leiter 242 | 19960514,162862,NYA,SEA,Dwight Gooden 243 | 19960917,164445,LAN,COL,Hideo Nomo 244 | 19970610,165490,FLO,SFN,Kevin Brown 245 | 19970712,165869,PIT,HOU,Ricardo Rincon 246 | 19980517,167557,NYA,MIN,David Wells 247 | 19990625,170473,SLN,ARI,Jose Jimenez 248 | 19990718,170754,NYA,MON,David Cone 249 | 19990911,171520,MIN,ANA,Eric Milton 250 | 20010404,174340,BOS,BAL,Hideo Nomo 251 | 20010512,174852,FLO,SDN,A.J. Burnett 252 | 20010903,176374,SLN,SDN,Bud Smith 253 | 20020427,177120,BOS,TBA,Derek Lowe 254 | 20030427,179612,PHI,SFN,Kevin Millwood 255 | 20030611,180193,HOU,NYA,Brad Lidge 256 | 20040518,182266,ARI,ATL,Randy Johnson 257 | 20060906,188717,FLO,ARI,Anibal Sanchez 258 | 20070418,189296,CHA,TEX,Mark Buehrle 259 | 20070612,190042,DET,MIL,Justin Verlander 260 | 20070901,191118,BOS,BAL,Clay Buchholz 261 | 20080519,192222,BOS,KCA,Jon Lester 262 | 20080914,193772,CHN,HOU,Carlos Zambrano 263 | 20090710,195293,SFN,SDN,Jonathan Sanchez 264 | 20090723,195432,CHA,TBA,Mark Buehrle 265 | 20100417,196635,COL,ATL,Ubaldo Jimenez 266 | 20100509,196932,OAK,TBA,Dallas Braden 267 | 20100529,197210,PHI,FLO,Roy Halladay 268 | 20100625,197562,ARI,TBA,Edwin Jackson 269 | 20100726,197954,TBA,DET,Matt Garza 270 | 20101006,198905,PHI,CIN,Roy Halladay 271 | 20110503,199365,MIN,CHA,Francisco Liriano 272 | 20110507,199428,DET,TOR,Justin Verlander 273 | 20110727,200485,ANA,CLE,Ervin Santana 274 | 20120421,201614,CHA,SEA,Philip Humber 275 | 20120502,201754,ANA,MIN,Jered Weaver 276 | 20120601,202175,NYN,SLN,Johan Santana 277 | 20120608,202263,SEA,LAN,Stephen Pryor 278 | 20120613,202335,SFN,HOU,Matt Cain 279 | 20120815,203150,SEA,TBA,Felix Hernandez 280 | 20120928,203754,CIN,PIT,Homer Bailey 281 | 20130702,205104,CIN,SFN,Homer Bailey 282 | 20130713,205267,SFN,SDN,Tim Lincecum 283 | 20130929,206295,MIA,DET,Henderson Alvarez 284 | 20140525,207079,LAN,PHI,Josh Beckett 285 | 20140618,207406,LAN,COL,Clayton Kershaw 286 | 20140625,207508,SFN,SDN,Tim Lincecum 287 | 20140901,208385,PHI,ATL,Cole Hamels 288 | 20140928,208767,WAS,MIA,Jordan Zimmermann 289 | 20150609,209673,SFN,NYN,Chris Heston 290 | 20150620,209830,WAS,PIT,Max Scherzer 291 | 20150725,210250,PHI,CHN,Cole Hamels 292 | 20150812,210490,SEA,BAL,Hisashi Iwakuma 293 | 20150821,210610,HOU,LAN,Michael Fiers 294 | 20150830,210740,CHN,LAN,Jake Arrieta 295 | 20151003,211208,WAS,NYN,Max Scherzer 296 | -------------------------------------------------------------------------------- /Bagian 6 - Statistik dan Python 2/scandens_beak_depth_heredity.csv: -------------------------------------------------------------------------------- 1 | mid_parent,mid_offspring 2 | 8.3318,8.4190 3 | 8.4035,9.2468 4 | 8.5317,8.1532 5 | 8.7202,8.0089 6 | 8.7089,8.2215 7 | 8.7541,8.3734 8 | 8.7730,8.5025 9 | 8.8107,8.6392 10 | 8.7919,8.7684 11 | 8.8069,8.8139 12 | 8.6523,8.7911 13 | 8.6146,8.9051 14 | 8.6938,8.9203 15 | 8.7127,8.8747 16 | 8.7466,8.9430 17 | 8.7504,9.0038 18 | 8.7805,8.9810 19 | 8.7428,9.0949 20 | 8.7164,9.2696 21 | 8.8032,9.1633 22 | 8.8258,9.1785 23 | 8.8560,9.1937 24 | 8.9012,9.2772 25 | 8.9125,9.0722 26 | 8.8635,8.9658 27 | 8.8258,8.9658 28 | 8.8522,8.5025 29 | 8.8974,8.4949 30 | 8.9427,8.4949 31 | 8.9879,8.5633 32 | 8.9615,8.6013 33 | 8.9238,8.6468 34 | 8.9351,8.1532 35 | 9.0143,8.3734 36 | 9.0558,8.6620 37 | 9.0596,8.6924 38 | 8.9917,8.7456 39 | 8.9050,8.8367 40 | 8.9314,8.8595 41 | 8.9465,8.9658 42 | 8.9879,8.9582 43 | 8.9804,8.8671 44 | 9.0219,8.8671 45 | 9.0520,8.9430 46 | 9.0407,9.0646 47 | 9.0407,9.1405 48 | 8.9955,9.2089 49 | 8.9992,9.2848 50 | 8.9992,9.3759 51 | 9.0747,9.4899 52 | 9.0747,9.4519 53 | 9.5385,8.1228 54 | 9.4781,8.2595 55 | 9.4517,8.3127 56 | 9.3537,8.4949 57 | 9.2707,8.6013 58 | 9.1199,8.4646 59 | 9.1689,8.5329 60 | 9.1425,8.7532 61 | 9.1350,8.8823 62 | 9.1011,9.0342 63 | 9.1727,8.6392 64 | 9.2217,8.6772 65 | 9.2255,8.6316 66 | 9.2821,8.7532 67 | 9.3235,8.8291 68 | 9.3198,8.8975 69 | 9.3198,8.9734 70 | 9.3198,9.0494 71 | 9.3273,9.1253 72 | 9.3725,9.1253 73 | 9.3989,9.1253 74 | 9.4253,9.1785 75 | 9.4593,9.2848 76 | 9.4442,9.4595 77 | 9.4291,9.3608 78 | 9.2632,9.2089 79 | 9.2293,9.2544 80 | 9.1878,9.3684 81 | 9.1425,9.3684 82 | 9.1275,9.2316 83 | 9.1802,9.1709 84 | 9.1765,9.2316 85 | 9.2481,9.0342 86 | 9.2481,8.8899 87 | 9.1991,8.8291 88 | 9.1689,8.9810 89 | 9.1765,8.8975 90 | 9.2406,10.4089 91 | 9.3198,10.1886 92 | 9.3235,9.7633 93 | 9.1991,9.7329 94 | 9.2971,9.6114 95 | 9.2443,9.5051 96 | 9.3160,9.5127 97 | 9.2934,9.3684 98 | 9.3914,9.6266 99 | 9.3989,9.5354 100 | 9.5121,10.0215 101 | 9.6176,10.0215 102 | 9.5535,9.6266 103 | 9.4668,9.6038 104 | 9.3725,9.4063 105 | 9.3348,9.2316 106 | 9.3763,9.3380 107 | 9.3839,9.2620 108 | 9.4216,9.2620 109 | 9.4065,9.4063 110 | 9.3348,9.4367 111 | 9.4442,9.0342 112 | 9.4367,8.9430 113 | 9.5083,8.9203 114 | 9.4480,8.7835 115 | 9.4781,8.7835 116 | 9.5950,9.0570 117 | 9.6101,8.9354 118 | 9.5686,8.8975 119 | 9.6365,8.8139 120 | 9.7119,8.8671 121 | 9.8213,9.0873 122 | 9.8250,9.2848 123 | 9.7609,9.2392 124 | 9.6516,9.2924 125 | 9.5988,9.4063 126 | 9.5460,9.3152 127 | 9.6516,9.4899 128 | 9.7572,9.5962 129 | 9.8854,9.6873 130 | 10.0023,9.5203 131 | 9.3914,9.6646 132 | -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/.DS_Store -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/3. Classifaction Metrics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Classification Metrics" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "\"Drawing\"" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 5, 20 | "metadata": {}, 21 | "outputs": [], 22 | "source": [ 23 | "import pandas as pd" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 8, 29 | "metadata": {}, 30 | "outputs": [], 31 | "source": [ 32 | "df = pd.read_csv('spambase.data', header=None)" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 17, 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "X = df.drop(57, axis=1)\n", 42 | "y = df[57]" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 19, 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "data": { 52 | "text/html": [ 53 | "
\n", 54 | "\n", 67 | "\n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | "
0123456789...47484950515253545556
00.000.640.640.00.320.000.000.000.000.00...0.00.000.0000.00.7780.0000.0003.75661278
10.210.280.500.00.140.280.210.070.000.94...0.00.000.1320.00.3720.1800.0485.1141011028
20.060.000.710.01.230.190.190.120.640.25...0.00.010.1430.00.2760.1840.0109.8214852259
30.000.000.000.00.630.000.310.630.310.63...0.00.000.1370.00.1370.0000.0003.53740191
40.000.000.000.00.630.000.310.630.310.63...0.00.000.1350.00.1350.0000.0003.53740191
\n", 217 | "

5 rows × 57 columns

\n", 218 | "
" 219 | ], 220 | "text/plain": [ 221 | " 0 1 2 3 4 5 6 7 8 9 ... 47 48 \\\n", 222 | "0 0.00 0.64 0.64 0.0 0.32 0.00 0.00 0.00 0.00 0.00 ... 0.0 0.00 \n", 223 | "1 0.21 0.28 0.50 0.0 0.14 0.28 0.21 0.07 0.00 0.94 ... 0.0 0.00 \n", 224 | "2 0.06 0.00 0.71 0.0 1.23 0.19 0.19 0.12 0.64 0.25 ... 0.0 0.01 \n", 225 | "3 0.00 0.00 0.00 0.0 0.63 0.00 0.31 0.63 0.31 0.63 ... 0.0 0.00 \n", 226 | "4 0.00 0.00 0.00 0.0 0.63 0.00 0.31 0.63 0.31 0.63 ... 0.0 0.00 \n", 227 | "\n", 228 | " 49 50 51 52 53 54 55 56 \n", 229 | "0 0.000 0.0 0.778 0.000 0.000 3.756 61 278 \n", 230 | "1 0.132 0.0 0.372 0.180 0.048 5.114 101 1028 \n", 231 | "2 0.143 0.0 0.276 0.184 0.010 9.821 485 2259 \n", 232 | "3 0.137 0.0 0.137 0.000 0.000 3.537 40 191 \n", 233 | "4 0.135 0.0 0.135 0.000 0.000 3.537 40 191 \n", 234 | "\n", 235 | "[5 rows x 57 columns]" 236 | ] 237 | }, 238 | "execution_count": 19, 239 | "metadata": {}, 240 | "output_type": "execute_result" 241 | } 242 | ], 243 | "source": [ 244 | "X.head()" 245 | ] 246 | }, 247 | { 248 | "cell_type": "code", 249 | "execution_count": 23, 250 | "metadata": {}, 251 | "outputs": [], 252 | "source": [ 253 | "from sklearn.neighbors import KNeighborsClassifier\n", 254 | "from sklearn.model_selection import train_test_split\n", 255 | "from sklearn.metrics import classification_report\n", 256 | "from sklearn.metrics import confusion_matrix\n", 257 | "knn = KNeighborsClassifier(n_neighbors=8)\n", 258 | "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.4, random_state=42)\n", 259 | "knn.fit(X_train, y_train)\n", 260 | "y_pred = knn.predict(X_test)" 261 | ] 262 | }, 263 | { 264 | "cell_type": "code", 265 | "execution_count": 24, 266 | "metadata": {}, 267 | "outputs": [ 268 | { 269 | "name": "stdout", 270 | "output_type": "stream", 271 | "text": [ 272 | "[[942 147]\n", 273 | " [291 461]]\n" 274 | ] 275 | } 276 | ], 277 | "source": [ 278 | "print(confusion_matrix(y_test, y_pred))" 279 | ] 280 | }, 281 | { 282 | "cell_type": "code", 283 | "execution_count": 25, 284 | "metadata": {}, 285 | "outputs": [ 286 | { 287 | "name": "stdout", 288 | "output_type": "stream", 289 | "text": [ 290 | " precision recall f1-score support\n", 291 | "\n", 292 | " 0 0.76 0.87 0.81 1089\n", 293 | " 1 0.76 0.61 0.68 752\n", 294 | "\n", 295 | "avg / total 0.76 0.76 0.76 1841\n", 296 | "\n" 297 | ] 298 | } 299 | ], 300 | "source": [ 301 | "print(classification_report(y_test, y_pred))" 302 | ] 303 | }, 304 | { 305 | "cell_type": "code", 306 | "execution_count": null, 307 | "metadata": {}, 308 | "outputs": [], 309 | "source": [] 310 | } 311 | ], 312 | "metadata": { 313 | "kernelspec": { 314 | "display_name": "Python 3", 315 | "language": "python", 316 | "name": "python3" 317 | }, 318 | "language_info": { 319 | "codemirror_mode": { 320 | "name": "ipython", 321 | "version": 3 322 | }, 323 | "file_extension": ".py", 324 | "mimetype": "text/x-python", 325 | "name": "python", 326 | "nbconvert_exporter": "python", 327 | "pygments_lexer": "ipython3", 328 | "version": "3.6.4" 329 | } 330 | }, 331 | "nbformat": 4, 332 | "nbformat_minor": 2 333 | } 334 | -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/Bonus/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/Bonus/.DS_Store -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/img/cm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/img/cm.png -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/img/cv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/img/cv.png -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/img/decision_boundary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/img/decision_boundary.png -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/img/k_nearest_neighbours.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/img/k_nearest_neighbours.png -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/img/loss-function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/img/loss-function.png -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/img/n_neigbors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/img/n_neigbors.png -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/img/underfitting_overfitting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 7 - Supervised Learning/img/underfitting_overfitting.png -------------------------------------------------------------------------------- /Bagian 7 - Supervised Learning/iris.csv: -------------------------------------------------------------------------------- 1 | sepal_length,sepal_width,petal_length,petal_width,species 2 | 5.1,3.5,1.4,0.2,setosa 3 | 4.9,3,1.4,0.2,setosa 4 | 4.7,3.2,1.3,0.2,setosa 5 | 4.6,3.1,1.5,0.2,setosa 6 | 5,3.6,1.4,0.2,setosa 7 | 5.4,3.9,1.7,0.4,setosa 8 | 4.6,3.4,1.4,0.3,setosa 9 | 5,3.4,1.5,0.2,setosa 10 | 4.4,2.9,1.4,0.2,setosa 11 | 4.9,3.1,1.5,0.1,setosa 12 | 5.4,3.7,1.5,0.2,setosa 13 | 4.8,3.4,1.6,0.2,setosa 14 | 4.8,3,1.4,0.1,setosa 15 | 4.3,3,1.1,0.1,setosa 16 | 5.8,4,1.2,0.2,setosa 17 | 5.7,4.4,1.5,0.4,setosa 18 | 5.4,3.9,1.3,0.4,setosa 19 | 5.1,3.5,1.4,0.3,setosa 20 | 5.7,3.8,1.7,0.3,setosa 21 | 5.1,3.8,1.5,0.3,setosa 22 | 5.4,3.4,1.7,0.2,setosa 23 | 5.1,3.7,1.5,0.4,setosa 24 | 4.6,3.6,1,0.2,setosa 25 | 5.1,3.3,1.7,0.5,setosa 26 | 4.8,3.4,1.9,0.2,setosa 27 | 5,3,1.6,0.2,setosa 28 | 5,3.4,1.6,0.4,setosa 29 | 5.2,3.5,1.5,0.2,setosa 30 | 5.2,3.4,1.4,0.2,setosa 31 | 4.7,3.2,1.6,0.2,setosa 32 | 4.8,3.1,1.6,0.2,setosa 33 | 5.4,3.4,1.5,0.4,setosa 34 | 5.2,4.1,1.5,0.1,setosa 35 | 5.5,4.2,1.4,0.2,setosa 36 | 4.9,3.1,1.5,0.1,setosa 37 | 5,3.2,1.2,0.2,setosa 38 | 5.5,3.5,1.3,0.2,setosa 39 | 4.9,3.1,1.5,0.1,setosa 40 | 4.4,3,1.3,0.2,setosa 41 | 5.1,3.4,1.5,0.2,setosa 42 | 5,3.5,1.3,0.3,setosa 43 | 4.5,2.3,1.3,0.3,setosa 44 | 4.4,3.2,1.3,0.2,setosa 45 | 5,3.5,1.6,0.6,setosa 46 | 5.1,3.8,1.9,0.4,setosa 47 | 4.8,3,1.4,0.3,setosa 48 | 5.1,3.8,1.6,0.2,setosa 49 | 4.6,3.2,1.4,0.2,setosa 50 | 5.3,3.7,1.5,0.2,setosa 51 | 5,3.3,1.4,0.2,setosa 52 | 7,3.2,4.7,1.4,versicolor 53 | 6.4,3.2,4.5,1.5,versicolor 54 | 6.9,3.1,4.9,1.5,versicolor 55 | 5.5,2.3,4,1.3,versicolor 56 | 6.5,2.8,4.6,1.5,versicolor 57 | 5.7,2.8,4.5,1.3,versicolor 58 | 6.3,3.3,4.7,1.6,versicolor 59 | 4.9,2.4,3.3,1,versicolor 60 | 6.6,2.9,4.6,1.3,versicolor 61 | 5.2,2.7,3.9,1.4,versicolor 62 | 5,2,3.5,1,versicolor 63 | 5.9,3,4.2,1.5,versicolor 64 | 6,2.2,4,1,versicolor 65 | 6.1,2.9,4.7,1.4,versicolor 66 | 5.6,2.9,3.6,1.3,versicolor 67 | 6.7,3.1,4.4,1.4,versicolor 68 | 5.6,3,4.5,1.5,versicolor 69 | 5.8,2.7,4.1,1,versicolor 70 | 6.2,2.2,4.5,1.5,versicolor 71 | 5.6,2.5,3.9,1.1,versicolor 72 | 5.9,3.2,4.8,1.8,versicolor 73 | 6.1,2.8,4,1.3,versicolor 74 | 6.3,2.5,4.9,1.5,versicolor 75 | 6.1,2.8,4.7,1.2,versicolor 76 | 6.4,2.9,4.3,1.3,versicolor 77 | 6.6,3,4.4,1.4,versicolor 78 | 6.8,2.8,4.8,1.4,versicolor 79 | 6.7,3,5,1.7,versicolor 80 | 6,2.9,4.5,1.5,versicolor 81 | 5.7,2.6,3.5,1,versicolor 82 | 5.5,2.4,3.8,1.1,versicolor 83 | 5.5,2.4,3.7,1,versicolor 84 | 5.8,2.7,3.9,1.2,versicolor 85 | 6,2.7,5.1,1.6,versicolor 86 | 5.4,3,4.5,1.5,versicolor 87 | 6,3.4,4.5,1.6,versicolor 88 | 6.7,3.1,4.7,1.5,versicolor 89 | 6.3,2.3,4.4,1.3,versicolor 90 | 5.6,3,4.1,1.3,versicolor 91 | 5.5,2.5,4,1.3,versicolor 92 | 5.5,2.6,4.4,1.2,versicolor 93 | 6.1,3,4.6,1.4,versicolor 94 | 5.8,2.6,4,1.2,versicolor 95 | 5,2.3,3.3,1,versicolor 96 | 5.6,2.7,4.2,1.3,versicolor 97 | 5.7,3,4.2,1.2,versicolor 98 | 5.7,2.9,4.2,1.3,versicolor 99 | 6.2,2.9,4.3,1.3,versicolor 100 | 5.1,2.5,3,1.1,versicolor 101 | 5.7,2.8,4.1,1.3,versicolor 102 | 6.3,3.3,6,2.5,virginica 103 | 5.8,2.7,5.1,1.9,virginica 104 | 7.1,3,5.9,2.1,virginica 105 | 6.3,2.9,5.6,1.8,virginica 106 | 6.5,3,5.8,2.2,virginica 107 | 7.6,3,6.6,2.1,virginica 108 | 4.9,2.5,4.5,1.7,virginica 109 | 7.3,2.9,6.3,1.8,virginica 110 | 6.7,2.5,5.8,1.8,virginica 111 | 7.2,3.6,6.1,2.5,virginica 112 | 6.5,3.2,5.1,2,virginica 113 | 6.4,2.7,5.3,1.9,virginica 114 | 6.8,3,5.5,2.1,virginica 115 | 5.7,2.5,5,2,virginica 116 | 5.8,2.8,5.1,2.4,virginica 117 | 6.4,3.2,5.3,2.3,virginica 118 | 6.5,3,5.5,1.8,virginica 119 | 7.7,3.8,6.7,2.2,virginica 120 | 7.7,2.6,6.9,2.3,virginica 121 | 6,2.2,5,1.5,virginica 122 | 6.9,3.2,5.7,2.3,virginica 123 | 5.6,2.8,4.9,2,virginica 124 | 7.7,2.8,6.7,2,virginica 125 | 6.3,2.7,4.9,1.8,virginica 126 | 6.7,3.3,5.7,2.1,virginica 127 | 7.2,3.2,6,1.8,virginica 128 | 6.2,2.8,4.8,1.8,virginica 129 | 6.1,3,4.9,1.8,virginica 130 | 6.4,2.8,5.6,2.1,virginica 131 | 7.2,3,5.8,1.6,virginica 132 | 7.4,2.8,6.1,1.9,virginica 133 | 7.9,3.8,6.4,2,virginica 134 | 6.4,2.8,5.6,2.2,virginica 135 | 6.3,2.8,5.1,1.5,virginica 136 | 6.1,2.6,5.6,1.4,virginica 137 | 7.7,3,6.1,2.3,virginica 138 | 6.3,3.4,5.6,2.4,virginica 139 | 6.4,3.1,5.5,1.8,virginica 140 | 6,3,4.8,1.8,virginica 141 | 6.9,3.1,5.4,2.1,virginica 142 | 6.7,3.1,5.6,2.4,virginica 143 | 6.9,3.1,5.1,2.3,virginica 144 | 5.8,2.7,5.1,1.9,virginica 145 | 6.8,3.2,5.9,2.3,virginica 146 | 6.7,3.3,5.7,2.5,virginica 147 | 6.7,3,5.2,2.3,virginica 148 | 6.3,2.5,5,1.9,virginica 149 | 6.5,3,5.2,2,virginica 150 | 6.2,3.4,5.4,2.3,virginica 151 | 5.9,3,5.1,1.8,virginica 152 | -------------------------------------------------------------------------------- /Bagian 8 - Unsupervised Learning/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 8 - Unsupervised Learning/.DS_Store -------------------------------------------------------------------------------- /Bagian 8 - Unsupervised Learning/img/inertia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian 8 - Unsupervised Learning/img/inertia.png -------------------------------------------------------------------------------- /Bagian 8 - Unsupervised Learning/iris.csv: -------------------------------------------------------------------------------- 1 | sepal_length,sepal_width,petal_length,petal_width,species 2 | 5.1,3.5,1.4,0.2,setosa 3 | 4.9,3,1.4,0.2,setosa 4 | 4.7,3.2,1.3,0.2,setosa 5 | 4.6,3.1,1.5,0.2,setosa 6 | 5,3.6,1.4,0.2,setosa 7 | 5.4,3.9,1.7,0.4,setosa 8 | 4.6,3.4,1.4,0.3,setosa 9 | 5,3.4,1.5,0.2,setosa 10 | 4.4,2.9,1.4,0.2,setosa 11 | 4.9,3.1,1.5,0.1,setosa 12 | 5.4,3.7,1.5,0.2,setosa 13 | 4.8,3.4,1.6,0.2,setosa 14 | 4.8,3,1.4,0.1,setosa 15 | 4.3,3,1.1,0.1,setosa 16 | 5.8,4,1.2,0.2,setosa 17 | 5.7,4.4,1.5,0.4,setosa 18 | 5.4,3.9,1.3,0.4,setosa 19 | 5.1,3.5,1.4,0.3,setosa 20 | 5.7,3.8,1.7,0.3,setosa 21 | 5.1,3.8,1.5,0.3,setosa 22 | 5.4,3.4,1.7,0.2,setosa 23 | 5.1,3.7,1.5,0.4,setosa 24 | 4.6,3.6,1,0.2,setosa 25 | 5.1,3.3,1.7,0.5,setosa 26 | 4.8,3.4,1.9,0.2,setosa 27 | 5,3,1.6,0.2,setosa 28 | 5,3.4,1.6,0.4,setosa 29 | 5.2,3.5,1.5,0.2,setosa 30 | 5.2,3.4,1.4,0.2,setosa 31 | 4.7,3.2,1.6,0.2,setosa 32 | 4.8,3.1,1.6,0.2,setosa 33 | 5.4,3.4,1.5,0.4,setosa 34 | 5.2,4.1,1.5,0.1,setosa 35 | 5.5,4.2,1.4,0.2,setosa 36 | 4.9,3.1,1.5,0.1,setosa 37 | 5,3.2,1.2,0.2,setosa 38 | 5.5,3.5,1.3,0.2,setosa 39 | 4.9,3.1,1.5,0.1,setosa 40 | 4.4,3,1.3,0.2,setosa 41 | 5.1,3.4,1.5,0.2,setosa 42 | 5,3.5,1.3,0.3,setosa 43 | 4.5,2.3,1.3,0.3,setosa 44 | 4.4,3.2,1.3,0.2,setosa 45 | 5,3.5,1.6,0.6,setosa 46 | 5.1,3.8,1.9,0.4,setosa 47 | 4.8,3,1.4,0.3,setosa 48 | 5.1,3.8,1.6,0.2,setosa 49 | 4.6,3.2,1.4,0.2,setosa 50 | 5.3,3.7,1.5,0.2,setosa 51 | 5,3.3,1.4,0.2,setosa 52 | 7,3.2,4.7,1.4,versicolor 53 | 6.4,3.2,4.5,1.5,versicolor 54 | 6.9,3.1,4.9,1.5,versicolor 55 | 5.5,2.3,4,1.3,versicolor 56 | 6.5,2.8,4.6,1.5,versicolor 57 | 5.7,2.8,4.5,1.3,versicolor 58 | 6.3,3.3,4.7,1.6,versicolor 59 | 4.9,2.4,3.3,1,versicolor 60 | 6.6,2.9,4.6,1.3,versicolor 61 | 5.2,2.7,3.9,1.4,versicolor 62 | 5,2,3.5,1,versicolor 63 | 5.9,3,4.2,1.5,versicolor 64 | 6,2.2,4,1,versicolor 65 | 6.1,2.9,4.7,1.4,versicolor 66 | 5.6,2.9,3.6,1.3,versicolor 67 | 6.7,3.1,4.4,1.4,versicolor 68 | 5.6,3,4.5,1.5,versicolor 69 | 5.8,2.7,4.1,1,versicolor 70 | 6.2,2.2,4.5,1.5,versicolor 71 | 5.6,2.5,3.9,1.1,versicolor 72 | 5.9,3.2,4.8,1.8,versicolor 73 | 6.1,2.8,4,1.3,versicolor 74 | 6.3,2.5,4.9,1.5,versicolor 75 | 6.1,2.8,4.7,1.2,versicolor 76 | 6.4,2.9,4.3,1.3,versicolor 77 | 6.6,3,4.4,1.4,versicolor 78 | 6.8,2.8,4.8,1.4,versicolor 79 | 6.7,3,5,1.7,versicolor 80 | 6,2.9,4.5,1.5,versicolor 81 | 5.7,2.6,3.5,1,versicolor 82 | 5.5,2.4,3.8,1.1,versicolor 83 | 5.5,2.4,3.7,1,versicolor 84 | 5.8,2.7,3.9,1.2,versicolor 85 | 6,2.7,5.1,1.6,versicolor 86 | 5.4,3,4.5,1.5,versicolor 87 | 6,3.4,4.5,1.6,versicolor 88 | 6.7,3.1,4.7,1.5,versicolor 89 | 6.3,2.3,4.4,1.3,versicolor 90 | 5.6,3,4.1,1.3,versicolor 91 | 5.5,2.5,4,1.3,versicolor 92 | 5.5,2.6,4.4,1.2,versicolor 93 | 6.1,3,4.6,1.4,versicolor 94 | 5.8,2.6,4,1.2,versicolor 95 | 5,2.3,3.3,1,versicolor 96 | 5.6,2.7,4.2,1.3,versicolor 97 | 5.7,3,4.2,1.2,versicolor 98 | 5.7,2.9,4.2,1.3,versicolor 99 | 6.2,2.9,4.3,1.3,versicolor 100 | 5.1,2.5,3,1.1,versicolor 101 | 5.7,2.8,4.1,1.3,versicolor 102 | 6.3,3.3,6,2.5,virginica 103 | 5.8,2.7,5.1,1.9,virginica 104 | 7.1,3,5.9,2.1,virginica 105 | 6.3,2.9,5.6,1.8,virginica 106 | 6.5,3,5.8,2.2,virginica 107 | 7.6,3,6.6,2.1,virginica 108 | 4.9,2.5,4.5,1.7,virginica 109 | 7.3,2.9,6.3,1.8,virginica 110 | 6.7,2.5,5.8,1.8,virginica 111 | 7.2,3.6,6.1,2.5,virginica 112 | 6.5,3.2,5.1,2,virginica 113 | 6.4,2.7,5.3,1.9,virginica 114 | 6.8,3,5.5,2.1,virginica 115 | 5.7,2.5,5,2,virginica 116 | 5.8,2.8,5.1,2.4,virginica 117 | 6.4,3.2,5.3,2.3,virginica 118 | 6.5,3,5.5,1.8,virginica 119 | 7.7,3.8,6.7,2.2,virginica 120 | 7.7,2.6,6.9,2.3,virginica 121 | 6,2.2,5,1.5,virginica 122 | 6.9,3.2,5.7,2.3,virginica 123 | 5.6,2.8,4.9,2,virginica 124 | 7.7,2.8,6.7,2,virginica 125 | 6.3,2.7,4.9,1.8,virginica 126 | 6.7,3.3,5.7,2.1,virginica 127 | 7.2,3.2,6,1.8,virginica 128 | 6.2,2.8,4.8,1.8,virginica 129 | 6.1,3,4.9,1.8,virginica 130 | 6.4,2.8,5.6,2.1,virginica 131 | 7.2,3,5.8,1.6,virginica 132 | 7.4,2.8,6.1,1.9,virginica 133 | 7.9,3.8,6.4,2,virginica 134 | 6.4,2.8,5.6,2.2,virginica 135 | 6.3,2.8,5.1,1.5,virginica 136 | 6.1,2.6,5.6,1.4,virginica 137 | 7.7,3,6.1,2.3,virginica 138 | 6.3,3.4,5.6,2.4,virginica 139 | 6.4,3.1,5.5,1.8,virginica 140 | 6,3,4.8,1.8,virginica 141 | 6.9,3.1,5.4,2.1,virginica 142 | 6.7,3.1,5.6,2.4,virginica 143 | 6.9,3.1,5.1,2.3,virginica 144 | 5.8,2.7,5.1,1.9,virginica 145 | 6.8,3.2,5.9,2.3,virginica 146 | 6.7,3.3,5.7,2.5,virginica 147 | 6.7,3,5.2,2.3,virginica 148 | 6.3,2.5,5,1.9,virginica 149 | 6.5,3,5.2,2,virginica 150 | 6.2,3.4,5.4,2.3,virginica 151 | 5.9,3,5.1,1.8,virginica 152 | -------------------------------------------------------------------------------- /Bagian Bonus - Natural Language Processing/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/Bagian Bonus - Natural Language Processing/.DS_Store -------------------------------------------------------------------------------- /Bagian Bonus - Natural Language Processing/1. Dasar mengolah data text.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Dasar mengolah text dengan Python" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 8, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "text1 = \"Setiap hari ibu pergi ke Pasar Minggu untuk membeli Pisang Ambon\"" 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": 9, 22 | "metadata": {}, 23 | "outputs": [ 24 | { 25 | "data": { 26 | "text/plain": [ 27 | "64" 28 | ] 29 | }, 30 | "execution_count": 9, 31 | "metadata": {}, 32 | "output_type": "execute_result" 33 | } 34 | ], 35 | "source": [ 36 | "len(text1)" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": 10, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "text2 = text1.split(' ')" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 11, 51 | "metadata": {}, 52 | "outputs": [ 53 | { 54 | "data": { 55 | "text/plain": [ 56 | "11" 57 | ] 58 | }, 59 | "execution_count": 11, 60 | "metadata": {}, 61 | "output_type": "execute_result" 62 | } 63 | ], 64 | "source": [ 65 | "len(text2)" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": 12, 71 | "metadata": {}, 72 | "outputs": [ 73 | { 74 | "data": { 75 | "text/plain": [ 76 | "['Setiap',\n", 77 | " 'hari',\n", 78 | " 'ibu',\n", 79 | " 'pergi',\n", 80 | " 'ke',\n", 81 | " 'Pasar',\n", 82 | " 'Minggu',\n", 83 | " 'untuk',\n", 84 | " 'membeli',\n", 85 | " 'Pisang',\n", 86 | " 'Ambon']" 87 | ] 88 | }, 89 | "execution_count": 12, 90 | "metadata": {}, 91 | "output_type": "execute_result" 92 | } 93 | ], 94 | "source": [ 95 | "text2" 96 | ] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "execution_count": 13, 101 | "metadata": {}, 102 | "outputs": [ 103 | { 104 | "data": { 105 | "text/plain": [ 106 | "['Setiap',\n", 107 | " 'hari',\n", 108 | " 'pergi',\n", 109 | " 'Pasar',\n", 110 | " 'Minggu',\n", 111 | " 'untuk',\n", 112 | " 'membeli',\n", 113 | " 'Pisang',\n", 114 | " 'Ambon']" 115 | ] 116 | }, 117 | "execution_count": 13, 118 | "metadata": {}, 119 | "output_type": "execute_result" 120 | } 121 | ], 122 | "source": [ 123 | "[w for w in text2 if len(w) > 3]" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 14, 129 | "metadata": {}, 130 | "outputs": [ 131 | { 132 | "data": { 133 | "text/plain": [ 134 | "['Setiap', 'Pasar', 'Minggu', 'Pisang', 'Ambon']" 135 | ] 136 | }, 137 | "execution_count": 14, 138 | "metadata": {}, 139 | "output_type": "execute_result" 140 | } 141 | ], 142 | "source": [ 143 | "[w for w in text2 if w.istitle()]" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": 15, 149 | "metadata": {}, 150 | "outputs": [], 151 | "source": [ 152 | "text3 = 'To be or not to be'" 153 | ] 154 | }, 155 | { 156 | "cell_type": "code", 157 | "execution_count": 16, 158 | "metadata": {}, 159 | "outputs": [], 160 | "source": [ 161 | "text4 = text3.split(' ')" 162 | ] 163 | }, 164 | { 165 | "cell_type": "code", 166 | "execution_count": 17, 167 | "metadata": {}, 168 | "outputs": [ 169 | { 170 | "data": { 171 | "text/plain": [ 172 | "6" 173 | ] 174 | }, 175 | "execution_count": 17, 176 | "metadata": {}, 177 | "output_type": "execute_result" 178 | } 179 | ], 180 | "source": [ 181 | "len(text4)" 182 | ] 183 | }, 184 | { 185 | "cell_type": "code", 186 | "execution_count": 18, 187 | "metadata": {}, 188 | "outputs": [ 189 | { 190 | "data": { 191 | "text/plain": [ 192 | "5" 193 | ] 194 | }, 195 | "execution_count": 18, 196 | "metadata": {}, 197 | "output_type": "execute_result" 198 | } 199 | ], 200 | "source": [ 201 | "len(set(text4))" 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": 19, 207 | "metadata": {}, 208 | "outputs": [ 209 | { 210 | "data": { 211 | "text/plain": [ 212 | "{'To', 'be', 'not', 'or', 'to'}" 213 | ] 214 | }, 215 | "execution_count": 19, 216 | "metadata": {}, 217 | "output_type": "execute_result" 218 | } 219 | ], 220 | "source": [ 221 | "set(text4)" 222 | ] 223 | }, 224 | { 225 | "cell_type": "code", 226 | "execution_count": 20, 227 | "metadata": {}, 228 | "outputs": [ 229 | { 230 | "data": { 231 | "text/plain": [ 232 | "4" 233 | ] 234 | }, 235 | "execution_count": 20, 236 | "metadata": {}, 237 | "output_type": "execute_result" 238 | } 239 | ], 240 | "source": [ 241 | "len(set([w.lower() for w in text4]))" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": 21, 247 | "metadata": {}, 248 | "outputs": [ 249 | { 250 | "data": { 251 | "text/plain": [ 252 | "{'be', 'not', 'or', 'to'}" 253 | ] 254 | }, 255 | "execution_count": 21, 256 | "metadata": {}, 257 | "output_type": "execute_result" 258 | } 259 | ], 260 | "source": [ 261 | "set([w.lower() for w in text4])" 262 | ] 263 | }, 264 | { 265 | "cell_type": "code", 266 | "execution_count": 22, 267 | "metadata": {}, 268 | "outputs": [], 269 | "source": [ 270 | "text5 = 'ouagadogou'" 271 | ] 272 | }, 273 | { 274 | "cell_type": "code", 275 | "execution_count": 23, 276 | "metadata": {}, 277 | "outputs": [], 278 | "source": [ 279 | "text6 = text5.split('ou')" 280 | ] 281 | }, 282 | { 283 | "cell_type": "code", 284 | "execution_count": 24, 285 | "metadata": {}, 286 | "outputs": [ 287 | { 288 | "data": { 289 | "text/plain": [ 290 | "['', 'agadog', '']" 291 | ] 292 | }, 293 | "execution_count": 24, 294 | "metadata": {}, 295 | "output_type": "execute_result" 296 | } 297 | ], 298 | "source": [ 299 | "text6" 300 | ] 301 | }, 302 | { 303 | "cell_type": "code", 304 | "execution_count": 25, 305 | "metadata": {}, 306 | "outputs": [ 307 | { 308 | "data": { 309 | "text/plain": [ 310 | "'ouagadogou'" 311 | ] 312 | }, 313 | "execution_count": 25, 314 | "metadata": {}, 315 | "output_type": "execute_result" 316 | } 317 | ], 318 | "source": [ 319 | "'ou'.join(text6)" 320 | ] 321 | }, 322 | { 323 | "cell_type": "code", 324 | "execution_count": 29, 325 | "metadata": {}, 326 | "outputs": [ 327 | { 328 | "ename": "ValueError", 329 | "evalue": "empty separator", 330 | "output_type": "error", 331 | "traceback": [ 332 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 333 | "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", 334 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtext5\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m''\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 335 | "\u001b[0;31mValueError\u001b[0m: empty separator" 336 | ] 337 | } 338 | ], 339 | "source": [ 340 | "text5.split('')" 341 | ] 342 | }, 343 | { 344 | "cell_type": "code", 345 | "execution_count": 30, 346 | "metadata": {}, 347 | "outputs": [ 348 | { 349 | "data": { 350 | "text/plain": [ 351 | "['o', 'u', 'a', 'g', 'a', 'd', 'o', 'g', 'o', 'u']" 352 | ] 353 | }, 354 | "execution_count": 30, 355 | "metadata": {}, 356 | "output_type": "execute_result" 357 | } 358 | ], 359 | "source": [ 360 | "list(text5)" 361 | ] 362 | }, 363 | { 364 | "cell_type": "code", 365 | "execution_count": 31, 366 | "metadata": {}, 367 | "outputs": [ 368 | { 369 | "data": { 370 | "text/plain": [ 371 | "['o', 'u', 'a', 'g', 'a', 'd', 'o', 'g', 'o', 'u']" 372 | ] 373 | }, 374 | "execution_count": 31, 375 | "metadata": {}, 376 | "output_type": "execute_result" 377 | } 378 | ], 379 | "source": [ 380 | "[c for c in text5]" 381 | ] 382 | }, 383 | { 384 | "cell_type": "code", 385 | "execution_count": 32, 386 | "metadata": {}, 387 | "outputs": [], 388 | "source": [ 389 | "text8 = ' A quick brown fox jumped over the lazy dog. '" 390 | ] 391 | }, 392 | { 393 | "cell_type": "code", 394 | "execution_count": 33, 395 | "metadata": {}, 396 | "outputs": [ 397 | { 398 | "data": { 399 | "text/plain": [ 400 | "['',\n", 401 | " '',\n", 402 | " 'A',\n", 403 | " 'quick',\n", 404 | " 'brown',\n", 405 | " 'fox',\n", 406 | " 'jumped',\n", 407 | " 'over',\n", 408 | " 'the',\n", 409 | " 'lazy',\n", 410 | " 'dog.',\n", 411 | " '']" 412 | ] 413 | }, 414 | "execution_count": 33, 415 | "metadata": {}, 416 | "output_type": "execute_result" 417 | } 418 | ], 419 | "source": [ 420 | "text8.split(' ')" 421 | ] 422 | }, 423 | { 424 | "cell_type": "code", 425 | "execution_count": 34, 426 | "metadata": {}, 427 | "outputs": [], 428 | "source": [ 429 | "text9 = text8.strip()" 430 | ] 431 | }, 432 | { 433 | "cell_type": "code", 434 | "execution_count": 35, 435 | "metadata": {}, 436 | "outputs": [ 437 | { 438 | "data": { 439 | "text/plain": [ 440 | "'A quick brown fox jumped over the lazy dog.'" 441 | ] 442 | }, 443 | "execution_count": 35, 444 | "metadata": {}, 445 | "output_type": "execute_result" 446 | } 447 | ], 448 | "source": [ 449 | "text9" 450 | ] 451 | }, 452 | { 453 | "cell_type": "code", 454 | "execution_count": 37, 455 | "metadata": {}, 456 | "outputs": [ 457 | { 458 | "data": { 459 | "text/plain": [ 460 | "10" 461 | ] 462 | }, 463 | "execution_count": 37, 464 | "metadata": {}, 465 | "output_type": "execute_result" 466 | } 467 | ], 468 | "source": [ 469 | "text9.find('o')" 470 | ] 471 | }, 472 | { 473 | "cell_type": "code", 474 | "execution_count": 38, 475 | "metadata": {}, 476 | "outputs": [ 477 | { 478 | "data": { 479 | "text/plain": [ 480 | "40" 481 | ] 482 | }, 483 | "execution_count": 38, 484 | "metadata": {}, 485 | "output_type": "execute_result" 486 | } 487 | ], 488 | "source": [ 489 | "text9.rfind('o')" 490 | ] 491 | }, 492 | { 493 | "cell_type": "code", 494 | "execution_count": 39, 495 | "metadata": {}, 496 | "outputs": [ 497 | { 498 | "data": { 499 | "text/plain": [ 500 | "'A quick brOwn fOx jumped Over the lazy dOg.'" 501 | ] 502 | }, 503 | "execution_count": 39, 504 | "metadata": {}, 505 | "output_type": "execute_result" 506 | } 507 | ], 508 | "source": [ 509 | "text9.replace('o', 'O')" 510 | ] 511 | }, 512 | { 513 | "cell_type": "code", 514 | "execution_count": null, 515 | "metadata": {}, 516 | "outputs": [], 517 | "source": [] 518 | } 519 | ], 520 | "metadata": { 521 | "kernelspec": { 522 | "display_name": "Python 3", 523 | "language": "python", 524 | "name": "python3" 525 | }, 526 | "language_info": { 527 | "codemirror_mode": { 528 | "name": "ipython", 529 | "version": 3 530 | }, 531 | "file_extension": ".py", 532 | "mimetype": "text/x-python", 533 | "name": "python", 534 | "nbconvert_exporter": "python", 535 | "pygments_lexer": "ipython3", 536 | "version": "3.6.4" 537 | } 538 | }, 539 | "nbformat": 4, 540 | "nbformat_minor": 2 541 | } 542 | -------------------------------------------------------------------------------- /Bagian Bonus - Natural Language Processing/2. Regex.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Regular Expression" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 8, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "text10 = '\"Ethics are built right into the ideals and objectives of the United Nations\" \\\n", 17 | "#UNSG @ NY Society for Ethical Culture bit.ly/2guVelr @UN @UN_Women'\n", 18 | "\n" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 9, 24 | "metadata": {}, 25 | "outputs": [ 26 | { 27 | "data": { 28 | "text/plain": [ 29 | "'\"Ethics are built right into the ideals and objectives of the United Nations\" #UNSG @ NY Society for Ethical Culture bit.ly/2guVelr @UN @UN_Women'" 30 | ] 31 | }, 32 | "execution_count": 9, 33 | "metadata": {}, 34 | "output_type": "execute_result" 35 | } 36 | ], 37 | "source": [ 38 | "text10" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": 10, 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "text11 = text10.split(' ')" 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": 11, 53 | "metadata": {}, 54 | "outputs": [ 55 | { 56 | "data": { 57 | "text/plain": [ 58 | "['\"Ethics',\n", 59 | " 'are',\n", 60 | " 'built',\n", 61 | " 'right',\n", 62 | " 'into',\n", 63 | " 'the',\n", 64 | " 'ideals',\n", 65 | " 'and',\n", 66 | " 'objectives',\n", 67 | " 'of',\n", 68 | " 'the',\n", 69 | " 'United',\n", 70 | " 'Nations\"',\n", 71 | " '#UNSG',\n", 72 | " '@',\n", 73 | " 'NY',\n", 74 | " 'Society',\n", 75 | " 'for',\n", 76 | " 'Ethical',\n", 77 | " 'Culture',\n", 78 | " 'bit.ly/2guVelr',\n", 79 | " '@UN',\n", 80 | " '@UN_Women']" 81 | ] 82 | }, 83 | "execution_count": 11, 84 | "metadata": {}, 85 | "output_type": "execute_result" 86 | } 87 | ], 88 | "source": [ 89 | "text11" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": 12, 95 | "metadata": {}, 96 | "outputs": [ 97 | { 98 | "name": "stdout", 99 | "output_type": "stream", 100 | "text": [ 101 | "['#regex', '#pandas', '#python']\n" 102 | ] 103 | } 104 | ], 105 | "source": [ 106 | "tweet = \"@nltk Text analysis is awesome! #regex #pandas #python\"\n", 107 | "\n", 108 | "print([word for word in tweet.split() if word.startswith('#')])" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": 13, 114 | "metadata": {}, 115 | "outputs": [ 116 | { 117 | "name": "stdout", 118 | "output_type": "stream", 119 | "text": [ 120 | "['#UNSG']\n" 121 | ] 122 | } 123 | ], 124 | "source": [ 125 | "print([word for word in text10.split() if word.startswith('#')])" 126 | ] 127 | }, 128 | { 129 | "cell_type": "code", 130 | "execution_count": 16, 131 | "metadata": {}, 132 | "outputs": [ 133 | { 134 | "name": "stdout", 135 | "output_type": "stream", 136 | "text": [ 137 | "['@', '@UN', '@UN_Women']\n" 138 | ] 139 | } 140 | ], 141 | "source": [ 142 | "print([word for word in text11 if word.startswith('@')])" 143 | ] 144 | }, 145 | { 146 | "cell_type": "code", 147 | "execution_count": 2, 148 | "metadata": {}, 149 | "outputs": [], 150 | "source": [ 151 | "import re" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": 17, 157 | "metadata": {}, 158 | "outputs": [ 159 | { 160 | "data": { 161 | "text/plain": [ 162 | "['@UN', '@UN_Women']" 163 | ] 164 | }, 165 | "execution_count": 17, 166 | "metadata": {}, 167 | "output_type": "execute_result" 168 | } 169 | ], 170 | "source": [ 171 | "[w for w in text11 if re.search('@[A-Za-z0-9_]+', w)]" 172 | ] 173 | }, 174 | { 175 | "cell_type": "code", 176 | "execution_count": 18, 177 | "metadata": {}, 178 | "outputs": [ 179 | { 180 | "data": { 181 | "text/plain": [ 182 | "['@UN', '@UN_Women']" 183 | ] 184 | }, 185 | "execution_count": 18, 186 | "metadata": {}, 187 | "output_type": "execute_result" 188 | } 189 | ], 190 | "source": [ 191 | "[w for w in text11 if re.search('@\\w+', w)]" 192 | ] 193 | }, 194 | { 195 | "cell_type": "code", 196 | "execution_count": 20, 197 | "metadata": {}, 198 | "outputs": [], 199 | "source": [ 200 | "text12 = 'ouagadogou'" 201 | ] 202 | }, 203 | { 204 | "cell_type": "code", 205 | "execution_count": 21, 206 | "metadata": {}, 207 | "outputs": [ 208 | { 209 | "data": { 210 | "text/plain": [ 211 | "['o', 'u', 'a', 'a', 'o', 'o', 'u']" 212 | ] 213 | }, 214 | "execution_count": 21, 215 | "metadata": {}, 216 | "output_type": "execute_result" 217 | } 218 | ], 219 | "source": [ 220 | "re.findall(r'[aeiou]', text12)" 221 | ] 222 | }, 223 | { 224 | "cell_type": "code", 225 | "execution_count": 22, 226 | "metadata": {}, 227 | "outputs": [ 228 | { 229 | "data": { 230 | "text/plain": [ 231 | "['g', 'd', 'g']" 232 | ] 233 | }, 234 | "execution_count": 22, 235 | "metadata": {}, 236 | "output_type": "execute_result" 237 | } 238 | ], 239 | "source": [ 240 | "re.findall(r'[^aeiou]', text12)" 241 | ] 242 | }, 243 | { 244 | "cell_type": "markdown", 245 | "metadata": {}, 246 | "source": [ 247 | "# Contoh pada tanggal" 248 | ] 249 | }, 250 | { 251 | "cell_type": "markdown", 252 | "metadata": {}, 253 | "source": [ 254 | " - Bagaiamana menuliskan 23 Oktober 2013\n", 255 | " - 23-10-2013\n", 256 | " - 23/10/2013\n", 257 | " - 23/10/13\n", 258 | " - 10/21/2013\n", 259 | " - 23 Oct 2013\n", 260 | " - 23 October 2013\n", 261 | " - Oct 23, 2013\n", 262 | " - October 23, 2013" 263 | ] 264 | }, 265 | { 266 | "cell_type": "code", 267 | "execution_count": 1, 268 | "metadata": {}, 269 | "outputs": [], 270 | "source": [ 271 | "date_string = '23-10-2013\\n23/10/2013\\n23/10/13\\n10/21/2013\\n23 Oct 2013\\n23 October 2013\\nOct 23, 2013\\nOctober 23, 2013'" 272 | ] 273 | }, 274 | { 275 | "cell_type": "code", 276 | "execution_count": 4, 277 | "metadata": {}, 278 | "outputs": [ 279 | { 280 | "data": { 281 | "text/plain": [ 282 | "['23-10-2013', '23/10/2013', '10/21/2013']" 283 | ] 284 | }, 285 | "execution_count": 4, 286 | "metadata": {}, 287 | "output_type": "execute_result" 288 | } 289 | ], 290 | "source": [ 291 | "re.findall(r'\\d{2}[/-]\\d{2}[/-]\\d{4}', date_string)" 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": 5, 297 | "metadata": {}, 298 | "outputs": [ 299 | { 300 | "data": { 301 | "text/plain": [ 302 | "['23-10-2013', '23/10/2013', '23/10/13', '10/21/2013']" 303 | ] 304 | }, 305 | "execution_count": 5, 306 | "metadata": {}, 307 | "output_type": "execute_result" 308 | } 309 | ], 310 | "source": [ 311 | "re.findall(r'\\d{2}[/-]\\d{2}[/-]\\d{2,4}', date_string)" 312 | ] 313 | }, 314 | { 315 | "cell_type": "code", 316 | "execution_count": 6, 317 | "metadata": {}, 318 | "outputs": [ 319 | { 320 | "data": { 321 | "text/plain": [ 322 | "['23-10-2013', '23/10/2013', '23/10/13', '10/21/2013']" 323 | ] 324 | }, 325 | "execution_count": 6, 326 | "metadata": {}, 327 | "output_type": "execute_result" 328 | } 329 | ], 330 | "source": [ 331 | "re.findall(r'\\d{1,2}[/-]\\d{1,2}[/-]\\d{2,4}', date_string)" 332 | ] 333 | }, 334 | { 335 | "cell_type": "code", 336 | "execution_count": 7, 337 | "metadata": {}, 338 | "outputs": [ 339 | { 340 | "data": { 341 | "text/plain": [ 342 | "['Oct']" 343 | ] 344 | }, 345 | "execution_count": 7, 346 | "metadata": {}, 347 | "output_type": "execute_result" 348 | } 349 | ], 350 | "source": [ 351 | "re.findall(r'\\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4}', date_string)" 352 | ] 353 | }, 354 | { 355 | "cell_type": "code", 356 | "execution_count": 8, 357 | "metadata": {}, 358 | "outputs": [ 359 | { 360 | "data": { 361 | "text/plain": [ 362 | "['23 Oct 2013']" 363 | ] 364 | }, 365 | "execution_count": 8, 366 | "metadata": {}, 367 | "output_type": "execute_result" 368 | } 369 | ], 370 | "source": [ 371 | "re.findall(r'\\d{2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4}', date_string)" 372 | ] 373 | }, 374 | { 375 | "cell_type": "code", 376 | "execution_count": 9, 377 | "metadata": {}, 378 | "outputs": [ 379 | { 380 | "data": { 381 | "text/plain": [ 382 | "['23 Oct 2013', '23 October 2013']" 383 | ] 384 | }, 385 | "execution_count": 9, 386 | "metadata": {}, 387 | "output_type": "execute_result" 388 | } 389 | ], 390 | "source": [ 391 | "re.findall(r'\\d{2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4}', date_string)" 392 | ] 393 | }, 394 | { 395 | "cell_type": "code", 396 | "execution_count": 12, 397 | "metadata": {}, 398 | "outputs": [ 399 | { 400 | "data": { 401 | "text/plain": [ 402 | "['23 Oct 2013', '23 October 2013', 'Oct 23, 2013', 'October 23, 2013']" 403 | ] 404 | }, 405 | "execution_count": 12, 406 | "metadata": {}, 407 | "output_type": "execute_result" 408 | } 409 | ], 410 | "source": [ 411 | "re.findall(r'(?:\\d{2} )?(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]* (?:\\d{2}, )?\\d{4}', date_string)" 412 | ] 413 | }, 414 | { 415 | "cell_type": "code", 416 | "execution_count": 13, 417 | "metadata": {}, 418 | "outputs": [ 419 | { 420 | "data": { 421 | "text/plain": [ 422 | "['23 Oct 2013', '23 October 2013', 'Oct 23, 2013', 'October 23, 2013']" 423 | ] 424 | }, 425 | "execution_count": 13, 426 | "metadata": {}, 427 | "output_type": "execute_result" 428 | } 429 | ], 430 | "source": [ 431 | "re.findall(r'(?:\\d{1,2} )?(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]* (?:\\d{1,2}, )?\\d{4}', date_string)" 432 | ] 433 | }, 434 | { 435 | "cell_type": "code", 436 | "execution_count": null, 437 | "metadata": {}, 438 | "outputs": [], 439 | "source": [] 440 | } 441 | ], 442 | "metadata": { 443 | "kernelspec": { 444 | "display_name": "Python 3", 445 | "language": "python", 446 | "name": "python3" 447 | }, 448 | "language_info": { 449 | "codemirror_mode": { 450 | "name": "ipython", 451 | "version": 3 452 | }, 453 | "file_extension": ".py", 454 | "mimetype": "text/x-python", 455 | "name": "python", 456 | "nbconvert_exporter": "python", 457 | "pygments_lexer": "ipython3", 458 | "version": "3.6.4" 459 | } 460 | }, 461 | "nbformat": 4, 462 | "nbformat_minor": 2 463 | } 464 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # 👥 Contributors 2 | 3 | Daftar orang yang telah berkontribusi. 4 | 1. Sebastianus Sembara (github: ssembara) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2018 Google, Inc. http://angularjs.org 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Data Science With Python 2 | > Belajar Data Science secara praktis menggunakan Python 3 | 4 | ## Pemasangan (Installation) dan Penggunaan Pertama 5 | 6 | Silahkan download [Anaconda](https://anaconda.com/download). Install sesuai dengan sistem operasi masing - masing. Setelah itu clone / download repositori ini ke folder kalian inginkan. 7 | 8 | ## Menggunakan Anaconda Navigator 9 | 10 | - MacOS dan Linux: 11 | - Buka terminal, kemudian ketik 12 | 13 | ```sh 14 | $ anaconda-navigator 15 | ``` 16 | 17 | - Windows: 18 | - Buka launcher windows, kemudian pilih program Anaconda Navigator 19 | 20 | Tampilan Anaconda Navigator akan seperti ini. 21 | 22 | ![Anaconda Navigator](images/anaconda-navigator.png) 23 | 24 | Silahkan launch jupyter lab / jupyter notebook kemudian navigasi ke folder yang telah kalian simpan. 25 | 26 | ## Menggunakan Terminal atau Anaconda Prompt 27 | 28 | - MacOS dan Linux: 29 | - Buka terminal, kemudian ketik 30 | 31 | ```sh 32 | $ jupyter-lab 33 | ``` 34 | 35 | atau 36 | 37 | ```sh 38 | $ jupyter notebook 39 | ``` 40 | 41 | - Windows: 42 | - Buka Anaconda Prompt, kemudian ketik 43 | 44 | ```sh 45 | C:\> jupyter-lab 46 | ``` 47 | 48 | atau 49 | 50 | ```sh 51 | C:\> jupyter notebook 52 | ``` 53 | 54 | Kemudian navigasi ke folder yang telah kalian simpan. 55 | 56 | ## Tampilan Jupyter-lab 57 | 58 | ![jupyter-notebook](images/jupyter-lab.png) 59 | 60 | ## Tampilan Jupyter Notebook 61 | ![jupyter-notebook](images/jupyter-notebook.png) 62 | 63 | ## NLP Dataset 64 | - NLP dataset dapat diunduh [disini](https://drive.google.com/file/d/1IX9cWMwzc4v8lLivk19k2LV2JrCj0KD1/view?usp=sharing") 65 | ## Inspirasi 66 | 67 | Materi repositori ini terinspirasi setelah saya menyelesaikan [Data Camp](https://datacamp.com) Data Science Python Career Track. Semua data yang dipergunakan di repositori ini terdapat pada DataCamp. Silahkan kunjungi DataCamp karena merupakan tempat yang keren untuk memulai belajar Data Science. 68 | 69 | ## Lisensi 70 | 71 | Didistribusikan menggunakan lisensi MIT. Silahkan melihat `` LICENSE `` untuk lebih lanjut 72 | 73 | ## Kontribusi 74 | 1. Silahkan di Fork 75 | 2. Buat branch baru (`git checkout -b feature/fooBar`) 76 | 3. Silahkan isi nama anda beserta tautan github anda di CONTRIBUTORS.md 77 | 4. Commit perubahan yang ada(`git commit -am 'Add some fooBar'`) 78 | 5. Push pada branch yang sudah ada (`git push origin feature/fooBar`) 79 | 6. Buat sebuah Pull Request baru -------------------------------------------------------------------------------- /images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/images/.DS_Store -------------------------------------------------------------------------------- /images/anaconda-navigator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/images/anaconda-navigator.png -------------------------------------------------------------------------------- /images/jupyter-lab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/images/jupyter-lab.png -------------------------------------------------------------------------------- /images/jupyter-notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubiagatra/data-science-with-python/793b52f19ce7b5b9175dd1eb5e67a46f4196b634/images/jupyter-notebook.png --------------------------------------------------------------------------------