diff --git a/01_ea.ipynb b/01_ea.ipynb new file mode 100644 index 0000000..9d0b8c8 --- /dev/null +++ b/01_ea.ipynb @@ -0,0 +1,1027 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## A Jupyter Notebook környezet\n", + "\n", + "- A [Jupyter Notebook](https://jupyter-notebook.readthedocs.io/en/stable/) egy böngésző alapú, interaktív munkakörnyezet.\n", + "- Elsődlegesen a Python nyelvhez fejlesztették ki, de más programozási nyelvekkel is használható.\n", + "- Egy notebook cellákból áll, a cellák lehetnek szöveges (Markdown) vagy kód (Code) típusúak.\n", + "- A kódcellákat le lehet futtatni, akár többször is egymás után. A futtatás eredménye megjelenik az adott kódcella utáni kimenetben.\n", + "- A notebook használata kétféle üzemmódban történik:\n", + " + Parancsmódban tudjuk elvégezni a cellaszintű műveleteket (pl. új cella beszúrása, cella törlése, cellák mozgatása, lépegetés a cellák között, stb). Néhány billentyűparancs:\n", + " - ```b```: Új kódcella beszúrása az aktuális cella után.\n", + " - ```m```: Az aktuális cella típusának átállítása szövegesre.\n", + " - ```dd```: Az aktuális cella törlése.\n", + " - ```Enter```: Átlépés szerkesztőmódba (az aktuális cella tartalmának szerkesztése).\n", + " + Szerkesztőmódban tudjuk szerkeszteni a cellák tartalmát. Néhány billentyűparancs:\n", + " - ```Ctrl+Enter```: Az aktuális cella futtatása.\n", + " - ```Esc```: Visszalépés parancsmódba.\n", + "- A billentyűparancsokról a Help / Keyboard Shortcuts menü ad részletesebb leírást." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Egyszerű adattípusok" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Egész szám](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A számok között a szokásos módon végezhetünk műveleteket.\n", + "1 + 1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzések:\n", + "- A szóközök nem számítanak, a fenti írásmód a PEP 8 kódolási stílust követi.\n", + "- A Jupyter a futtatás után megjeleníti a cella utolsó kifejezését." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "20" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ha szeretnénk felülbírálni a precedenciát, használjunk zárójelezést!\n", + "(2 + 3) * 4" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A Python képes tetszőleges hosszúságú egész számokkal dolgozni, nincsen túlcsordulási hiba.\n", + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 + 1" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy i nevű változót, és tegyük bele a 11 értéket!\n", + "i = 11" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzések:\n", + "- Az = az értékadás műveleti jele.\n", + "- i felveszi a megadott értéket, de magának az értékadásnak nincs eredménye. Emiatt a cella kimenete üres." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "22" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A változóra a továbbiakban is lehet hivatkozni.\n", + "i * 2" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# A változó értéke természetesen változtatható.\n", + "i = 42" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "42" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "i" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# Az értékadást lehet kombinálni a többi művelettel.\n", + "i += 1 # ekvivalens az i = i + 1 értékadással" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "43" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "i" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.3333333333333335" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Lebegőpontos osztás.\n", + "7 / 3" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egészosztás (levágja a törtrészt). Sok hibalehetőséget megelőz, hogy külön műveleti jele van.\n", + "7 // 3" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Maradékképzés.\n", + "7 % 3" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1024" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Van hatványozás is, ** a műveleti jele.\n", + "2**10" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Lebegőpontos szám](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)\n", + "\n", + "- A [lebegőpontos számábrázolás](https://hu.wikipedia.org/wiki/Lebeg%C5%91pontos_sz%C3%A1m%C3%A1br%C3%A1zol%C3%A1s) lehetővé teszi a valós számokkal történő, közelítő számolást.\n", + "- A Python lebegőpontos típusa az IEEE-754 szabvány dupla pontosságú (64 bites double) típusát valósítja meg." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3.44" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Lebegőpontos állandókat a tizedespont használatával tudunk megadni.\n", + "2.34 + 1.1" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.4142135623730951" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Gyök kettő (közelítő) kiszámítása.\n", + "2**0.5" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy f nevű, lebegőpontos típusú változót!\n", + "f = 2.6" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "float" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A type függvénnyel tudjuk lekérdezni f típusát.\n", + "type(f)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "int" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...vagy bármely más érték típusát.\n", + "type(2 * 3 - 10)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "# Tegyünk most f-be egy int típusú értéket!\n", + "# Python-ban ez minden probléma nélkül megtehető.\n", + "f = 20" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "20" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "int" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Komplex szám](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)\n", + "- A Python támogatja a komplex számokkal való számolást, külső könyvtárak használata nélkül." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(-0.2+0.4j)" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Osztás algebrai alakban.\n", + "(1 + 2j) / (3 - 4j)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(3.6709073923227765e-14+1j)" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A képzetes egység hatványozása.\n", + "1j**2021" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Sztring](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)\n", + "\n", + "- A sztring adattípus szöveges értékek tárolására szolgál.\n", + "- Pythonban a sztring nem más mint [Unicode](https://hu.wikipedia.org/wiki/Unicode) szimbólumok (másnéven Unicode karakterek) nem módosítható sorozata." + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'alma'" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A sztringállandót ' jelekkel határoljuk.\n", + "'alma'" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'körte'" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...de lehet használni \" jeleket is.\n", + "\"körte\"" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "alma\n" + ] + } + ], + "source": [ + "# Az előző cellák kimenetében a ' nem a sztring része, csak az adattípust jelzi.\n", + "# Írjuk ki a sztring tartalmát, határoló jelek nélkül!\n", + "print('alma')" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "str" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A type függvény most is működik.\n", + "type('alma')" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'I ♥ ♬'" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Unicode szimbólumokat tartalmazó sztring.\n", + "'I ♥ ♬'" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A sztring hossza (Unicode szimbólumok száma):\n", + "len('I ♥ ♬')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Logikai érték](https://docs.python.org/3/library/stdtypes.html#boolean-values)\n", + "- A logikai igaz értéket a *True*, a hamisat a *False* jelöli. A nagy kezdőbetű fontos, a Python különbözőnek tekinti a kis- és nagybetűket." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre logikai típusú változót!\n", + "b = True" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "bool" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(b)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n" + ] + } + ], + "source": [ + "# Logikai ÉS művelet.\n", + "print(True and True)\n", + "print(True and False)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n", + "True\n" + ] + } + ], + "source": [ + "# Logikai VAGY művelet.\n", + "print(False or False)\n", + "print(False or True)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Logikai tagadás.\n", + "not True" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az összehasonlító műveletek eredménye logikai érték.\n", + "2 < 3" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "5 >= 11" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Pythonban az egyenlőségvizsgálat műveleti jele ==.\n", + "2 == 3" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "4 == 4" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "10 != 20 # != jelentése: nem egyenlő" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [None](https://docs.python.org/3/library/stdtypes.html#the-null-object)\n", + "- A szó jelentése *semmi* vagy *egyik sem*. A Pythonban a None értéknek helykitöltő szerepe van. Ezzel jelölhetjük pl. a hiányzó vagy érvénytelen eredményt vagy az alapértelmezett beállítást. " + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "NoneType" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A None érték típusa.\n", + "type(None)" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "# Ha a cella utolsó kifejezése None értékű, akkor nincs kimenet.\n", + "1 + 1\n", + "None" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Konverzió\n", + "\n", + "Az adattípusok neve függvényként használható az adott adattípusra való konvertálásra, amennyiben a konverziónak van értelme." + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "12" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int('12') # str => int" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int(2.7) # float => int" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int(True) # bool => int" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.7" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "float('2.7') # str => float" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "bool(0) # int => bool" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "invalid literal for int() with base 10: 'sör'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[47], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28mint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msör\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", + "\u001b[1;31mValueError\u001b[0m: invalid literal for int() with base 10: 'sör'" + ] + } + ], + "source": [ + "int('sör')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/01_gyak.ipynb b/01_gyak.ipynb new file mode 100644 index 0000000..29ffffd --- /dev/null +++ b/01_gyak.ipynb @@ -0,0 +1,156 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg az 1. előadás anyagát tartalmazó Jupyter notebook (01_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Határozzuk meg az alábbi kifejezések értékét! Ahol szükséges, ott használjunk változókat, amelyek értékeit értékadó utasításokkal adjuk meg! Az eredményeket jelenítsük meg kétféle módon is: kifejezésként megadva, ill. a print függvény segítségével!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Hányszor van meg a 111-ben a 27 és mennyi a maradék?\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Egy síkbeli pont távolsága az origótól\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Egy adott sugarú kör területe és kerülete\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Egy adott karakter ASCII kódja\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Egy adott karakter angol kisbetű-e?\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Egy komplex szám abszolút értéke\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Négyzetgyök 2 értéke komplex szám(ok) segítségével meghatározva\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Használjuk a type függvényt különféle típusú kifejezések eredménytípusának a meghatározására!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Próbáljon ki néhány típuskonverziót!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Mutassa meg, hogy az előjel vagy a hatványozás művelet az erősebb prioritású a Python-ban!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Házi feladatok\n", + "- Két adott, zárt intervallum a valós számagyenesen átfed-e vagy sem?\n", + "- Két adott, síkbeli körnek van-e közös pontja vagy sem?\n", + "- Készítsünk kifejezést a kizáró vagy (xor) logikai műveletre! Ez egy kétoperandusú művelet, ami pontosan akkor igaz, ha az egyik operandus igaz, a másik nem!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/02_ea.ipynb b/02_ea.ipynb new file mode 100644 index 0000000..e43f253 --- /dev/null +++ b/02_ea.ipynb @@ -0,0 +1,702 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Standard adatfolyamok](https://en.wikipedia.org/wiki/Standard_streams)\n", + "\n", + "Az operációs rendszer indításkor minden folyamathoz hozzárendel 3 szabványos adatfolyamot: a [standard bemenetet](https://docs.python.org/3/library/sys.html#sys.stdin), a [standard kimenetet](https://docs.python.org/3/library/sys.html#sys.stdout), és a [standard hibakimenetet](https://docs.python.org/3/library/sys.html#sys.stderr). Alapértelmezés szerint a standard bemenet a billentyűzettel, a standard kimenet és hibakimenet pedig a képernyővel van összekötve. Ez a beállítás módosítható, pl. a standard bemenet érkezhet egy fájlból vagy egy másik programból, a standard kimenet és hibakimenet pedig íródhat fájlba vagy továbbítódhat másik programnak." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Standard bemenet\n", + "\n", + "- A standard bemenetről adatokat bekérni az [input](https://docs.python.org/3/library/functions.html#input) függvény segítségével lehet.\n", + "- Az eredmény sztring típusú. Ha más adattípusra van szükség, akkor a konvertálni kell." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kérek egy szöveget: alma\n" + ] + }, + { + "data": { + "text/plain": [ + "'alma'" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sztring típusú adat beolvasása.\n", + "s = input('Kérek egy szöveget: ')\n", + "s" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kérek egy egész számot: 23\n" + ] + }, + { + "data": { + "text/plain": [ + "23" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egész típusú adat beolvasása.\n", + "n = int(input('Kérek egy egész számot: '))\n", + "n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Standard kimenet és hibakimenet\n", + "\n", + "- A standard kimenetre és hibakimenetre kiírni a [print](https://docs.python.org/3/library/functions.html#print) függvény segítségével lehet." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "hello\n", + "bello\n" + ] + } + ], + "source": [ + "# Kiírás a standard kimenetre.\n", + "print('hello')\n", + "print('bello')" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "hellobello" + ] + } + ], + "source": [ + "# Kiírás soremelés nélkül.\n", + "print('hello', end='')\n", + "print('bello', end='')" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "# Egyetlen soremelés kiírása.\n", + "print()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Hiba történt!\n" + ] + } + ], + "source": [ + "# Kiírás a standard hibakimenetre.\n", + "import sys\n", + "print('Hiba történt!', file=sys.stderr)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Formázott kiírás](https://docs.python.org/3/tutorial/inputoutput.html#fancier-output-formatting)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Az első megoldás 2.5, a második megoldás 4.78.\n" + ] + } + ], + "source": [ + "# Formázott kiírás f-sztringgel.\n", + "x1 = 2.5\n", + "x2 = 4.78\n", + "print(f'Az első megoldás {x1}, a második megoldás {x2}.')" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "első megoldás: 2.5, második megoldás: 4.8\n" + ] + } + ], + "source": [ + "# Kiírás 1 tizedesjegy pontossággal.\n", + "print(f'első megoldás: {x1:.1f}, második megoldás: {x2:.1f}')" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "egész szám: 42, sztring: alma\n" + ] + } + ], + "source": [ + "# Egész szám ill. sztring kiírása.\n", + "i = 42\n", + "s = 'alma'\n", + "print(f'egész szám: {i}, sztring: {s}')" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Az első megoldás 2.500000, a második megoldás 4.780000.\n" + ] + } + ], + "source": [ + "# Formázott kiírás % operátorral.\n", + "x1 = 2.5\n", + "x2 = 4.78\n", + "print('Az első megoldás %f, a második megoldás %f.' % (x1, x2))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Az első megoldás 2.5, a második megoldás 4.8.\n" + ] + } + ], + "source": [ + "# Kiírás 1 tizedesjegy pontossággal.\n", + "print('Az első megoldás %.1f, a második megoldás %.1f.' % (x1, x2))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Az első megoldás 2.500\n" + ] + } + ], + "source": [ + "# Kiírás adott tizedesjegy pontossággal.\n", + "t = 3\n", + "print(f'Az első megoldás {x1:.{t}f}')" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Az első megoldás 2.500\n" + ] + } + ], + "source": [ + "# Kiírás adott tizedesjegy pontossággal.\n", + "t = 3\n", + "print('Az első megoldás %.*f' % (t, x1))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "egész szám: 42, sztring: alma\n" + ] + } + ], + "source": [ + "# Egész szám ill. sztring kiírása.\n", + "i = 42\n", + "s = 'alma'\n", + "print('egész szám: %d, sztring: %s' % (i, s))" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Egy meg egy az 2.'" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Megjegyzés: A f-sztring ill. a % operátor\n", + "# kiírás nélkül is alkalmazható, sztringműveletként.\n", + "f'Egy meg egy az {1 + 1}.'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Vezérlési szerkezetek\n", + "\n", + "- Pythonban a vezérlési szerkezetek belsejét indentálással (azaz beljebb írással) kell jelölni.\n", + "- Emiatt garantált, hogy a program megjelenése és logikai jelentése összhangban van." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [if utasítás](https://docs.python.org/3/reference/compound_stmts.html#the-if-statement)\n", + "\n", + "- Szintaxis:\n", + "```\n", + " if FELTÉTEL1:\n", + " UTASÍTÁS1\n", + " elif FELTÉTEL2:\n", + " UTASÍTÁS2\n", + " else:\n", + " UTASÍTÁS3\n", + "```\n", + "\n", + "- Működés:\n", + "``` \n", + " +-----------+ igaz +-----------+\n", + " --->| FELTÉTEL1 |---+-------->| UTASÍTÁS1 |-----------------------------+--->\n", + " +-----------+ | +-----------+ |\n", + " | |\n", + " | hamis +-----------+ igaz +-----------+ |\n", + " +-------->| FELTÉTEL2 |---+-------->| UTASÍTÁS2 |---+\n", + " +-----------+ | +-----------+ |\n", + " | |\n", + " | hamis +-----------+ |\n", + " +-------->| UTASÍTÁS3 |---+\n", + " +-----------+\n", + "```\n", + "- Megjegyzések:\n", + " + Több elif ág is szerepelhet.\n", + " + Az elif ágak és az else ág is elhagyható.\n", + " + Ha az utasítás 1 soros, akkor írható az if-fel elif-fel ill. az else-szel azonos sorba." + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hány éves vagy? 16\n", + "Sajnos nem adhatok sört.\n" + ] + } + ], + "source": [ + "# Példa: Kérsz sört?\n", + "x = int(input('Hány éves vagy? '))\n", + "if x < 18:\n", + " print('Sajnos nem adhatok sört.') \n", + "else:\n", + " print('Kérsz sört?')" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a: 1\n", + "b: -3\n", + "c: 2\n", + "x1=2.0, x2=1.0\n" + ] + } + ], + "source": [ + "# Példa: Másodfokú egyenlet megoldó.\n", + "\n", + "# együtthatók bekérése\n", + "a = float(input('a: '))\n", + "b = float(input('b: '))\n", + "c = float(input('c: '))\n", + "\n", + "# diszkrimináns kiszámítása\n", + "d = b**2 - 4 * a * c\n", + "\n", + "# elágazás\n", + "if d > 0: \n", + " # 2 megoldás\n", + " x1 = (-b + d**0.5) / (2 * a)\n", + " x2 = (-b - d**0.5) / (2 * a)\n", + " print(f'x1={x1}, x2={x2}')\n", + "elif d == 0: \n", + " # 1 megoldás\n", + " x1 = -b / (2 * a)\n", + " print(f'x1={x1}')\n", + "else:\n", + " # 0 megoldás\n", + " print('Nincs valós megoldása.')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [while utasítás](https://docs.python.org/3/reference/compound_stmts.html#the-while-statement)\n", + "\n", + "- Szintaxis:\n", + "```\n", + " while FELTÉTEL:\n", + " UTASÍTÁS\n", + "```\n", + "\n", + "- Működés:\n", + "```\n", + " +----------+ igaz\n", + " +<-----| UTASÍTÁS |--------+\n", + " | +----------+ |\n", + " | |\n", + " | +----------+ | hamis\n", + " ---+----->| FELTÉTEL |--------+-------->\n", + " +----------+ \n", + "```\n", + "- Megjegyzések:\n", + " + Egy jól megírt program esetén az utasítás a feltételt előbb-utóbb hamisra állítja. (Ellenkező esetben, ha a feltétel igaz, akkor az is marad, így végtelen ciklus keletkezik.)\n", + " + Akkor érdemes while ciklust alkalmazni, ha a ciklus elején még nem tudjuk pontosan az iterációk számát." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hány pontot értél el? 10\n", + "Sajnos nem sikerült. Tanulj még!\n", + "Hány pontot értél el? 8\n", + "Sajnos nem sikerült. Tanulj még!\n", + "Hány pontot értél el? 12\n", + "Gratulálok, átmentél!\n" + ] + } + ], + "source": [ + "# Példa: Móricka a programozásvizsgán.\n", + "while int(input('Hány pontot értél el? ')) < 12:\n", + " print('Sajnos nem sikerült. Tanulj még!')\n", + "print('Gratulálok, átmentél!')" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "# Példa végtelen ciklusra.\n", + "#while True:\n", + "# pass # üres utasítás" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [for utasítás](https://docs.python.org/3/reference/compound_stmts.html#the-for-statement)\n", + "\n", + "- Szintaxis:\n", + "```\n", + " for ELEM in SZEKVENCIA:\n", + " UTASÍTÁS\n", + "```\n", + "\n", + "- Működés:\n", + "```\n", + " +----------+ van még elem\n", + " +<-----| UTASÍTÁS |<----------------+ \n", + " | +----------+ |\n", + " | |\n", + " | +---------------------+ |\n", + " ------+----->| vegyük a SZEKVENCIA |------+------------------->\n", + " | következő ELEMÉt | nincs több elem\n", + " +---------------------+\n", + "```\n", + "- Megjegyzések:\n", + " + A szekvencia lehet egész számok folytonos sorozata, de lehet más is (pl. sztring, tuple, lista, halmaz, szótár, megnyitott fájl).\n", + " + Akkor érdemes for ciklust alkalmazni, ha A) a szekvencia már rendelkezésre áll vagy B) a ciklus kezdetekor tudjuk az iterációk számát." + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "range(0, 5)" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Értéktartomány (range) létrehozása.\n", + "r = range(5)\n", + "r" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[0, 1, 2, 3, 4]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(r)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(range(10, 20))" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[3, 5, 7, 9, 11]" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(range(3, 12, 2))" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "n: 5\n", + "1\n", + "4\n", + "9\n", + "16\n", + "25\n" + ] + } + ], + "source": [ + "# Példa: Első n négyzetszám kiírása.\n", + "n = int(input('n: '))\n", + "for i in range(1, n + 1):\n", + " print(i**2)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "n: 5\n", + "*****" + ] + } + ], + "source": [ + "# Példa: n darab * karakter kiírása.\n", + "n = int(input('n: '))\n", + "for i in range(n):\n", + " print('*', end='')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/02_gyak.ipynb b/02_gyak.ipynb new file mode 100644 index 0000000..d169429 --- /dev/null +++ b/02_gyak.ipynb @@ -0,0 +1,109 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 2. heti előadás anyagát tartalmazó Jupyter notebook (02_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Készítsünk programokat az alábbi feladatokra!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Szekvencia\n", + "- Adott egy téglatest három oldalának a hossza. Határozzuk meg a test térfogatát és felszínét!\n", + "- Adott két hallgató a nevével és a tanulmányi átlageredményével. Írjuk ki az adatokat két sorban úgy, hogy egy sorban egy hallgató legyen a két adatával, először a név, aztán az eredmény. Az eredmények legyenek 2 tizedesjegyűek és egymás alá igazítottak!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Szelekció\n", + "- Adott két szám, mint input adat. Kérjük be őket és írjuk ki a kisebbiket! Pl. 3, 2 -> 2; 1, 1 -> 1. A megoldáshoz ne használja a min függvényt!\n", + "- Oldjuk meg a fentebbi két hallgató adatainak kiírását abban az esetben is, amikor nem tudjuk a nevek, ill. az érdemjegyek maximális hosszát (pl. az eredmények ne 1-től 5-ig terjedő valós számok, hanem tetszőleges valós számok legyenek)!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Iteráció\n", + "- Írjuk ki 1-től 10-ig az egész számokat (mindkét ciklusfajtával)!\n", + "- Csak a páros számokat írjuk ki (az előbbi intervallumból)!\n", + "- Általánosítsuk az előző feladatot egy $[a, b]$ zárt intervallumba eső, $c$-vel maradék nélkül osztható egész számok kiírására, ahol $a, b, c$ egész számok!\n", + "- A számokat egy sorba írjuk ki (egy-egy szóközzel elválasztva)!\n", + "- Írjuk ki a valós számokat 0-tól 1-ig egytizedes lépésekkel!\n", + "- Írjunk ki egy $nxn$ -es háromszöget * karakterekből két, egymásba ágyazott for ciklussal!\n", + "- Döntsük el két, pozitív egész számról azt, hogy [relatív prímek](https://hu.wikipedia.org/wiki/Relatív_prímek)-e vagy sem!\n", + "- Határozzuk meg a [binomiális együttható](https://hu.wikipedia.org/wiki/Binomiális_együttható) értékét adott $n>0$ és $n>=k>0$ egész számokra!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Házi feladatok\n", + "- Egy szobát szeretnénk kifesteni. Ismerjuk a szoba (mint téglatest) három oldalának hosszát (méterben), az ablakok és az ajtók összes felületét (négyzetméterben), valamint azt, hogy 1 liter festék hány négyzetméter lefestésére elegendő. Meghatározandó, hogy hány liter festék szükséges a szoba falainak és mennyezetének egyszeri lefestéséhez (a padlót, az ablakokat és az ajtókat nem kell lefesteni)!\n", + "- Kérjünk be három számot és írjuk ki a legkisebbet! A megoldáshoz ne használja a min függvényt!\n", + "- Határozzuk meg két adott, síkbeli egyenes metszéspontját!\n", + "- Bővítsük az előadás másodfokú egyenlet megoldó programját úgy, hogy az komplex gyököket is meghatározzon!\n", + "- Képzeljünk el egy olyan céltáblát, aminek a középpontja az origó és a találati körök sugara egyesével nő, azaz a legkisebb kör 1, a legnagyobb 10 sugarú. Meghatározandó egy adott lövés (mint síkbeli pont) találata! Ha a lövés a legkisebb (1 sugarú) körben van, akkor 10-t ér, ha abban nincs, de a 2 sugarú körben benne van, akkor 9-t, és így tovább. Ha a 10-es sugarú körben sincs benne, akkor 0-t ér. Egy köríven lévő pontot a körbe esőnek vegyünk (pl. az (1, 0) pont 10-est ér). A megoldást (lehetőleg) ne egy 11 ágú szelekcióval (vagy iterációval) végezzük!\n", + "- Határozzuk meg két pozitív egész szám legnagyobb közös osztóját, ill. legkisebb közös többszörösét!\n", + "- Írjuk ki a [Pascal háromszög](https://hu.wikipedia.org/wiki/Pascal-háromszög) első $n$ darab sorát, ahol $n$ értéke legyen input adat!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/03_ea.ipynb b/03_ea.ipynb new file mode 100644 index 0000000..f6b8b91 --- /dev/null +++ b/03_ea.ipynb @@ -0,0 +1,1066 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### A [math](https://docs.python.org/3/library/math.html) modul\n", + "- Alapvető matematikai függvényeket tartalmaz.\n", + "- Jótanács: Egy NumPy (lásd később) alapú kódban ne a math modul függvényeit használjuk, hanem a NumPy beépített függvényeit!" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# A math modul importálása.\n", + "import math" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.718281828459045" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Exponenciális függvény.\n", + "math.exp(1)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.302585092994046" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Természetes alapú logaritmus.\n", + "math.log(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3.0" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Adott alapú (most 2-es) logaritmus.\n", + "math.log(8, 2)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.0" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Trigonometrikus függvények és inverzeik (a szöget radiánban adjuk meg).\n", + "math.sin(0)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.0" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "math.cos(0)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.0" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "math.asin(0)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.0" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "math.acos(1)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3.141592653589793" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Fok => radián átváltás.\n", + "math.radians(180)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "179.99469134034814" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Radián => fok átváltás.\n", + "math.degrees(3.1415)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.9999999999999999" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "math.tan(math.radians(45))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3.141592653589793" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# pi\n", + "math.pi" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.718281828459045" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# e\n", + "math.e" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Sztring](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)\n", + "\n", + "- A sztring adattípus szöveges értékek tárolására szolgál.\n", + "- Python-ban a sztring nem más mint [Unicode](https://hu.wikipedia.org/wiki/Unicode) szimbólumok (másnéven Unicode karakterek) nem módosítható sorozata." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'alma'" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A sztringállandót ' jelekkel határoljuk.\n", + "'alma'" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'körte'" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...de lehet használni \" jeleket is.\n", + "\"körte\"" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "alma\n" + ] + } + ], + "source": [ + "# Az előző cellák kimenetében a ' nem a sztring része, csak az adattípust jelzi.\n", + "# Írjuk ki a sztring tartalmát, határoló jelek nélkül!\n", + "print('alma')" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "str" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A type függvény most is működik.\n", + "type('alma')" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'I ♥ ♬'" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A sztringben természetesen használhatunk Unicode szimbólumokat.\n", + "'I ♥ ♬'" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "foo\"bar\n", + "foo'bar\n" + ] + } + ], + "source": [ + "# A kétféle határoló értelme:\n", + "print('foo\"bar')\n", + "print(\"foo'bar\")" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "foo'bar\n", + "foo\"bar\n" + ] + } + ], + "source": [ + "# ...egyébként le kéne védeni az ' ill. \" karaktert.\n", + "print('foo\\'bar')\n", + "print(\"foo\\\"bar\")" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy s nevű sztringváltozót!\n", + "s = 'sör'" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'s'" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# s karaktereinek kinyerése. Az indexelés 0-tól indul!\n", + "s[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'ö'" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "s[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'r'" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "s[2]" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "str" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A kinyert karaktert egy 1 hosszú sztring formájában kapjuk vissza.\n", + "type(s[0])" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "ename": "IndexError", + "evalue": "string index out of range", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[26], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Túlindexelés esetén hibaüzenetet kapunk.\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m s[\u001b[38;5;241m3\u001b[39m]\n", + "\u001b[1;31mIndexError\u001b[0m: string index out of range" + ] + } + ], + "source": [ + "# Túlindexelés esetén hibaüzenetet kapunk.\n", + "s[3]" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'str' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[27], line 3\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# A sztring karaktereit nem lehet módosítani!\u001b[39;00m\n\u001b[0;32m 2\u001b[0m \u001b[38;5;66;03m# (Majd később meglátjuk, hogy miért.)\u001b[39;00m\n\u001b[1;32m----> 3\u001b[0m s[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m'\u001b[39m\n", + "\u001b[1;31mTypeError\u001b[0m: 'str' object does not support item assignment" + ] + } + ], + "source": [ + "# A sztring karaktereit nem lehet módosítani!\n", + "# (Majd később meglátjuk, hogy miért.)\n", + "s[0] = 'b'" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "# Természetesen s-nek adhatunk új értéket.\n", + "s = 'xör'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzés: Az értékadás megtörténik, de magának az értékadó kifejezésnek nincs eredménye. Emiatt a cellának nincsen kimenete." + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xör\n" + ] + } + ], + "source": [ + "# Írjuk ki s tartalmát!\n", + "print(s)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A sztring hossza (Unicode szimbólumok száma):\n", + "len('Béla♥')" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'sörbor'" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sztringek összefűzése.\n", + "'sör' + 'bor'" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tartalmazásvizsgálat.\n", + "'ka' in 'abrakadabra'" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "'xyz' in 'abrakadabra'" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "b'B\\xc3\\xa9la\\xe2\\x99\\xa5'" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sztringből a kódolás műveletével képezhetünk bájtsorozatot.\n", + "'Béla♥'.encode('utf-8')" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "bytes" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az eredmény típusa.\n", + "type('Béla♥'.encode('utf-8'))" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A bájtok száma nagyobb lehet, mint a Unicode szimbólumok száma!\n", + "len('Béla♥'.encode('utf-8'))" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "2\n", + "2\n", + "2\n", + "2\n", + "2\n", + "2\n", + "2\n", + "2\n" + ] + } + ], + "source": [ + "# Hány bájton tárolódnak a magyar ábécé ékezetes kisbetűi UTF-8 kódolás esetén?\n", + "print(len('á'.encode('utf-8')))\n", + "print(len('é'.encode('utf-8')))\n", + "print(len('í'.encode('utf-8')))\n", + "print(len('ó'.encode('utf-8')))\n", + "print(len('ö'.encode('utf-8')))\n", + "print(len('ő'.encode('utf-8')))\n", + "print(len('ú'.encode('utf-8')))\n", + "print(len('ü'.encode('utf-8')))\n", + "print(len('ű'.encode('utf-8')))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "🤔🤔🤔 A fenti kód tele van ismétléssel. Gyakorlaton feladat lesz ezt rövidebben megoldani!" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n", + "3\n" + ] + } + ], + "source": [ + "# Hány bájton tárolódik a ♥ és a ♬ szimbólum?\n", + "print(len('♥'.encode('utf-8')))\n", + "print(len('♬'.encode('utf-8')))" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Béla♥'" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Bájtsorozatból a dekódolás műveletével képezhetünk sztringet.\n", + "b'B\\xc3\\xa9la\\xe2\\x99\\xa5'.decode('utf-8')" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "''" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Üres sztring létrehozása.\n", + "''" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len('')" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'valami'" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Fehér karakterek (szóköz, tabulátor, sortörés) eltávolítása a sztring elejéről és végéről.\n", + "' valami\\t\\n'.strip()" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'valami'" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Megadott karakterek eltávolítása a sztring elejéről és végéről.\n", + "'++++valami---++----'.strip('+-')" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'álmos'" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Kisbetűssé alakítás.\n", + "'Álmos'.lower()" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'KUTYA13'" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Nagybetűssé alakítás.\n", + "'kutya13'.upper()" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'hahaha'" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sztring ismétlése.\n", + "'ha' * 3" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a\n", + "l\n", + "m\n", + "a\n" + ] + } + ], + "source": [ + "# Iterálás egy sztring karakterein.\n", + "s = 'alma'\n", + "for c in s:\n", + " print(c)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a\n", + "l\n", + "m\n", + "a\n" + ] + } + ], + "source": [ + "# Iterálás egy sztring karakterein index segítségével.\n", + "s = 'alma'\n", + "for i in range(len(s)):\n", + " print(s[i])" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [], + "source": [ + "# A random modul importálása\n", + "import random" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n" + ] + } + ], + "source": [ + "# A random modul randint függvényének használata\n", + "# Egy véletlen 5-ös lottószám generálása\n", + "print(random.randint(1, 90))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/03_gyak.ipynb b/03_gyak.ipynb new file mode 100644 index 0000000..cefc777 --- /dev/null +++ b/03_gyak.ipynb @@ -0,0 +1,77 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 3. heti előadás anyagát tartalmazó Jupyter notebook (03_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Próbáljunk ki (hívjunk meg) néhány, sztringekhez tartozó metódust (pl. count, strip, ... )!\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Készítsünk programokat az alábbi feladatokra!\n", + "- Határozzuk meg egy komplex szám konjugáltját, valós és képzetes részét!\n", + "- Számoljuk ki 60 fok színuszát! Ellenőrizzük a megoldást úgy, hogy kiszámoljuk négyzetgyök 3 felét is!\n", + "- Határozzuk meg egy polárkoordinátákkal adott (r, φ) síkbeli pont derékszögű koordinátáit! A φ szög fokban adott! Pl. (1, 90) -> (0, 1)\n", + "- Alakítsunk át egy angol kisbetűt úgy, hogy az ábécé következő karakterét kapjuk! A 'z' betűből 'a' legyen! Pl. 'a' -> 'b'\n", + "- Generáljunk véletlenszerűen egy angol betűt! Próbáljuk szelekció nélkül (is) megoldani a feladatot!\n", + "- Generáljunk véletlenszerűen egy Neptun kódot! A Neptun kód egy 6 db karakterből álló sztring, amelyben angol nagybetűk és számjegy karakterek lehetnek!\n", + "- Írjuk ki azt, hogy hány bájton tárolódnak a magyar ékezetes kisbetűk! A megoldás ne csak szekvenciát tartalmazzon!\n", + "- Írjunk ki egy $nxn$ -es háromszöget * karakterekből egy db ciklus segítségével!\n", + "- Írjuk ki egy sztring karaktereit fordított sorrendben! Pl. 'abc' -> 'cba'\n", + "- Fordítsuk meg egy sztring karaktereinek sorrendjét! Pl. 'Réti pipitér' -> 'rétipip itéR'\n", + "- Határozzuk meg az angol kisbetűs magánhangzók darabszámát egy sztringben! Pl. 'Almafa, körtefa' -> 4" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Házi feladatok\n", + "- Készítsünk egyszerű számkitalálós játékot! Generáljunk egy véletlen egész számot 1-től 100-ig, majd kérjünk be tippeket a felhasználótól mindaddig, amíg a felhasználó el nem találja a generált számot! A program minden tipp után írja ki, hogy a megadott tipp kicsi, nagy vagy helyes volt-e!\n", + "- Valósítsuk meg a Caesar-kódolást adott eltolással egy csak angol kisbetűket tartalmazó szövegre! Pl. az 'abz' szöveg 1-es eltolással kódolt alakja: 'bca', a 'venividivici' szöveg 3-as eltolással kódolt alakja: 'yhqlylglylfl'." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/04_ea.ipynb b/04_ea.ipynb new file mode 100644 index 0000000..66031ca --- /dev/null +++ b/04_ea.ipynb @@ -0,0 +1,990 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Kollekciók" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Tuple](https://docs.python.org/3/library/stdtypes.html#tuples)\n", + "\n", + "- A tuple természetes számokkal indexelhető, nem módosítható tömb.\n", + "- Az elemeknek nem kell azonos típusúnak lenniük.\n", + "- Az indexelés O(1), a tartalmazásvizsgálat O(n) időben fut le, ahol n a tuple elemszáma." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy t nevű, 3 elemű tuple változót!\n", + "t = (20, 30, 40)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(20, 30, 40)" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tuple" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ellenőrizzük t típusát!\n", + "type(t)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az elemek számát a len függvénnyel kérdezhetjük le.\n", + "len(t)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "20" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tuple elemeinek elérése (az indexelés 0-tól indul).\n", + "t[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "30" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "40" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t[2]" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'tuple' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[8], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Az elemeken nem lehet módosítani!\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m t[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m100\u001b[39m\n", + "\u001b[1;31mTypeError\u001b[0m: 'tuple' object does not support item assignment" + ] + } + ], + "source": [ + "# Az elemeken nem lehet módosítani!\n", + "t[0] = 100" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "# A t változó persze kaphat új értéket.\n", + "t = (100, 30, 40)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# Az elemeknek nem kell azonos típusúnak lenniük.\n", + "t = (10, 2.5, 'alma', False, (10, 20))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(10, 2.5, 'alma', False, (10, 20))" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tartalmazásvizsgálat.\n", + "'alma' in t" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "'körte' in t" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "# Amennyiben nem okoz kétértelműséget, a ( és ) határoló elhagyható!\n", + "t = 20, 30, 40" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(20, 30, 40)" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tuple" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(t)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "()" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Üres tuple létrehozása.\n", + "()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "# Egy elemű tuple létrehozása.\n", + "t = (42,)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(42,)" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Lista](https://docs.python.org/3/library/stdtypes.html#lists)\n", + "\n", + "- A tuple módosítható változata. Új elemet is hozzá lehet adni, ill. meglévő elemeken is lehet módosítani.\n", + "- Az indexelés O(1), a tartalmazásvizsgálat O(n) időben fut le itt is." + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy l nevű, 4 elemű listaváltozót!\n", + "# Az elemeknek nem kell azonos típusúnak lenniük.\n", + "l = [2, 3, 4, 'körte']" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(list, 4)" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ellenőrizzük l típusát, és kérdezzük le az elemek számát!\n", + "type(l), len(l)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Lista elemeinek elérése (az indexelés 0-tól indul).\n", + "l[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "ename": "IndexError", + "evalue": "list index out of range", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[24], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m l[\u001b[38;5;241m4\u001b[39m]\n", + "\u001b[1;31mIndexError\u001b[0m: list index out of range" + ] + } + ], + "source": [ + "l[4]" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "# Listaelem módosítása.\n", + "l[0] = 100" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[100, 3, 4, 'körte']" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "# Listába elemként beágyazhatunk másik listát.\n", + "l = [10, 20, 30, [40, 50]]" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, 30, [40, 50]]" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "# Elem hozzáfűzése a lista végére.\n", + "l.append('sör')" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, 30, [40, 50], 'sör']" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [], + "source": [ + "# Elem beszúrása a lista adott indexű helyére.\n", + "l.insert(1, 'bor')" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 'bor', 20, 30, [40, 50], 'sör']" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tartalmazásvizsgálat.\n", + "'sör' in l" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "40 in l" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elem indexének meghatározása (az első előfordulásé).\n", + "l.index(20)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "42 is not in list", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[37], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m l\u001b[38;5;241m.\u001b[39mindex(\u001b[38;5;241m42\u001b[39m)\n", + "\u001b[1;31mValueError\u001b[0m: 42 is not in list" + ] + } + ], + "source": [ + "l.index(42)" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, 30, 40, 50]" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy szekvencia összes elemének hozzáfűzése a listához.\n", + "l = [10, 20, 30]\n", + "l.extend([40, 50])\n", + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, 30, [40, 50]]" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az extend különbözik az append-től!\n", + "l = [10, 20, 30]\n", + "l.append([40, 50])\n", + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "30" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Adott indexű elem törlése.\n", + "l.pop(2)" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, [40, 50]]" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[40, 50]" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Utolsó elem törlése.\n", + "l.pop()" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20]" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, 30, 'Pisti', 'Józsi']" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Két lista összefűzése egy új listába.\n", + "[10, 20, 30] + ['Pisti', 'Józsi']" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Lista többszörözése.\n", + "[0, 1] * 10" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Üres lista létrehozása.\n", + "[]" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[[1, 2, 3], [4, 5, 6]]" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy 2x3-as mátrix\n", + "m = [[1, 2, 3], [4, 5, 6]]\n", + "m" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Konverzió\n", + "\n", + "Ezen adattípusok nevei is használhatók függvényként az adott adattípusra való konvertálásra, amennyiben a konverziónak van értelme." + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(1, 2, 3)" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tuple([1, 2, 3]) # list => tuple" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[4, 5, 6]" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list((4, 5, 6)) # tuple => list" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'[10, 20]'" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "str([10, 20])" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "int() argument must be a string, a bytes-like object or a real number, not 'list'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[51], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28mint\u001b[39m([\u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m20\u001b[39m])\n", + "\u001b[1;31mTypeError\u001b[0m: int() argument must be a string, a bytes-like object or a real number, not 'list'" + ] + } + ], + "source": [ + "int([10, 20])" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/04_gyak.ipynb b/04_gyak.ipynb new file mode 100644 index 0000000..f07456c --- /dev/null +++ b/04_gyak.ipynb @@ -0,0 +1,73 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 4. heti előadás anyagát tartalmazó Jupyter notebook (04_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Próbáljunk ki (hívjunk meg) néhány, a sorokhoz, ill. a listákhoz tartozó metódust (pl. count, pop, ... )!\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Készítsünk programokat az alábbi feladatokra! Ne használjon olyan dolgokat, amelyekről még nem volt szó az előadáson (pl. sum, min, max függvények)!\n", + "- Határozzuk meg az összegét, átlagát, legkisebb és legnagyobb elemét egy számokat tartalmazó adatsornak! Pl. 3, 5, 2, 6 => összeg: 16, átlag: 4.0, minimum: 2, maximum: 6.\n", + "- Fizessünk ki egy euróban adott egész összeget a lehető legkevesebb címlet felhasználásával! Az euró címletei: 500, 200, 100, 50, 20, 10, 5, 2, 1 (amiket egy tuple segítségével kezeljünk)! Pl. 905 -> 1 db 500, 2 db 200, 1 db 5. \n", + "- Fordítsuk meg egy sztring karaktereinek sorrendjét lista segítségével! Pl. 'abc' -> 'cba'. (Tipp: használja a list.reverse és a str.join metódusokat!)\n", + "- Töröljünk ki egy adatsorból egy adott értéket, ahányszor csak előfordul! Pl. 1, 2, 1, 3-ból az 1-t -> 2, 3.\n", + "- Határozzuk meg egy adott mátrix sorminimumait! Feltehető, hogy a mátrix (mint listák listája) helyes (azaz minden sora ugyanolyan hosszú, minden elem azonos típusú, amelyekre értelmezett az összehasonlítás)! Az eredmény egy listába kerüljön!\n", + "- Oldjuk meg az előző feladatot úgy, hogy a sorminimumok helyett az oszlopmaximumokat határozzuk meg!\n", + "- Döntsük el egy négyzetes mátrixról, hogy szimmetrikus-e vagy sem! Ha minden elem megegyezik a főátlóra vetített tükörképével ($a_{i,j}=a_{j,i}$) akkor szimmetrikus, egyébként nem." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Házi feladatok\n", + "- Egy műkorcsolyaversenyen N (>=1) versenyző indul és M (>=3) bíró pontoz. Minden versenyző minden bírótól pontosan egy db pontot kap (ami 0-tól 6-ig egy valós szám)! Ismerjük a versenyzők nevét, nemzetiségét (3 betűs sztring), és a bíróktól kapott pontjaikat. Számítsuk ki a versenyzők átlagpontjait, majd készítsünk olyan listát, amelyben a versenyzők összes adata (név, nemzetiség, pontok, átlagpont) szerepel! Minden versenyző legyen külön sorban, a pontok két tizedesjeggyel jelenjenek meg, egymás alá igazítva!\n", + "- Oldjuk meg a feladatot úgy is, hogy az átlagpontba az adott versenyző legnagyobb és legkisebb pontjának egy-egy előfordulását nem számítjuk be (a bírók részrehajlását elkerülendő)!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/05_ea.ipynb b/05_ea.ipynb new file mode 100644 index 0000000..157ba2b --- /dev/null +++ b/05_ea.ipynb @@ -0,0 +1,836 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Kollekciók" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Halmaz](https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset)\n", + "\n", + "- A halmaz adattípus a matematikai halmazfogalom számítógépes megfelelője.\n", + "- Halmazt indexelni nem lehet, a tartalmazásvizsgálat O(1) időben fut le." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy s nevű halmazváltozót!\n", + "s = {10, 20, 30}" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(set, 3)" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ellenőrizzük s típusát és elemszámát!\n", + "type(s), len(s)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tartalmazásvizsgálat.\n", + "20 in s" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "21 in s" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "# Elem hozzáadása a halmazhoz.\n", + "s.add(40)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{10, 20, 30, 40}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "s" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{1, 2, 3, 4, 5, 6, 7}" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Halmazműveletek.\n", + "{1, 2, 3, 4, 5} | {4, 5, 6, 7} # unió" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{4, 5}" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{1, 2, 3, 4, 5} & {4, 5, 6, 7} # metszet" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{1, 2, 3}" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{1, 2, 3, 4, 5} - {4, 5, 6, 7} # kivonás" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{6, 7}" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "{4, 5, 6, 7} - {1, 2, 3, 4, 5}" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{10, 2.5, 'alma'}" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az elemek típusa nem feltétlenül azonos.\n", + "{10, 2.5, 'alma'}" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{(20, 30), 10, 2.5, 'alma'}" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A halmazba bármilyen nem módosítható típusú elemet be lehet tenni.\n", + "{10, 2.5, 'alma', (20, 30)}" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "unhashable type: 'list'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[13], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# ...módosíthatót viszont nem lehet!\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m {\u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m2.5\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124malma\u001b[39m\u001b[38;5;124m'\u001b[39m, [\u001b[38;5;241m20\u001b[39m, \u001b[38;5;241m30\u001b[39m]}\n", + "\u001b[1;31mTypeError\u001b[0m: unhashable type: 'list'" + ] + } + ], + "source": [ + "# ...módosíthatót viszont nem lehet!\n", + "{10, 2.5, 'alma', [20, 30]}" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "# Elem eltávolítása.\n", + "s = {20, 30, 40}\n", + "s.remove(20)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{30, 40}" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "s" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "40\n", + "20\n", + "30\n" + ] + } + ], + "source": [ + "# Iterálás egy halmaz elemein (a sorrend meglepő is lehet).\n", + "s = {20, 30, 40}\n", + "for x in s:\n", + " print(x)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "set()" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Üres halmaz létrehozása.\n", + "set()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Szótár](https://docs.python.org/3/library/stdtypes.html#mapping-types-dict)\n", + "\n", + "- A szótár kulcs-érték párok halmaza, ahol a kulcsok egyediek.\n", + "- A kulcs lehet egyszerű típus, tuple vagy bármely módosíthatatlan adatszerkezet.\n", + "- Indexelni a kulccsal lehet, O(1) időben." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy d nevű szótárváltozót!\n", + "d = {'a': 10, 'b': 20}" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 10, 'b': 20}" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dict" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ellenőrizzük le d típusát és elemszámát!\n", + "type(d)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(d)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "20" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Létező kulcshoz tartozó érték lekérdezése.\n", + "d['b']" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "ename": "KeyError", + "evalue": "'banán'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[23], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Nem létező kulcshoz tartozó érték lekérdezése.\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m d[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mbanán\u001b[39m\u001b[38;5;124m'\u001b[39m]\n", + "\u001b[1;31mKeyError\u001b[0m: 'banán'" + ] + } + ], + "source": [ + "# Nem létező kulcshoz tartozó érték lekérdezése.\n", + "d['banán']" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "# Kulcshoz tartozó érték módosítása.\n", + "d['a'] = 100" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 100, 'b': 20}" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "# Új kulcs-érték pár beszúrása.\n", + "d['cc'] = 'valami'" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 100, 'b': 20, 'cc': 'valami'}" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "# Kulcs-érték pár törlése.\n", + "del d['b']" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 100, 'cc': 'valami'}" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Benne van-e egy kulcs a szótárban?\n", + "'cc' in d" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "'xx' in d" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "100 in d" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{(10, 20): 'sör', (30, 40): 'bor'}" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Akár tuple is lehet szótárkulcs.\n", + "{(10, 20): 'sör', (30, 40): 'bor'}" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a\n", + "b\n", + "c\n" + ] + } + ], + "source": [ + "# Iterálás egy szótár elemein.\n", + "d = {'a': 1, 'b': 2, 'c': 3}\n", + "for x in d:\n", + " # x-ben csak az aktuális kulcs van.\n", + " print(x)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a 1\n", + "b 2\n", + "c 3\n" + ] + } + ], + "source": [ + "# Iterálás egy szótár elemein.\n", + "d = {'a': 1, 'b': 2, 'c': 3}\n", + "for x in d:\n", + " # Most a kulcsokhoz tartozó értékeket is kiírjuk.\n", + " print(x, d[x])" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{}" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Üres szótár létrehozása.\n", + "{}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Konverzió\n", + "\n", + "Ezen adattípusok nevei is használhatók függvényként az adott adattípusra való konvertálásra, amennyiben a konverziónak van értelme." + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{1, 2}" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "set((1, 1, 2)) # tuple => set" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{1, 2}" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "set([1, 1, 2]) # list => set" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 1, 'b': 2}" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dict([('a', 1), ('b', 2)]) # párok listája => dict" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['a', 'b']" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list({'a': 1, 'b': 2}) # szótárkulcsok listája" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('a', 1), ('b', 2)]" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list({'a': 1, 'b': 2}.items()) # dict => párok listája" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/05_gyak.ipynb b/05_gyak.ipynb new file mode 100644 index 0000000..0312fa8 --- /dev/null +++ b/05_gyak.ipynb @@ -0,0 +1,83 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg az 5. heti előadás anyagát tartalmazó Jupyter notebook (05_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Egy hallgatói adatnyilvántartás\n", + "Készítsünk megfelelő adatszerkezete(ke)t egy hallgatói adatnyilvántartáshoz! A megkötéseket több lépésben adjuk meg, így a megoldások is több lépésben készíthetők el (mindig csak az adott lépésre fókuszálva)!\n", + "1. Egy hallgató adatai: név, Neptun kód, érdemjegyek. Minden hallgató ugyanazokat a tárgyakat tanulja (pl. 3 db tárgyat) és egy tárgyból mindenkinek pontosan egy db jegye van. \n", + "2. Legyen több (pl. két) hallgató a nyilvántartásban!\n", + "3. A tárgyaknak legyenek nevei!\n", + "4. A Neptun kód csak egyedi lehessen!\n", + "5. A hallgatók tanulhassanak különböző tárgyakat!\n", + "6. A hallgatók egy tárgyból több jegyet is kaphassanak!\n", + "7. A hallgatóknak lehessenek kedvenc tárgyai!\n", + "8. A hallgatók egyes adatait ne indexekkel, hanem nevekkel (Név, Neptun kód, Jegyek, Kedvencek) lehessen hivatkozni!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Készítsünk programokat az alábbi feladatokra! A megoldásoknál csak a tananyagban eddig elhangzott ismereteket használjuk!\n", + "- Határozzuk meg egy sztring különböző karaktereinek számát!\n", + "- Generáljunk véletlenszerűen ötöslottó számokat, azaz 5 db különböző egész számot az [1, 90] intervallumból!\n", + "- Generáljuk az $1, 2, ..., n$ számoknak egy véletlenszerű permutációját/sorrendjét!\n", + "- Adott $n$ személy életkora és testsúlya, amelyek egész számok. Határozzuk meg az egyes életkorokra vonatkozó átlagos testsúly értékeket! " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Házi feladat\n", + "- 'Gyúrjuk egybe' a hallgatói adatnyilvántartás lépéseit, azaz készítsünk olyan adatstruktúrát, ami az összes felmerült igényt képes 'kiszolgálni'!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/05_gyak_mego.ipynb b/05_gyak_mego.ipynb new file mode 100644 index 0000000..62b3e8b --- /dev/null +++ b/05_gyak_mego.ipynb @@ -0,0 +1,761 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Egy hallgatói adatnyilvántartás\n", + "A megoldásokat több lépésben készítjük el, az adott lépésekre fókuszálva." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. lépés \n", + "Egy hallgató adatai: név, Neptun kód, érdemjegyek. Minden hallgató ugyanazokat a tárgyakat tanulja (pl. 3 db tárgyat) és egy tárgyból mindenkinek pontosan egy db jegye van." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('Gipsz Jakab', 'ABC123', 1, 2, 3)" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ha az adatok nem módusulnak, akkor a tuple is megfelelő \n", + "('Gipsz Jakab', 'ABC123', 1, 2, 3)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Gipsz Jakab', 'ABC123', 1, 2, 3]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ha az adatok módusulhatnak, akkor a lista a megfelelő \n", + "['Gipsz Jakab', 'ABC123', 1, 2, 3]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'ABC123'" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy változóban is tárolhatók az adatok, ha később hivatkozni szeretnénk rá\n", + "h = ('Gipsz Jakab', 'ABC123', 1, 2, 3)\n", + "# A hallgató Neptun kódja (feltételezve a fenti adatsorrendet)\n", + "h[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Gipsz Jakab', 'XYZ000', 1, 2, 3]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Lista esetén módosíthatók is az adatok\n", + "h = ['Gipsz Jakab', 'ABC123', 1, 2, 3]\n", + "# A Neptun kód módosítása\n", + "h[1] = 'XYZ000'\n", + "h" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. lépés \n", + "Legyen több hallgató a nyilvántartásban!" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gipsz Jakab\n", + "5\n" + ] + } + ], + "source": [ + "# A hallgatókat (most két hallgatót) egy tuple-ben adjuk meg\n", + "\n", + "# Egy hallgató adatai tuple-ben\n", + "h = (('Gipsz Jakab', 'ABC123', 1, 2, 3),\n", + " ('Wincs Eszter', 'XYZ000', 2, 4, 5))\n", + "\n", + "# Az első hallgató neve\n", + "print(h[0][0])\n", + "\n", + "# Az utolsó hallgató 3. jegye\n", + "print(h[len(h) - 1][4])" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'tuple' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;31m# Az adatok nem módosíthatók\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mh\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m4\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m2\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m: 'tuple' object does not support item assignment" + ] + } + ], + "source": [ + "# Az adatok nem módosíthatók\n", + "h[1][4] = 2" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['Gipsz Jakab', 'ABC123', 1, 2, 3], ['Wincs Eszter', 'XYZ000', 2, 4, 5]]\n", + "[['Móricka', 'XXX999', 1, 1, 1], ['Wincs Eszter', 'XYZ000', 2, 4, 5]]\n", + "[['Móricka', 'XXX999', 1, 1, 1], ['Wincs Eszter', 'XYZ000', 2, 4, 3]]\n" + ] + } + ], + "source": [ + "# A hallgatókat (most két hallgatót) egy listában adjuk meg\n", + "\n", + "# Egy hallgató adatai listában\n", + "h = [['Gipsz Jakab', 'ABC123', 1, 2, 3],\n", + " ['Wincs Eszter', 'XYZ000', 2, 4, 5]]\n", + "\n", + "print(h)\n", + "\n", + "# Az adatok módosíthatók\n", + "h[0] = ['Móricka', 'XXX999', 1, 1, 1]\n", + "print(h)\n", + "h[1][4] = 3 \n", + "print(h)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A jegyek elkülönítve is kezelhetők (például egy-egy listában)\n", + "h1 = [['Gipsz Jakab', 'ABC123', [1, 2, 3]],\n", + " ['Wincs Eszter', 'XYZ000', [2, 4, 5]]]\n", + "# Az első hallgató első jegye\n", + "h1[0][2][0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3. lépés \n", + "A tárgyaknak legyenek nevei!" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('Matematika', 'Fizika', 'Programozás')" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy külön változóba vesszük fel a tárgyak neveit (ahelyett, hogy minden hallgatóhoz felvennénk őket)\n", + "t = ('Matematika', 'Fizika', 'Programozás')\n", + "t" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['Móricka', 'XXX999', 1, 1, 1], ['Wincs Eszter', 'XYZ000', 2, 4, 3]]\n", + "Móricka 1 Matematika\n" + ] + } + ], + "source": [ + "# A jegyek és a tárgyak sorrendje megegyező\n", + "print(h)\n", + "# Az első hallgató neve, első jegye és hozzá tartozó tárgy neve\n", + "print(h[0][0], h[0][2], t[0])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4. lépés \n", + "A Neptun kód legyen egyedi!" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['Gipsz Jakab', 'ABC123', 1, 2, 3],\n", + " ['Móricka', 'XXX999', 1, 1, 1],\n", + " ['Wincs Eszter', 'ABC123', 2, 4, 5]]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A lista nem 'védi' az egyediséget (azaz megenged egyforma Neptun kódokat)\n", + "h = [['Gipsz Jakab', 'ABC123', 1, 2, 3],\n", + " ['Móricka', 'XXX999', 1, 1, 1],\n", + " ['Wincs Eszter', 'ABC123', 2, 4, 5]]\n", + "h" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'ABC123': ['Wincs Eszter', 2, 4, 5], 'XXX999': ['Móricka', 1, 1, 1]}" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A szótár viszont csak egyedi kulcsokat enged meg\n", + "# A Neptun kód a kulcs, az értékek pedig az egyes hallgatók adatai egy-egy listában\n", + "# Azonos kulcs esetén az utoljára felvett adat marad csak meg a szótárban\n", + "h = {'ABC123':['Gipsz Jakab', 1, 2, 3],\n", + " 'XXX999':['Móricka', 1, 1, 1],\n", + " 'ABC123':['Wincs Eszter', 2, 4, 5]}\n", + "h" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "ename": "KeyError", + "evalue": "0", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;31m# A hallgatók elérése a szótárban már nem történhet index segítségével\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mh\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mKeyError\u001b[0m: 0" + ] + } + ], + "source": [ + "# A hallgatók elérése a szótárban már nem történhet index segítségével\n", + "h[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Wincs Eszter', 2, 4, 5]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A kulccsal kell indexelni\n", + "h['ABC123']" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Wincs Eszter'" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy adat elérése is csak a 'hallgatón keresztül' történhet\n", + "# Az ABC123 Neptun kódú hallgató neve\n", + "h['ABC123'][0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 5. lépés \n", + "A hallgatók tanulhassanak különböző tárgyakat!" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['Gipsz Jakab', 'ABC123', {'Matematika': 1, 'Fizika': 2, 'Programozás': 3}],\n", + " ['Móricka', 'XXX999', {'Mechanika': 1}],\n", + " ['Wincs Eszter', 'AAA123', {'Fizika': 2, 'Testnevelés': 5}]]" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A tantárgyaknak a hallgatókhoz kell tartozni, így szótár a megfelelő adatstruktúra\n", + "h = [['Gipsz Jakab', 'ABC123', {'Matematika':1, 'Fizika':2, 'Programozás':3}],\n", + " ['Móricka', 'XXX999', {'Mechanika':1}],\n", + " ['Wincs Eszter', 'AAA123', {'Fizika':2, 'Testnevelés':5}]]\n", + "h" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az első hallgató hány tárgyat tanul\n", + "len(h[0][2])" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tanul-e fizikát az első hallgató?\n", + "'Fizika' in h[0][2]" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hányast kapott belőle?\n", + "h[0][2]['Fizika']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 6. lépés \n", + "A hallgatók egy tárgyból több jegyet is kaphassanak!" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['Gipsz Jakab',\n", + " 'ABC123',\n", + " {'Matematika': [1, 2], 'Fizika': [2, 3], 'Programozás': [3, 4, 1]}],\n", + " ['Móricka', 'XXX999', {'Mechanika': [1, 1, 1]}],\n", + " ['Wincs Eszter', 'AAA123', {'Fizika': [2], 'Testnevelés': [5, 5, 5]}]]" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A tantárgyakhoz az 1 db érdemjegy helyett többet rendelünk (tuple vagy lista, itt most listát használunk)\n", + "h = [['Gipsz Jakab', 'ABC123', {'Matematika':[1, 2], 'Fizika':[2, 3], 'Programozás':[3, 4, 1]}],\n", + " ['Móricka', 'XXX999', {'Mechanika':[1, 1, 1]}],\n", + " ['Wincs Eszter', 'AAA123', {'Fizika':[2], 'Testnevelés':[5, 5, 5]}]]\n", + "h" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 3]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az első hallgató jegyei fizikából\n", + "h[0][2]['Fizika']" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Gipsz Jakab',\n", + " 'ABC123',\n", + " {'Matematika': [1, 2], 'Fizika': [2, 3, 5], 'Programozás': [3, 4, 1]}]" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az első hallgató kapott egy új jegyet (egy 5-t) fizikából\n", + "h[0][2]['Fizika'].append(5)\n", + "h[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 7. lépés \n", + "A hallgatóknak lehessenek kedvenc tárgyai!" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['Gipsz Jakab',\n", + " 'ABC123',\n", + " {'Matematika': 1, 'Fizika': 2, 'Programozás': 3},\n", + " {'Fizika'}],\n", + " ['Móricka', 'XXX999', {'Mechanika': 1}, {}],\n", + " ['Wincs Eszter',\n", + " 'AAA123',\n", + " {'Fizika': 2, 'Testnevelés': 5},\n", + " {'Fizika', 'Testnevelés'}]]" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A halmaz a megfelelő adatstruktúra a kedvenc tárgyaknak, felvesszük a hallgatókhoz (most utolsó adatként)\n", + "h = [['Gipsz Jakab', 'ABC123', {'Matematika':1, 'Fizika':2, 'Programozás':3}, {'Fizika'}],\n", + " ['Móricka', 'XXX999', {'Mechanika':1}, {}],\n", + " ['Wincs Eszter', 'AAA123', {'Fizika':2, 'Testnevelés':5}, {'Testnevelés', 'Fizika'}]]\n", + "h" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Van-e kedvenc tárgya az első hallgatónak?\n", + "len(h[0][3]) > 0\n" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az utolsó hallgató kedveli-e a Fizikát?\n", + "'Fizika' in h[len(h) - 1][3]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 8. lépés \n", + "A hallgatók egyes adatait ne indexekkel, hanem nevekkel (Név, Neptun kód, Jegyek, Kedvencek) lehessen hivatkozni!" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'Név': 'Gipsz Jakab',\n", + " 'Neptun kód': 'ABC123',\n", + " 'Jegyek': {'Fizika': 5},\n", + " 'Kedvencek': {'Fizika'}},\n", + " {'Név': 'Móricka',\n", + " 'Neptun kód': 'XXX999',\n", + " 'Jegyek': {'Mechanika': 1},\n", + " 'Kedvencek': {}},\n", + " {'Név': 'Wincs Eszter',\n", + " 'Neptun kód': 'AAA123',\n", + " 'Jegyek': {'Fizika': 2, 'Testnevelés': 5},\n", + " 'Kedvencek': {'Fizika', 'Testnevelés'}}]" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ehhez az egyes hallgatók adatait szótárba kell tennünk\n", + "h = [{'Név':'Gipsz Jakab', 'Neptun kód':'ABC123', 'Jegyek':{'Fizika':5}, 'Kedvencek':{'Fizika'}},\n", + " {'Név':'Móricka', 'Neptun kód':'XXX999', 'Jegyek':{'Mechanika':1}, 'Kedvencek':{}},\n", + " {'Név':'Wincs Eszter', 'Neptun kód':'AAA123', 'Jegyek':{'Fizika':2, 'Testnevelés':5}, 'Kedvencek':{'Testnevelés', 'Fizika'}}]\n", + "h" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gipsz Jakab {'Fizika': 5}\n" + ] + } + ], + "source": [ + "# Az első hallgató neve és érdemjegyei\n", + "print(h[0]['Név'], h[0]['Jegyek'])" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Fizika', 'Testnevelés'}" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A harmadik hallgató kedvenc tárgyai\n", + "h[2]['Kedvencek']" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/06_ea.ipynb b/06_ea.ipynb new file mode 100644 index 0000000..ac226ad --- /dev/null +++ b/06_ea.ipynb @@ -0,0 +1,1297 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Comprehension-ök](https://python-3-patterns-idioms-test.readthedocs.io/en/latest/Comprehensions.html)\n", + "\n", + "A comprehension egy olyan nyelvi elem a Pythonban, amely szekvenciák tömör megadását teszi lehetővé. A comprehension némileg hasonlít a matematikában alkalmazott, [tulajdonság alapján történő halmazmegadásra](https://en.wikipedia.org/wiki/Set-builder_notation) (példa: a páratlan számok halmaza megadható $\\{2k + 1\\ |\\ k \\in \\mathbb{Z}\\}$ módon)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feltétel nélküli comprehension" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Állítsuk elő az első 10 négyzetszám listáját gyűjtőváltozó használatával!\n", + "l = []\n", + "for i in range(1, 11):\n", + " l.append(i**2)\n", + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ugyanez tömörebben, lista comprehension-nel:\n", + "l = [i**2 for i in range(1, 11)]\n", + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Állítsuk elő az első 10 négyzetszám halmazát gyűjtőváltozó használatával!\n", + "s = set()\n", + "for i in range(1, 11):\n", + " s.add(i**2)\n", + "s" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ugyanez tömörebben, halmaz comprehension-nel:\n", + "s = {i**2 for i in range(1, 11)}\n", + "s" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 97, 'e': 101, 'i': 105, 'o': 111, 'u': 117}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Állítsunk elő egy szótárat, amely az angol kisbetűs magánhangzókhoz hozzárendeli az ASCII-kódjukat!\n", + "# Használjunk gyűjtőváltozót!\n", + "d = {}\n", + "for ch in 'aeiou':\n", + " d[ch] = ord(ch)\n", + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 97, 'e': 101, 'i': 105, 'o': 111, 'u': 117}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ugyanez tömörebben, szótár comprehension-nel:\n", + "d = {ch: ord(ch) for ch in 'aeiou'}\n", + "d" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzés: Tuple comprehension nincs." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(10, 'alma'), (20, 'körte'), (30, 'barack')]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Feladat: Párok tagjainak megcserélése egy listában.\n", + "pairs = [('alma', 10), ('körte', 20), ('barack', 30)]\n", + "[(p[1], p[0]) for p in pairs]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feltételes comprehension" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[4, 16, 36, 64, 100]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Feltételes lista comprehension.\n", + "[i**2 for i in range(1, 11) if i % 2 == 0]" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{4, 16, 36, 64, 100}" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Feltételes halmaz comprehension.\n", + "{i**2 for i in range(1, 11) if i % 2 == 0}" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a': 97, 'e': 101, 'o': 111, 'u': 117}" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Feltételes szótár comprehension.\n", + "{ch: ord(ch) for ch in 'aeiou' if ch != 'i'}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## A sum, min, max függvények" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "12\n", + "3.3000000000000003\n", + "3.3\n", + "(3+5j)\n" + ] + } + ], + "source": [ + "# Számítsuk ki számok összegét a sum függvénnyel.\n", + "\n", + "# Az adatok egész számok egy listában.\n", + "print(sum([1, 8, 3]))\n", + "\n", + "# Az adatok valós számok egy listában.\n", + "print(sum([1.1, 2.2]))\n", + "\n", + "# Az adatok egész és valós számok egy tuple-ban.\n", + "print(sum((1, 2.3)))\n", + "\n", + "# Az adatok complex számok egy halmazban.\n", + "print(sum({1 + 2j, 2 + 3j}))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "unsupported operand type(s) for +: 'int' and 'str'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[12], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Ha az elemek nem számok, hibát kapunk!\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28msum\u001b[39m([\u001b[38;5;241m3\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124malma\u001b[39m\u001b[38;5;124m'\u001b[39m])\n", + "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for +: 'int' and 'str'" + ] + } + ], + "source": [ + "# Ha az elemek nem számok, hibát kapunk!\n", + "sum([3, 'alma'])" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2.8\n", + "5\n", + "a\n", + "m\n", + "Lady Marian\n", + "Robin Hood\n" + ] + } + ], + "source": [ + "# Minimum/maximum érték (ahol az adatok összehasonlíthatók).\n", + "\n", + "# Az adatok számok.\n", + "print(min(3, 5, 2.8))\n", + "\n", + "# Az adatok számok egy listában.\n", + "print(max([3, 5, 2.8]))\n", + "\n", + "# Az adat egy db sztring, azaz karakterek egy szekvenciája.\n", + "print(min('alma'))\n", + "print(max('alma'))\n", + "\n", + "# Az adatok sztringek.\n", + "print(min('Little John', 'Lady Marian', 'Robin Hood'))\n", + "\n", + "# Az adatok sztringek egy listában.\n", + "print(max(['Little John', 'Lady Marian', 'Robin Hood']))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'<' not supported between instances of 'str' and 'int'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[14], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Ha az elemek nem összehasonlíthatók, hibát kapunk!\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28mmin\u001b[39m(\u001b[38;5;241m3\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124malma\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", + "\u001b[1;31mTypeError\u001b[0m: '<' not supported between instances of 'str' and 'int'" + ] + } + ], + "source": [ + "# Ha az elemek nem összehasonlíthatók, hibát kapunk!\n", + "min(3, 'alma')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Rendezés" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "# Lista rendezése helyben.\n", + "l = [2, 11, 10, 3]\n", + "l.sort()" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 3, 10, 11]" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[11, 10, 3, 2]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Rendezés csökkenő sorrendbe.\n", + "l.sort(reverse=True)\n", + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'<' not supported between instances of 'str' and 'int'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[18], line 3\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Fontos, hogy az elemek összehasonlíthatók legyenek!\u001b[39;00m\n\u001b[0;32m 2\u001b[0m l \u001b[38;5;241m=\u001b[39m [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124malma\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m----> 3\u001b[0m l\u001b[38;5;241m.\u001b[39msort()\n", + "\u001b[1;31mTypeError\u001b[0m: '<' not supported between instances of 'str' and 'int'" + ] + } + ], + "source": [ + "# Fontos, hogy az elemek összehasonlíthatók legyenek!\n", + "l = [1, 2, 'alma']\n", + "l.sort()" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "# Ha csak sztringeket tartalmaz a lista, akkor lehet rendezni.\n", + "l = ['alma', 'szilva', 'körte']\n", + "l.sort()" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['alma', 'körte', 'szilva']" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[2, 11, 10, 3]\n", + "[2, 3, 10, 11]\n" + ] + } + ], + "source": [ + "# Kollekció rendezése listába.\n", + "l1 = [2, 11, 10, 3]\n", + "l2 = sorted(l1)\n", + "print(l1)\n", + "print(l2)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 30, 35, 40]" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tuple elemeit is rendezhetjük új listába.\n", + "sorted((40, 10, 30, 35))" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 30, 35, 40]" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ... és halmaz elemeit is.\n", + "sorted({40, 10, 30, 35})" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['alma', 'cseresznye', 'körte']" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Szótár esetén a sorted a kulcsokat rendezi.\n", + "d = {'cseresznye': 10, 'alma': 20, 'körte': 30}\n", + "sorted(d)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['a', 'a', 'i', 'l', 'm', 'v']" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sztring esetén a sorted a karaktereket rendezi.\n", + "sorted('valami')" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('bor', 5), ('bor', 20), ('pálinka', 30), ('sör', 10)]" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Párok listájának rendezése (lexikografikusan).\n", + "pairs = [('sör', 10), ('bor', 20), ('pálinka', 30), ('bor', 5)]\n", + "sorted(pairs)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzés:\n", + "- A Python rendező algoritmusa a Timsort.\n", + "- Időigény: O(n*log(n)), ahol n a rendezendő szekvencia hossza.\n", + "- A rendező algoritmus stabil (egyenlőség esetén megőrzi az eredeti sorrendet)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Kicsomagolás ([unpacking](https://treyhunner.com/2018/03/tuple-unpacking-improves-python-code-readability/))" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "# Általános eset.\n", + "x, [y, z] = (10, 20, 30), ['alma', [1, 2]]" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(10, 20, 30)" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'alma'" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "z" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "too many values to unpack (expected 2)", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[31], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Ha a bal és jobb oldal nem illeszthető egymásra, hibát kapunk.\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m x, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m20\u001b[39m, \u001b[38;5;241m30\u001b[39m\n", + "\u001b[1;31mValueError\u001b[0m: too many values to unpack (expected 2)" + ] + } + ], + "source": [ + "# Ha a bal és jobb oldal nem illeszthető egymásra, hibát kapunk.\n", + "x, y = 10, 20, 30" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20\n", + "30\n" + ] + } + ], + "source": [ + "# Többszörös értékadás.\n", + "x, y = 20, 30\n", + "print(x)\n", + "print(y)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "30\n", + "20\n" + ] + } + ], + "source": [ + "# Csere.\n", + "x = 20\n", + "y = 30\n", + "x, y = y, x\n", + "print(x)\n", + "print(y)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "tulipán 10\n", + "rózsa 20\n", + "liliom 30\n" + ] + } + ], + "source": [ + "# Kicsomagolás alkalmazása for ciklusnál.\n", + "pairs = [('tulipán', 10), ('rózsa', 20), ('liliom', 30)]\n", + "for x, y in pairs:\n", + " print(x, y)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 100\n", + "20 200\n" + ] + } + ], + "source": [ + "# Kicsomagolás alkalmazása szótárnál.\n", + "d = {10: 100, 20: 200}\n", + "for x, y in d.items():\n", + " print(x, y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Haladó indexelés ([slicing](https://docs.python.org/3/library/functions.html#slice))\n", + "\n", + "- A slice jelölésmód szintaxisa [alsó határ: felső határ: lépésköz].\n", + "- A kiválasztás intervalluma felülről nyitott, azaz a felső határ adja meg az első olyan indexet, amelyet már éppen nem választunk ki." + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [], + "source": [ + "# Példák haladó indexelésre.\n", + "\n", + "# 0 1 2 3 4 5 6 7\n", + "####################################################\n", + "data = ['alma', 'tulipán', 10, 20, 15, 25, 100, 200]" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['tulipán', 10, 20, 15, 25]" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemek kiválasztása az 1.-től az 5. indexig.\n", + "data[1: 6: 1]" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['tulipán', 20, 25]" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az 1-es, 3-as és 5-ös indexű elem kiválasztása.\n", + "data[1: 7: 2]" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['alma', 'tulipán', 10, 20]" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az alsó határ, a felső határ és a lépésköz is elhagyható.\n", + "# Az első 4 elem kiválasztása.\n", + "data[:4]" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['tulipán', 20, 25, 200]" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Minden 2. elem kiválasztása, az 1-es elemtől kezdve.\n", + "data[1::2]" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['alma', 'tulipán', 10, 20, 15, 25, 100]" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Használhatunk negatív indexeket is, a mínusz 1-edik jelenti az utolsó elemet.\n", + "# Az utolsó kivételével az összes elem kiválasztása.\n", + "data[:-1]" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "100" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A negatív indexek hagyományos indexelésnél is használhatók.\n", + "# Az utolsó előtti elem kiválasztása.\n", + "data[-2]" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[200, 100, 25, 15, 20, 10, 'tulipán', 'alma']" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A lépésköz is lehet negatív.\n", + "# A lista megfordítása.\n", + "data[::-1]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Haladó iterálási technikák" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [enumerate](https://docs.python.org/3/library/functions.html#enumerate)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0 kék\n", + "1 lila\n", + "2 sárga\n", + "3 zöld\n" + ] + } + ], + "source": [ + "# Iterálás az elemeken és indexeken egyszerre, hagyományos megoldás.\n", + "x = ['kék', 'lila', 'sárga', 'zöld']\n", + "for i in range(len(x)):\n", + " print(i, x[i])" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0 kék\n", + "1 lila\n", + "2 sárga\n", + "3 zöld\n" + ] + } + ], + "source": [ + "# Ugyanez elegánsabban, enumerate-tel:\n", + "for i, xi in enumerate(x):\n", + " print(i, xi)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "enumerate" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az enumerate eredménye egy iterálható objektum.\n", + "type(enumerate(x))" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(0, 'kék'), (1, 'lila'), (2, 'sárga'), (3, 'zöld')]" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Átalakítás párok listájává.\n", + "list(enumerate(x))" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0 kék\n", + "1 lila\n", + "2 sárga\n", + "3 zöld\n" + ] + } + ], + "source": [ + "# Az enumerate kicsomagolás nélkül is használható.\n", + "for y in enumerate(x):\n", + " print(y[0], y[1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [zip](https://docs.python.org/3/library/functions.html#zip)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sör 10\n", + "bor 20\n", + "rum 30\n" + ] + } + ], + "source": [ + "# Iterálás több szekvencián egyszerre, hagyományos megoldás.\n", + "x = ['sör', 'bor', 'rum']\n", + "y = [10, 20, 30]\n", + "for i in range(len(x)):\n", + " print(x[i], y[i])" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sör 10\n", + "bor 20\n", + "rum 30\n" + ] + } + ], + "source": [ + "# Ugyanez elegánsabban, zip-pel:\n", + "for xi, yi in zip(x, y):\n", + " print(xi, yi)" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "zip" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A zip eredménye egy iterálható objektum.\n", + "type(zip(x, y))" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('sör', 10), ('bor', 20), ('rum', 30)]" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Átalakítás listává.\n", + "list(zip(x, y))" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sör 10\n", + "bor 20\n", + "rum 30\n" + ] + } + ], + "source": [ + "# A zip kicsomagolás nélkül is használható.\n", + "for z in zip(x, y):\n", + " print(z[0], z[1])" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sör 10\n", + "bor 20\n", + "rum 30\n" + ] + } + ], + "source": [ + "# Ha szekvenciák hossza nem azonos, akkor az eredmény a rövidebb hosszát veszi fel.\n", + "x = ['sör', 'bor', 'rum', 'pálinka']\n", + "y = [10, 20, 30]\n", + "for xi, yi in zip(x, y):\n", + " print(xi, yi)" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sör 10 True\n", + "bor 20 False\n", + "rum 30 True\n" + ] + } + ], + "source": [ + "# A zip kettőnél több szekvenciára is alkalmazható.\n", + "x = ['sör', 'bor', 'rum']\n", + "y = [10, 20, 30]\n", + "z = [True, False, True]\n", + "for xi, yi, zi in zip(x, y, z):\n", + " print(xi, yi, zi)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/06_gyak.ipynb b/06_gyak.ipynb new file mode 100644 index 0000000..aeca061 --- /dev/null +++ b/06_gyak.ipynb @@ -0,0 +1,105 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 6. heti előadás anyagát tartalmazó Jupyter notebook (06_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. feladat\n", + "Készítsünk különbségsorozatot az $a_1$, ..., $a_n$ számsorozatból, ahol a különbségsorozat $i$. eleme $a_{i+1}$ - $a_i$! Pl: 2, 5, 7, 15 => 3, 2, 8" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3, 2, 8]\n", + "[3, 2, 8]\n", + "[3, 2, 8]\n" + ] + } + ], + "source": [ + "# A számsorozat\n", + "a = [2, 5, 7, 15]\n", + "\n", + "# 1. megoldás (nem használva a 6. előadás dolgait))\n", + "diff = []\n", + "for i in range(len(a) - 1):\n", + " diff.append(a[i + 1] - a[i])\n", + "print(diff)\n", + "\n", + "# 2. megoldás (comprehension és indexelés)\n", + "diff = [a[i + 1] - a[i] for i in range(len(a) - 1)]\n", + "print(diff)\n", + "\n", + "# 3. megoldás (comprehension, unpacking, slicing és zip)\n", + "diff = [x - y for x, y in zip(a[1:], a[:-1])]\n", + "print(diff)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Készítsünk programokat az alábbi feladatokra! A megoldásoknál használjuk az előadáson elhangzottakat (pl. comprehension, haladó indexelés, kicsomagolás, zip, ...)!\n", + "- Állítsuk elő comprehension-nel a [100, 90, 80, 70, 60, 50, 40, 30, 20, 10] listát!\n", + "- Gyűjtsük ki feltételes comprehension-nel egy számokból álló lista pozitív elemeit egy új listába! Pl. [-1, 2, 0, 3] => [2, 3] \n", + "- Fordítsuk meg egy sztring karaktereinek sorrendjét haladó indexeléssel! Pl. 'abc' => 'cba'.\n", + "- Készítsünk szótárat egy `KULCS_1,ÉRTÉK_1, ... KULCS_n,ÉRTÉK_n` formátumú sztringből! Pl. 'alma,10,körte,20,barack,30' => {'alma': 10, 'körte': 20, 'barack': 30} (Tipp: a sztring darabolásához használjuk a split metódust!)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Házi feladatok\n", + "Készítsünk programokat az alábbi feladatokra! A megoldásoknál használjuk az előadáson elhangzottakat (pl. sum, min, max, sorted függvények)!\n", + "- Egy műkorcsolyaversenyen N (>=1) versenyző indul és M (>=3) bíró pontoz. Minden versenyző minden bírótól pontosan egy db pontot kap (ami 0-tól 6-ig egy valós szám)! Ismerjük a versenyzők nevét, nemzetiségét (3 betűs sztring), és a bíróktól kapott pontjaikat. Számítsuk ki a versenyzők átlagpontjait, majd készítsünk olyan listát, amelyben a versenyzők összes adata (név, nemzetiség, pontok, átlagpont) szerepel! Minden versenyző legyen külön sorban, a pontok két tizedesjeggyel jelenjenek meg, egymás alá igazítva!\n", + "- Oldjuk meg a feladatot úgy is, hogy az átlagpontba az adott versenyző legnagyobb és legkisebb pontjának egy-egy előfordulását nem számítjuk be (a bírók részrehajlását elkerülendő)!\n", + "- Oldjuk meg a feladatot úgy is, hogy a lista eredménylista legyen (azaz olyan lista, amely az átlagpont szerint csökkenően rendezett)!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/07_ea.ipynb b/07_ea.ipynb new file mode 100644 index 0000000..030d88a --- /dev/null +++ b/07_ea.ipynb @@ -0,0 +1,761 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Függvények](https://docs.python.org/3/tutorial/controlflow.html#defining-functions)\n", + "\n", + "### Alapfogalmak\n", + "\n", + "- A függvény névvel ellátott alprogram, amely a program más részeiből meghívható.\n", + "- Függvények használatával a számítási feladatok kisebb egységekre oszthatók. A gyakran használt függvények kódját könyvtárakba rendezhetjük.\n", + "- A matematikában egy függvénynek nincsenek mellékhatásai. Egy Python nyelvű függvénynek lehetnek!\n", + "\n", + "\n", + "- Pythonban a függvények \"teljes jogú állampolgárok\":\n", + " + Egy változónak értékül adhatunk egy függvényt.\n", + " + Függvényeket egymásba lehet ágyazni.\n", + " + Egy függvény kaphat paraméterként függvényt ill. adhat eredményül függvényt.\n", + " \n", + "\n", + "- Fontos különbséget tenni egy függvény *definíciója* és *meghívása* között:\n", + " + A függvény definíciója megadja, hogy milyen bemenethez milyen kimenet rendelődjön (és milyen mellékhatások hajtódjanak végre). A függvény definíciója a programban általában csak egy helyen szerepel (ha több helyen szerepel, akkor az utolsó definíció lesz az érvényes.)\n", + " + A függvény meghívása azt jelenti, hogy egy adott bemenethez kiszámítjuk a hozzárendelt értéket. Egy függvényt a programban többször is meg lehet hívni." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Példa: n-edik gyök függvény definiálása.\n", + "def root(x, n=2):\n", + " '''Returns the n-th root of x.'''\n", + " return x**(1 / n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Ha a függvény első utasítása egy sztring, akkor ez lesz a függvény dokumentációs sztringje." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Returns the n-th root of x.'" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Dokumentációs sztring (docstring) lekérdezése.\n", + "root.__doc__ # \"dunder doc\"" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# A __doc__ attribútum egy közönséges sztring, tetszés szerint végezhetünk vele műveleteket.\n", + "root.__doc__ *= 10" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- Pythonban a függvényeknek *pozícionális* és *kulcsszó* paraméterei lehetnek.\n", + " + Függvénydefiníciókor először a pozícionális majd a kulcsszó paramétereket kell felsorolni.\n", + " + A pozícionális paramétereknek nincs alapértelmezett értékük, a kulcsszó paramétereknek van.\n", + " + Mindegyik paramétertípusból lehet nulla darab is.\n", + "- Függvényhíváskor...\n", + " + Az összes pozícionális paraméter értékét meg kell adni, olyan sorrendben, ahogy a definíciónál szerepeltek,\n", + " + A kulcsszó paraméterek értékét nem kötelező megadni." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.4142135623730951" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Gyök 2 kiszámítása.\n", + "root(2)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.2599210498948732" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Köbgyök 2 kiszámítása.\n", + "root(2, n=3)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.2599210498948732" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A második paramétert nem kell nevesíteni.\n", + "root(2, 3)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# Változónak értékül adhatunk függvényt.\n", + "f = root" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "function" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(f)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.0" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f(16, n=4)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# Példa egymásba ágyazásra ill. függvényt visszaadó függvényre.\n", + "def f(y):\n", + " def g(x):\n", + " return x * y\n", + " return g" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "# f egy \"függvénygyár\"\n", + "g2 = f(2) # kétszerező függvény\n", + "g3 = f(3) # háromszorozó függvény" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "20" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g2(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "60" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g3(20)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Gyakorlás" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Prímtesztelés\n", + "\n", + "Készítsünk függvényt, amely eldönti egy természetes számról, hogy prím-e!" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], + "source": [ + "# 1. változat: függvény nélkül\n", + "n = 17\n", + "\n", + "is_prime = True\n", + "for i in range(2, int(n**0.5) + 1):\n", + " if n % i == 0:\n", + " is_prime = False\n", + " break\n", + " \n", + "print(is_prime and n > 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "# 2. változat: függvénnyel\n", + "def is_prime(n):\n", + " for i in range(2, int(n**0.5) + 1):\n", + " if n % i == 0:\n", + " return False\n", + " return n > 1" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "is_prime(1)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "is_prime(2)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "is_prime(12)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "is_prime(13)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Legnagyobb közös osztó\n", + "\n", + "Készítsünk függvényt két természetes szám legnagyobb közös osztójának a meghatározására!" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6\n" + ] + } + ], + "source": [ + "# 1. változat: függvény nélkül\n", + "a = 18\n", + "b = 12\n", + "\n", + "for i in range(min(a, b), 0, -1):\n", + " if a % i == 0 and b % i == 0: # i közös osztó?\n", + " break\n", + " \n", + "print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "# 2. változat: függvénnyel\n", + "def calc_gcd(a, b):\n", + " for i in range(min(a, b), 0, -1):\n", + " if a % i == 0 and b % i == 0: # i közös osztó?\n", + " return i" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "calc_gcd(12, 18)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "calc_gcd(13, 18)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Másodfokú egyenlet megoldó\n", + "\n", + "Készítsünk másodfokú egyenlet megoldó függvényt!" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "def solve_quadratic(a, b, c):\n", + " '''Solve quadratic equation a*x^2 + b*x + c = 0,\n", + " and return solutions in a list.'''\n", + " \n", + " # diszkrimináns kiszámítása\n", + " d = b**2 - 4 * a * c\n", + "\n", + " # elágazás\n", + " if d > 0: # 2 megoldás\n", + " x1 = (-b + d**0.5) / (2 * a)\n", + " x2 = (-b - d**0.5) / (2 * a)\n", + " return [x1, x2]\n", + " elif d == 0: # 1 megoldás\n", + " return [-b / (2 * a)]\n", + " else:\n", + " return []" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[2.0, 1.0]" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "solve_quadratic(1, -3, 2)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[-1.0]" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "solve_quadratic(1, 2, 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "solve_quadratic(1, 1, 10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Lambda kifejezések](https://docs.python.org/3/reference/expressions.html#lambda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- A lambda kifejezés nem más, mint egysoros, névtelen függvény.\n", + "- (A [funkcionális programozás](https://en.wikipedia.org/wiki/Functional_programming) egyéb elemei a Pythonban: [map](https://docs.python.org/3/library/functions.html#map), [filter](https://docs.python.org/3/library/functions.html#filter).)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "142" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Példa lambda kifejezésre.\n", + "f = lambda x: x + 42\n", + "f(100)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "30" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egynél több bemenet is megengedett.\n", + "g = lambda x, y: x + y\n", + "g(10, 20)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "100" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...de akár nulla bemenet is lehet.\n", + "h = lambda: 100\n", + "h()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Lambda kifejezés alkalmazása rendezésnél" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('körte', 11), ('alma', 22), ('barack', 33)]" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Párok listájának rendezése a második elem szerint.\n", + "pairs = [('alma', 22), ('körte', 11), ('barack', 33)]\n", + "sorted(pairs, key=lambda p: p[1])" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('körte', 11), ('alma', 22), ('barack', 33)]" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az előző feladat megoldása lambda kifejezés nélkül.\n", + "pairs = [('alma', 22), ('körte', 11), ('barack', 33)]\n", + "def key_func(p):\n", + " return p[1]\n", + "sorted(pairs, key=key_func)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['king', 'queen', 'denmark']" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Szótárkulcsok rendezése az értékek szerint csökkenő sorrendbe.\n", + "words = {'king': 203, 'denmark': 24, 'queen': 192}\n", + "sorted(words, key=lambda k: words[k], reverse=True)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/07_gyak.ipynb b/07_gyak.ipynb new file mode 100644 index 0000000..4697517 --- /dev/null +++ b/07_gyak.ipynb @@ -0,0 +1,70 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 7. heti előadás anyagát tartalmazó Jupyter notebook (07_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Készítsünk függvényeket az alábbi feladatok megoldására, majd teszteljük a függvények működését (azaz hívjuk meg őket valamilyen tesztadattal és írjuk ki a kapott eredményeket)!\n", + "- Határozzuk meg két szám összegét!\n", + "- Egy sztring karakterei különbözőek-e vagy sem? (Pl. 'Alma' -> igen, 'alma' -> nem)\n", + "- Bővítsük az előadásanyagban szereplő másodfokú egyenlet megoldó függvényt (solve_quadratic) egy új, opcionális paraméterrel, amivel kérhető legyen a komplex gyökök kiszámítása is! A paraméter alapértelmezett értéke esetén csak valós gyököket számoljunk!\n", + "- Határozzuk meg egy sztringként megadott pozitív, bináris egész szám decimális értékét! (Pl. '110' -> 6)\n", + "- Egy számsorozat számtani sorozatot alkot-e vagy sem? (Pl. [1, 2, 3] -> igen, [1, 2, 2] -> nem)\n", + "- Határozzuk meg egy pozitív egész szám, mint euróban kifizetendő pénzösszeg kifizetéséhez szükséges legkevesebb címletet! (Pl. 213: 2 db 100-as, 1 db 10-es, 3 db 1-es)\n", + "- Definiáljuk egy általunk készített függvény doc sztringjét és nézzük meg a használatát is (pl. kérjünk help-et a függvényünkre)!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Házi feladatok\n", + "Készítsünk függvényeket az alábbi feladatok megoldására!\n", + "- Egy sztring tartalmaz-e angol nagybetűt vagy sem?\n", + "- Egy sztringben helyes angol név van-e vagy sem? Egy név helyes, ha:\n", + " - pontosan egy darab szóköz van benne, de az nincs az elején és a végén,\n", + " - az egy db szóközön kívül csak angol kis- és nagybetűk vannak benne,\n", + " - a vezetéknév és a keresztnév első betűje nagybetű, a többi kisbetű. (Pl: \"Little John\" -> helyes, \"nemecsek ernő\" -> nem helyes)\n", + "- Adottak síkbeli pontok a derékszögű koordinátáikkal! Határozzuk meg azt a pontot, amelyik a legközelebb van a pontok súlypontjához! Az eredmény a megfelelő pont(ok)ból álló lista legyen! (Pl. [(1, 0), (-1, 0), (0. 3)] -> [(1, 0), (-1, 0)])\n", + "- Oldjuk meg az előző (6.) heti korcsolyaversenyes feladatot úgy, hogy a rendezésnél lambda függvényt használunk!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/08_ea.ipynb b/08_ea.ipynb new file mode 100644 index 0000000..3ef38fc --- /dev/null +++ b/08_ea.ipynb @@ -0,0 +1,1015 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Modulok](https://docs.python.org/3/tutorial/modules.html) és [csomagok](https://docs.python.org/3/tutorial/modules.html#packages)\n", + "\n", + "**Modul**: Python nyelvű fájl.\n", + "- Definíciókat és utasításokat tartalmaz.\n", + "- Ha a modulhoz az `xyz.py` fájl tartozik, akkor a modulra `xyz` néven lehet hivatkozni.\n", + "- A modulok más Python programokból importálhatók.\n", + "\n", + "**Csomag**: Modulok gyűjteménye.\n", + "- Egy csomag alcsomagokat/almodulokat is tartalmazhat. A hierarchiát a csomagon belüli könyvtárszerkezet határozza meg.\n", + "- A standard csomagok és modulok a standard könyvtárban találhatók, és nem igényelnek telepítést.\n", + "- A külső csomagok gyűjtőhelye a PyPI (https://pypi.python.org/pypi)." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Modul/csomag importálása.\n", + "import random" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "77" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "random.randint(1, 100)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "15" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Függvény importálása egy modulból/csomagból.\n", + "from random import randint\n", + "randint(1, 100)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "-0.24241318164150646" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Modul/csomag teljes tartalmának importálása. (Megjegyzés: Ez a megoldás általában kerülendő.)\n", + "from random import *\n", + "normalvariate(0, 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/tmp'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Függvény importálása almodulból/alcsomagból.\n", + "from os.path import dirname\n", + "dirname('/tmp/pistike.txt')" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# Modul/csomag importálása rövidített néven.\n", + "import numpy as np # a numpy csomag importálása np néven\n", + " # (a numpy külső csomag)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.0" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "np.cos(0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Fejezetek a [standard könyvtárból](https://docs.python.org/3/library/index.html) I.\n", + "\n", + "- A Python standard könyvtára több mint 200 csomagot ill. modult tartalmaz. Szabványos megoldást biztosít a programozás mindennapjaiban felmerülő számos feladatra.\n", + "- A kurzuson csak a standard könyvtár egy kis részének az áttekintésére vállalkozunk.\n", + "- A jó programozó nem találja fel újra a spanyolviaszt. Ha lehetséges, akkor a standard könyvtár eszközeivel oldja meg a feladatot." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [datetime](https://docs.python.org/3/library/datetime.html)\n", + "- Dátum- és időkezelésre biztosít eszközöket.\n", + "- Támogatja a dátumaritmetikát, kezeli az időzónákat, óraátállítást, szökőéveket stb.\n", + "- Időzónamentes és időzónával rendelkező dátumokat is megenged." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "import datetime" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.datetime(2021, 3, 8, 9, 0, 10, 300)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Mikroszekundum pontosságú időpont megadása.\n", + "dt1 = datetime.datetime(2021, 3, 8, 9, 0, 10, 300)\n", + "dt1" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.datetime" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(dt1)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.date(2020, 12, 6)" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Nap pontosságú dátum megadása.\n", + "d1 = datetime.date(2020, 12, 6)\n", + "d1" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.date" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(d1)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "# Időpont aritmetika.\n", + "dt2 = datetime.datetime(2021, 1, 15, 12, 0, 10)\n", + "diff = dt1 - dt2" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.timedelta(days=51, seconds=75600, microseconds=300)" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "diff" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.timedelta" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(diff)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "51\n", + "75600\n", + "300\n" + ] + } + ], + "source": [ + "# Az eltérés 51 nap + 75600 másodperc 300 mikroszekundum.\n", + "print(diff.days)\n", + "print(diff.seconds)\n", + "print(diff.microseconds)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4482000.0003" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Másodpercben kifejezve:\n", + "diff.total_seconds()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.datetime(2021, 3, 16, 4, 0)" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Adjunk hozzá 8 órát egy időponthoz!\n", + "datetime.datetime(2021, 3, 15, 20, 0) + datetime.timedelta(0, 8 * 3600)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "44261" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Aritmetika nap pontosságú dátumokkal.\n", + "(datetime.date(2021, 3, 8) - datetime.date(1900, 1, 1)).days" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladat\n", + "- Kérjünk be egy dátumot (év, hónap, nap), majd írjuk ki azt, hogy a dátum hányadik nap az adott évben!" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kérek egy dátumot (éééé.hh.nn): 2023.01.02\n", + "2\n" + ] + } + ], + "source": [ + "# Megoldás\n", + "import datetime\n", + "\n", + "s = input('Kérek egy dátumot (éééé.hh.nn): ')\n", + "t = s.split('.')\n", + "dt = datetime.date(int(t[0]), int(t[1]), int(t[2]))\n", + "n = (dt - datetime.date(dt.year, 1, 1)).days + 1\n", + "print(n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladat\n", + "- Adott egy lista, amelyben személyek neve és születési dátuma szerepel! Készítsünk életkor szerint növekvően rendezett listát a személyek adatairól!" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('Békés Farkas', datetime.date(2014, 7, 30)),\n", + " ('Git Áron', datetime.date(1995, 2, 28)),\n", + " ('Har Mónika', datetime.date(1995, 2, 27)),\n", + " ('Bank Aranka', datetime.date(1980, 9, 1)),\n", + " ('Wincs Eszter', datetime.date(1980, 5, 7)),\n", + " ('Trab Antal', datetime.date(1961, 4, 1)),\n", + " ('Gipsz Jakab', datetime.date(1957, 11, 21))]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Megoldás\n", + "import datetime\n", + "\n", + "people = [\n", + " # név, születési dátum\n", + " ('Gipsz Jakab', datetime.date(1957, 11, 21)),\n", + " ('Wincs Eszter', datetime.date(1980, 5, 7)),\n", + " ('Békés Farkas', datetime.date(2014, 7, 30)),\n", + " ('Har Mónika', datetime.date(1995, 2, 27)),\n", + " ('Trab Antal', datetime.date(1961, 4, 1)),\n", + " ('Git Áron', datetime.date(1995, 2, 28)),\n", + " ('Bank Aranka', datetime.date(1980, 9, 1))\n", + "]\n", + "sorted(people, key=lambda p: p[1], reverse=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.datetime(2023, 11, 7, 11, 38, 32, 206260)" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Aktuális idő lekérdezése.\n", + "dt = datetime.datetime.now()\n", + "dt" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2023\n", + "11\n", + "7\n", + "11\n", + "38\n", + "32\n", + "206260\n" + ] + } + ], + "source": [ + "# A datetime objektum mezőinek lekérése.\n", + "print(dt.year)\n", + "print(dt.month)\n", + "print(dt.day)\n", + "print(dt.hour)\n", + "print(dt.minute)\n", + "print(dt.second)\n", + "print(dt.microsecond)" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A hét napjának lekérdezése (0=hétfő, ..., 6=vasárnap):\n", + "dt.weekday()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladat\n", + "- Hány db péntek 13-adika volt a 20. században (azaz 1901.01.01-től 2000.12.31-ig)?" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "171\n", + "171\n" + ] + } + ], + "source": [ + "import datetime\n", + "\n", + "# Megoldás 1: a 20. század összes napját megvizsgáljuk.\n", + "db = 0\n", + "dt = datetime.date(1901, 1, 1)\n", + "while dt <= datetime.date(2000, 12, 31):\n", + " if dt.weekday() == 4 and dt.day == 13:\n", + " db += 1\n", + " dt += datetime.timedelta(1)\n", + "print(db)\n", + "\n", + "# Megoldás 2: csak minden érintett hónap 13. napját vizsgáljuk meg.\n", + "db = 0\n", + "for y in range(1901, 2001): # végigmegyünk az éveken\n", + " for m in range(1, 13): # azon belül a hónapokon\n", + " if datetime.date(y, m, 13).weekday() == 4:\n", + " db += 1\n", + "print(db)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [time](https://docs.python.org/3/library/time.html)\n", + "- Alacsony szintű időkezelésre ad eszközöket, ide tartozik pl. az időtartam mérés és a várakozás." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "import time" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1699353589.2763045" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Aktuális idő lekérdezése (UNIX időbélyegként).\n", + "time.time() # 1970-01-01 óta eltelt idő, másodpercben" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "s=1.64493306684777, dt=0.23554015159606934\n" + ] + } + ], + "source": [ + "# Időtartam mérés.\n", + "t0 = time.time()\n", + "s = 0\n", + "for k in range(1, 1000000):\n", + " s += 1 / k**2\n", + "dt = time.time() - t0\n", + "print(f's={s}, dt={dt}')" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [], + "source": [ + "# Várakozás 2 másodpercig.\n", + "time.sleep(2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [random](https://docs.python.org/3/library/random.html)\n", + "- Álvéletlenszám-generálásra biztosít eszközöket." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "import random" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "60" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egész szám sorsolása egy intervallumból.\n", + "random.randint(1, 100)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "93" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ha a felső határt ki akarjuk zárni:\n", + "# 1 és 99 közötti véletlen egész számot generál.\n", + "random.randrange(1, 100)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "-1.6302778550631207" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Valós szám sorsolása egy intervallumból.\n", + "random.uniform(-2.2, 5.4)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.675777119325788" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sorsolás standard normális eloszlásból.\n", + "random.normalvariate(0, 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "82\n", + "15\n", + "4\n" + ] + } + ], + "source": [ + "# Véletlenszám generátor állapotának beállítása.\n", + "random.seed(42)\n", + "print(random.randint(1, 100))\n", + "print(random.randint(1, 100))\n", + "print(random.randint(1, 100))" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "82\n", + "15\n", + "4\n" + ] + } + ], + "source": [ + "random.seed(42)\n", + "print(random.randint(1, 100))\n", + "print(random.randint(1, 100))\n", + "print(random.randint(1, 100))" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [], + "source": [ + "# Az állapot visszaállítása véletlenszerűre.\n", + "random.seed()" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "82\n", + "82\n", + "15\n", + "15\n" + ] + } + ], + "source": [ + "# Véletlenszám generátor objektum létrehozása.\n", + "r1 = random.Random(42)\n", + "r2 = random.Random(42)\n", + "\n", + "print(r1.randint(1, 100))\n", + "print(r2.randint(1, 100))\n", + "print(r1.randint(1, 100))\n", + "print(r2.randint(1, 100))" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'alma'" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elem kisorsolása egy szekvenciából.\n", + "random.choice(['alma', 'körte', 'szilva'])" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[49, 58, 30, 62, 88]" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Visszatevés nélküli mintavétel.\n", + "random.sample(range(1, 91), 5)" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['körte', 'alma', 'szilva']" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Véletlen keverés.\n", + "l = ['alma', 'körte', 'szilva']\n", + "random.shuffle(l)\n", + "l" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladat\n", + "- Rakjuk egy szöveg karaktereit véletlenszerű sorrendbe!" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ailntcaspa\n", + "aclsitpaan\n" + ] + } + ], + "source": [ + "s = 'palacsinta'\n", + "\n", + "# Megoldás 1: random.sample-vel\n", + "print(''.join(random.sample(s, len(s))))\n", + "\n", + "# Megoldás 2: random.shuffle-vel\n", + "l = list(s)\n", + "random.shuffle(l)\n", + "print(''.join(l))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladat\n", + "- Szimuláljunk egy 10000 hosszú dobás sorozatot 2 db dobókockával, majd írjuk ki azt, hogy az esetek hány százalékában volt a dobások összege 2, 3, ..., 12!" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 2: 2.45\n", + " 3: 5.66\n", + " 4: 8.45\n", + " 5: 11.48\n", + " 6: 14.17\n", + " 7: 16.33\n", + " 8: 13.72\n", + " 9: 11.13\n", + "10: 8.20\n", + "11: 5.64\n", + "12: 2.77\n" + ] + } + ], + "source": [ + "# Megoldás\n", + "n = 10000\n", + "freq = [0] * 13\n", + "for i in range(n):\n", + " # dobások szimulálása\n", + " s = random.randint(1, 6) + random.randint(1, 6)\n", + " # megfelelő számláló növelése\n", + " freq[s] += 1 \n", + " \n", + "# kiírás\n", + "for s in range(2, 13):\n", + " print(f'{s:2}: {freq[s] / n * 100:.2f}')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/08_gyak.ipynb b/08_gyak.ipynb new file mode 100644 index 0000000..98b3123 --- /dev/null +++ b/08_gyak.ipynb @@ -0,0 +1,249 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 8. heti előadás anyagát tartalmazó Jupyter notebook (08_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. feladat\n", + "Készítsünk programot, amely szimulál egy n hosszú pénzfeldobás sorozatot, majd kiírja a fejek és írások darabszámát!" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "51\n", + "49\n" + ] + } + ], + "source": [ + "# 1. megoldás\n", + "import random\n", + "n = 100\n", + "nheads = 0\n", + "ntails = 0\n", + "for i in range(n):\n", + " x = random.choice('HT')\n", + " if x == 'H': \n", + " nheads += 1\n", + " else:\n", + " ntails += 1\n", + "print(ntails)\n", + "print(nheads)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "42\n", + "58\n" + ] + } + ], + "source": [ + "# 2. megoldás\n", + "import random\n", + "n = 100\n", + "x = [random.choice('HT') for i in range(n)]\n", + "print(x.count('H'))\n", + "print(x.count('T'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Oldjuk meg a feladatot 'fej' és 'írás' dobások használatával!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. feladat\n", + "\n", + "Készítsünk programot, amely szimulál egy n hosszú pénzfeldobás sorozatot, majd kiírja a leghosszabb fej ill. írás sorozat hosszát!" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T T T T T H H T H H H T T H H H T T H H\n", + "3\n", + "5\n" + ] + } + ], + "source": [ + "import random\n", + "\n", + "def longest_sequence(x, sign):\n", + " maxlen = 0\n", + " actlen = 0\n", + " for xi in x:\n", + " if xi == sign:\n", + " actlen += 1\n", + " if actlen > maxlen:\n", + " maxlen = actlen\n", + " else:\n", + " actlen = 0\n", + " return maxlen\n", + "\n", + "n = 20\n", + "x = [random.choice('HT') for i in range(n)]\n", + "\n", + "print(' '.join(x))\n", + "print(longest_sequence(x, 'H'))\n", + "print(longest_sequence(x, 'T'))" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['T', 'H', 'H', 'T', 'T', 'H', 'H', 'H', 'H', 'T']\n", + "4\n" + ] + } + ], + "source": [ + "# ... a leghosszabb sorozat hossza (nem külön-külön számolva)\n", + "\n", + "import random\n", + "n = 10\n", + "sorsolas = [random.choice('HT') for i in range(n)]\n", + "\n", + "sorozat = 1\n", + "sorozat_max = 1\n", + "for x in range(1, n):\n", + " if sorsolas[x] == sorsolas[x - 1]:\n", + " sorozat += 1\n", + " else:\n", + " sorozat = 1\n", + " \n", + " if sorozat > sorozat_max:\n", + " sorozat_max = sorozat\n", + " \n", + "print(sorsolas)\n", + "print(sorozat_max)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Módosítsuk a megoldást úgy, hogy megadjuk azt is, hogy hány db ilyen (maximális hosszú) sorozat létezett a dobássorozatban!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Az előadás anyagához kapcsolódó feladatok\n", + "- Módosítsuk a személyek és születési dátumok rendezett listáját megadó megoldást úgy, hogy az adott személyeknek ne a születési dátumát, hanem az életkorát (a betöltött évek száma) jelenítsük meg!\n", + "- Oldjuk meg a két kockával dobott dobásösszeg gyakoriságok meghatározását szótár segítségével!\n", + "- Hasonlítsuk össze (azaz 'mérjük meg') a 20. századi péntek 13-kák számát meghatározó megoldások futási idejét!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "- Készítsünk egy saját modult (azaz egy py kiterjesztésű szövegfájlt, amiben legyen pl. egy saját függvény)! Használjuk ezt a saját modult (azaz hívjuk meg pl. a modulban lévő függvényt)! \n", + "- Határozzuk meg és írjuk ki azt, hogy hány napot éltünk!\n", + "- Generáljunk véletlenszerűen egy ezévi (helyes) dátumot!\n", + "- Készítsünk programot, amelyik 'kő-papír-olló' játékot szimulál két játékos között! Generáljunk n db véletlen 'választás-párt', értékeljük ki ezeket és adjuk meg, hogy hányszor nyert az első, hányszor a második játékos, ill. hány döntetlen született!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + " ### Házi feladatok\n", + " - Az ember nem betűnként olvas, hanem valahogy másképp (pl. 'ránézéssel'). Ennek igazolására alakítsunk át egy mondatot (amelyben a szavak csak kisbetűket tartalmaznak és a szavak között pontosan egy db szóköz található) úgy, hogy a szavak sorrendjét megtartjuk, de a szavakat átalakítjuk! A legfeljebb 3 betűt tartalmazó szavak maradjanak változatlanok, a hosszabbak esetén az első és utolsó betűt a helyükön hagyva, a többi betűt keverjük meg véletlenszerűen! Nézzük meg, hogy el tudjuk-e olvasni az átalakított mondatot is kb. ugyanolyan gyorsan, mint az eredetit! Pl. 'na el tudod ezt is gyorsan olvasni' => 'na el tdoud ezt is gsryaon onslvai'.\n", + " - Nehezítsük az előző feladatot a magyar két (pl. 'gy', 'sz'), ill. hárombetűs ('dzs') 'betűk' kezelésével! Az ilyen 'betűket' egy betűként kezeljük! Pl. a 'gyász' szó így 'hárombetűs' szó lévén nem fog megváltozni, de a 'lándzsa' szó 'ötbetűs', aminek egy átalakítása lehet a 'ldzsána' szó (ahol a 'dzs' betű egyben maradt)!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/09_ea.ipynb b/09_ea.ipynb new file mode 100644 index 0000000..bd274db --- /dev/null +++ b/09_ea.ipynb @@ -0,0 +1,2891 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Fájlkezelés](https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files)\n", + "\n", + "- A fájl valamilyen adathordozón tárolt, logikailag összefüggő adatok összessége.\n", + "- Egy fájl életciklusa a következő lépésekből áll:\n", + " 1. megnyitás\n", + " 2. olvasás, írás, pozícionálás, ...\n", + " 3. bezárás" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Fájl megnyitása (precízebben: létező fájl megnyitása olvasásra).\n", + "f = open('example_file.txt')" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "_io.TextIOWrapper" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(f)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# Fájl bezárása.\n", + "f.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "# example data\n", + "apple,10\n", + "pear,20\n", + "cherry,30\n", + "\n" + ] + } + ], + "source": [ + "# Fájl tartalmának beolvasása sztringbe.\n", + "f = open('example_file.txt')\n", + "s = f.read()\n", + "f.close()\n", + "print(s)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "# example data\n", + "apple,10\n", + "pear,20\n", + "cherry,30\n", + "\n" + ] + } + ], + "source": [ + "# ...ugyenez rövidebben:\n", + "s = open('example_file.txt').read()\n", + "print(s)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzés: CPython értelmező esetén a fájl automatikusan bezáródik, ha minden hivatkozás megszűnik rá." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "# example data\n", + "\n", + "apple,10\n", + "\n" + ] + } + ], + "source": [ + "# Első 2 sor beolvasása.\n", + "f = open('example_file.txt')\n", + "print(f.readline())\n", + "print(f.readline())\n", + "f.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'# example data\\n'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Megjegyzés: A readline a sortörést is beteszi az eredménybe.\n", + "line = open('example_file.txt').readline()\n", + "line" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'# example data'" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A sortörést pl. a strip függvénnyel vághatjuk le:\n", + "line.strip()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['# example data\\n', 'apple,10\\n', 'pear,20\\n', 'cherry,30\\n']" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Fájl sorainak beolvasása sztringlistába.\n", + "open('example_file.txt').readlines()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['aa', 'bb', 'ccc']" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sztring darabolása egy határoló jelsorozat mentén (tokenizálás).\n", + "line = 'aa,bb,ccc'\n", + "line.split(',')" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['aa', 'bb', 'ccc']" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Alapértelmezés szerint a split fehér karakterek mentén darabol.\n", + "line = 'aa bb\\tccc\\n'\n", + "line.split()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "# example data\n", + "\n", + "apple,10\n", + "\n", + "pear,20\n", + "\n", + "cherry,30\n", + "\n" + ] + } + ], + "source": [ + "# Iterálás egy szövegfájl sorain.\n", + "for line in open('example_file.txt'):\n", + " print(line)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "# Fájl első sorának átugrása, a további sorok tokenizálása.\n", + "f = open('example_file.txt')\n", + "f.readline() # első sor átugrása\n", + "data = []\n", + "for line in f: # végigmegyünk a további sorokon\n", + " tok = line.strip().split(',')\n", + " rec = tok[0], int(tok[1])\n", + " data.append(rec)\n", + "f.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('apple', 10), ('pear', 20), ('cherry', 30)]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "# Sztring fájlba írása.\n", + "f = open('example_file_2.txt', 'w')\n", + "f.write('Apple\\nBanana\\n')\n", + "f.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "13" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...ugyanez tömörebben:\n", + "open('example_file_2.txt', 'w').write('Apple\\nBanana\\n')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "(CPython értelmező esetén a fájl azonnal bezáródik, mivel nincsen rá több hivatkozás.)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "# Celsius-Fahrenheit táblázatot tartalmazó fájl elkészítése.\n", + "file = open('celsius_fahrenheit.txt', 'w')\n", + "file.write(f' °C °F\\n')\n", + "for c in range(-40, 41, 5):\n", + " f = c * 9 / 5 + 32\n", + " file.write(f'{c:8}{f:8}\\n')\n", + "file.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'a',\n", + " 'az',\n", + " 'csinálja',\n", + " 'egyáltalán',\n", + " 'fortranban',\n", + " 'gépidőelszámolást',\n", + " 'ha',\n", + " 'igazi',\n", + " 'intelligencia',\n", + " 'manipulációt',\n", + " 'megcsinálja',\n", + " 'mesterséges',\n", + " 'már',\n", + " 'programokat',\n", + " 'programozó',\n", + " 'szimbólum',\n", + " 'szövegkezelést'}" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Határozzuk meg az igazi.txt szövegfájlban található szavak halmazát!\n", + "{line.strip() for line in open('igazi.txt', encoding='utf-8')}" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[[0, 1, 1, 0, 1, 0, 1, 1, 0, 1],\n", + " [0, 0, 1, 0, 1, 1, 0, 1, 0, 1],\n", + " [0, 0, 1, 0, 0, 0, 1, 1, 0, 0],\n", + " [0, 1, 0, 0, 1, 0, 1, 1, 0, 0],\n", + " [1, 0, 1, 1, 0, 0, 1, 0, 1, 1],\n", + " [1, 0, 1, 0, 0, 1, 1, 0, 1, 0],\n", + " [1, 1, 1, 0, 1, 1, 1, 0, 1, 1],\n", + " [0, 0, 0, 0, 0, 1, 0, 1, 0, 1],\n", + " [1, 1, 0, 1, 0, 1, 1, 1, 0, 0],\n", + " [1, 0, 1, 0, 1, 0, 0, 1, 0, 1]]" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Olvassuk be a matrix.txt szövegfájl tartalmát egész számok listájának listájába!\n", + "matrix = []\n", + "for line in open('matrix.txt'):\n", + " row = [int(x) for x in line.split()]\n", + " matrix.append(row)\n", + "matrix" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[[0, 1, 1, 0, 1, 0, 1, 1, 0, 1],\n", + " [0, 0, 1, 0, 1, 1, 0, 1, 0, 1],\n", + " [0, 0, 1, 0, 0, 0, 1, 1, 0, 0],\n", + " [0, 1, 0, 0, 1, 0, 1, 1, 0, 0],\n", + " [1, 0, 1, 1, 0, 0, 1, 0, 1, 1],\n", + " [1, 0, 1, 0, 0, 1, 1, 0, 1, 0],\n", + " [1, 1, 1, 0, 1, 1, 1, 0, 1, 1],\n", + " [0, 0, 0, 0, 0, 1, 0, 1, 0, 1],\n", + " [1, 1, 0, 1, 0, 1, 1, 1, 0, 0],\n", + " [1, 0, 1, 0, 1, 0, 0, 1, 0, 1]]" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ugyanez dupla comprehension-nel:\n", + "matrix = [[int(x) for x in l.split()]\n", + " for l in open('matrix.txt')]\n", + "matrix" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Gyakorlás: Szóstatisztika\n", + "\n", + "A [hamlet.txt](hamlet.txt) fájl a [Hamlet](https://hu.wikipedia.org/wiki/Hamlet,_d%C3%A1n_kir%C3%A1lyfi) angol nyelvű szövegkönyvét tartalmazza. Készítsünk programot, amely kiszámítja majd kiírja a szövegkönyvben szereplő 30 leggyakoribb szót! A szó definíciója a következő legyen:\n", + "\n", + "- A szavakat a fehér karakterek (szóköz, tabulátor, soremelés) választják el egymástól.\n", + "- A kis- és nagybetűk ne számítsanak különbözőnek!\n", + "- A szó elején és végén található központozás karakterek ne számítsanak bele a szóba!" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "# Beolvasás kisbetűs szavak listájába.\n", + "words = open('hamlet.txt').read().lower().split()" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "# Központozás karakterek eltávolítása.\n", + "import string\n", + "words = [w.strip(string.punctuation) for w in words]" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [], + "source": [ + "# Szógyakoriságok kiszámítása.\n", + "freq = {} # kulcs: szó, érték: előfordulások száma\n", + "for w in words:\n", + " if w in freq: freq[w] += 1\n", + " else: freq[w] = 1" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "freq2 = sorted([(x[1], x[0]) for x in freq.items()], reverse=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(1145, 'the')\n", + "(973, 'and')\n", + "(736, 'to')\n", + "(674, 'of')\n", + "(565, 'i')\n", + "(539, 'you')\n", + "(534, 'a')\n", + "(513, 'my')\n", + "(431, 'in')\n", + "(409, 'it')\n", + "(381, 'that')\n", + "(358, 'ham')\n", + "(339, 'is')\n", + "(310, 'not')\n", + "(297, 'this')\n", + "(297, 'his')\n", + "(268, 'with')\n", + "(258, 'but')\n", + "(248, 'for')\n", + "(241, 'your')\n", + "(231, 'me')\n", + "(223, 'lord')\n", + "(219, 'as')\n", + "(216, 'be')\n", + "(213, 'he')\n", + "(200, 'what')\n", + "(195, 'king')\n", + "(195, 'him')\n", + "(194, 'so')\n", + "(180, 'have')\n" + ] + } + ], + "source": [ + "# Kiírás.\n", + "for i in range(30):\n", + " print(freq2[i])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Gyakorlás: Premier League tabella\n", + "\n", + "A [pl.txt](pl.txt) szövegfájl a Premier League 2011-12-es szezonjának eredményeit tartalmazza. Készítsünk programot, amely:\n", + "\n", + "- kiírja, hogy a mérkőzések hány százalékán esett gól,\n", + "- kiírja, hogy melyik mérkőzésen esett a legtöbb gól,\n", + "- bekéri a felhasználótól n értékét, majd kiírja a bajnokság állását az n. forduló után (rendezési szempontok: pontszám, gólkülönbség, több rúgott gól)!" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "# Adatok beolvasása szótárak listájába.\n", + "games = []\n", + "f = open('pl.txt')\n", + "\n", + "# első 6 sor átugrása\n", + "for i in range(6): f.readline()\n", + " \n", + "# további sorok feldolgozása\n", + "for line in f:\n", + " tok = line.split('\\t')\n", + " rec = {\n", + " 'round': int(tok[0]),\n", + " 'hteam': tok[1],\n", + " 'ateam': tok[2],\n", + " 'hgoals': int(tok[3]),\n", + " 'agoals': int(tok[4])\n", + " }\n", + " games.append(rec)\n", + " \n", + "f.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'round': 1,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 1,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 1,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 1,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 0,\n", + " 'agoals': 4},\n", + " {'round': 1,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 1,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 1,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 1,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 1,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 1,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 2,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 2,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 2,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 2,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 2,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 2,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 2,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 2,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 2,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 2,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 3,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 3,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 3,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 3,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 3,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 3,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 3,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 3,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 5},\n", + " {'round': 3,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 3,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 8,\n", + " 'agoals': 2},\n", + " {'round': 4,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 4,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 4,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 4,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 4,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 4,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 4,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 5},\n", + " {'round': 4,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 4,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 4,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 5,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 4,\n", + " 'agoals': 3},\n", + " {'round': 5,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 5,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 5,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 5,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 5,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 0,\n", + " 'agoals': 3},\n", + " {'round': 5,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 5,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 5,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 5,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 6,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 6,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 6,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 4,\n", + " 'agoals': 1},\n", + " {'round': 6,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 6,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 6,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 6,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 6,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 6,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 6,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 7,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 7,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 7,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 0,\n", + " 'agoals': 4},\n", + " {'round': 7,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 7,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 7,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 7,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 5},\n", + " {'round': 7,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 6,\n", + " 'agoals': 0},\n", + " {'round': 7,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 7,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 8,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 8,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 4,\n", + " 'agoals': 1},\n", + " {'round': 8,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 8,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 8,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 8,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 8,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 8,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 8,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 8,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 9,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 9,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 9,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 9,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 9,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 9,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 9,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 9,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 6},\n", + " {'round': 9,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 9,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 10,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 10,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 5},\n", + " {'round': 10,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 10,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 3},\n", + " {'round': 10,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 10,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 10,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 10,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 10,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 10,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 11,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 11,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 11,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 3,\n", + " 'agoals': 2},\n", + " {'round': 11,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 11,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 11,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 11,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 11,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 11,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 5,\n", + " 'agoals': 0},\n", + " {'round': 11,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 12,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 12,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 12,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 12,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 12,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 12,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 12,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 3},\n", + " {'round': 12,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 12,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 12,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 13,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 13,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 13,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 13,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 13,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 13,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 13,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 13,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 13,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 13,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 14,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 3},\n", + " {'round': 14,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 4,\n", + " 'agoals': 2},\n", + " {'round': 14,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 5,\n", + " 'agoals': 1},\n", + " {'round': 14,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 14,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 14,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 4},\n", + " {'round': 14,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 14,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 14,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 14,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 15,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 15,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 15,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 15,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 4,\n", + " 'agoals': 1},\n", + " {'round': 15,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 4,\n", + " 'agoals': 2},\n", + " {'round': 15,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 15,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 15,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 15,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 15,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 16,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 16,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 16,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 16,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 16,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 16,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 16,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 16,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 16,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 16,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 17,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 17,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 17,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 17,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 17,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 17,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 17,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 17,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 17,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 5},\n", + " {'round': 17,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 18,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 18,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 18,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 18,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 5,\n", + " 'agoals': 0},\n", + " {'round': 18,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 18,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 18,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 18,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 18,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 18,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 19,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 19,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 19,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 19,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 19,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 19,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 19,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 19,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 19,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 19,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 20,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 20,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 20,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 20,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 20,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 20,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 20,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 1,\n", + " 'agoals': 4},\n", + " {'round': 20,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 20,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 20,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 21,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 21,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 21,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 21,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 21,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 21,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 21,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 21,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 21,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 2},\n", + " {'round': 21,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 22,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 22,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 22,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 5,\n", + " 'agoals': 2},\n", + " {'round': 22,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 22,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 22,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 22,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 22,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 22,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 3,\n", + " 'agoals': 2},\n", + " {'round': 22,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 23,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 23,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 23,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 3},\n", + " {'round': 23,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 23,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 23,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 23,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 23,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 23,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 23,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 24,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 7,\n", + " 'agoals': 1},\n", + " {'round': 24,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 24,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 24,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 24,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 24,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 24,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 24,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 24,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 3,\n", + " 'agoals': 3},\n", + " {'round': 24,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 25,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 25,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 3,\n", + " 'agoals': 2},\n", + " {'round': 25,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 25,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 25,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 25,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 25,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 25,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 5,\n", + " 'agoals': 0},\n", + " {'round': 25,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 5},\n", + " {'round': 25,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 26,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 26,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 26,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 26,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 26,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 26,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 26,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 5,\n", + " 'agoals': 2},\n", + " {'round': 26,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 26,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 26,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 27,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 27,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 27,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 27,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 27,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 27,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 27,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 27,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 27,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 5,\n", + " 'agoals': 0},\n", + " {'round': 27,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 28,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 28,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 28,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 28,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 28,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 28,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 28,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 28,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 28,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 28,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 29,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 0,\n", + " 'agoals': 3},\n", + " {'round': 29,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 29,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 5},\n", + " {'round': 29,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 29,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 29,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 29,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 29,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 29,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 3,\n", + " 'agoals': 2},\n", + " {'round': 29,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 30,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 30,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 30,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 30,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 30,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 30,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 30,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 30,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 30,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 1,\n", + " 'agoals': 3},\n", + " {'round': 30,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 31,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 4},\n", + " {'round': 31,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 31,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 31,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 3,\n", + " 'agoals': 3},\n", + " {'round': 31,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 31,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 31,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 31,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 31,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 31,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 32,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 32,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 32,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 3},\n", + " {'round': 32,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 32,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 32,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 32,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 32,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 32,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 32,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 33,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 33,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 33,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 33,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 33,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 33,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 33,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 33,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 33,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 3},\n", + " {'round': 33,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 34,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 1,\n", + " 'agoals': 6},\n", + " {'round': 34,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 34,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 34,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 34,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 34,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 1,\n", + " 'agoals': 2},\n", + " {'round': 34,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 34,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 34,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 34,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 4},\n", + " {'round': 35,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 35,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 35,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 35,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 35,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 35,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 3,\n", + " 'agoals': 0},\n", + " {'round': 35,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 35,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 4,\n", + " 'agoals': 4},\n", + " {'round': 35,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 35,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 36,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 36,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 36,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 36,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 4,\n", + " 'agoals': 4},\n", + " {'round': 36,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 36,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 4,\n", + " 'agoals': 0},\n", + " {'round': 36,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 3},\n", + " {'round': 36,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 6,\n", + " 'agoals': 1},\n", + " {'round': 36,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 36,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 37,\n", + " 'hteam': 'Arsenal FC',\n", + " 'ateam': 'Norwich City',\n", + " 'hgoals': 3,\n", + " 'agoals': 3},\n", + " {'round': 37,\n", + " 'hteam': 'Newcastle United',\n", + " 'ateam': 'Manchester City',\n", + " 'hgoals': 0,\n", + " 'agoals': 2},\n", + " {'round': 37,\n", + " 'hteam': 'Aston Villa',\n", + " 'ateam': 'Tottenham Hotspur',\n", + " 'hgoals': 1,\n", + " 'agoals': 1},\n", + " {'round': 37,\n", + " 'hteam': 'Bolton Wanderers',\n", + " 'ateam': 'West Bromwich Albion',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 37,\n", + " 'hteam': 'Fulham FC',\n", + " 'ateam': 'Sunderland AFC',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 37,\n", + " 'hteam': 'Queens Park Rangers',\n", + " 'ateam': 'Stoke City',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 37,\n", + " 'hteam': 'Wolverhampton Wanderers',\n", + " 'ateam': 'Everton FC',\n", + " 'hgoals': 0,\n", + " 'agoals': 0},\n", + " {'round': 37,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Swansea City',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 37,\n", + " 'hteam': 'Blackburn Rovers',\n", + " 'ateam': 'Wigan Athletic',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 37,\n", + " 'hteam': 'Liverpool FC',\n", + " 'ateam': 'Chelsea FC',\n", + " 'hgoals': 4,\n", + " 'agoals': 1},\n", + " {'round': 38,\n", + " 'hteam': 'Chelsea FC',\n", + " 'ateam': 'Blackburn Rovers',\n", + " 'hgoals': 2,\n", + " 'agoals': 1},\n", + " {'round': 38,\n", + " 'hteam': 'Everton FC',\n", + " 'ateam': 'Newcastle United',\n", + " 'hgoals': 3,\n", + " 'agoals': 1},\n", + " {'round': 38,\n", + " 'hteam': 'Manchester City',\n", + " 'ateam': 'Queens Park Rangers',\n", + " 'hgoals': 3,\n", + " 'agoals': 2},\n", + " {'round': 38,\n", + " 'hteam': 'Norwich City',\n", + " 'ateam': 'Aston Villa',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 38,\n", + " 'hteam': 'Stoke City',\n", + " 'ateam': 'Bolton Wanderers',\n", + " 'hgoals': 2,\n", + " 'agoals': 2},\n", + " {'round': 38,\n", + " 'hteam': 'Sunderland AFC',\n", + " 'ateam': 'Manchester United',\n", + " 'hgoals': 0,\n", + " 'agoals': 1},\n", + " {'round': 38,\n", + " 'hteam': 'Swansea City',\n", + " 'ateam': 'Liverpool FC',\n", + " 'hgoals': 1,\n", + " 'agoals': 0},\n", + " {'round': 38,\n", + " 'hteam': 'Tottenham Hotspur',\n", + " 'ateam': 'Fulham FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 0},\n", + " {'round': 38,\n", + " 'hteam': 'West Bromwich Albion',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 2,\n", + " 'agoals': 3},\n", + " {'round': 38,\n", + " 'hteam': 'Wigan Athletic',\n", + " 'ateam': 'Wolverhampton Wanderers',\n", + " 'hgoals': 3,\n", + " 'agoals': 2}]" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "games" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "92.89473684210526" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A mérkőzések hány százalékán esett gól?\n", + "count = 0\n", + "for g in games:\n", + " if g['hgoals'] + g['agoals'] > 0:\n", + " count += 1\n", + "count / len(games) * 100" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "92.89473684210526" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...ugyanez tömörebben:\n", + "sum([g['hgoals'] + g['agoals'] > 0 for g in games]) / len(games) * 100" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'round': 3,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 8,\n", + " 'agoals': 2}" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Melyik mérkőzésen esett a legtöbb gól?\n", + "maxgoals = 0\n", + "for g in games:\n", + " goals = g['hgoals'] + g['hgoals']\n", + " if goals > maxgoals:\n", + " maxgoals = goals\n", + " bestgame = g\n", + "bestgame" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'round': 3,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 8,\n", + " 'agoals': 2}" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...ugyanez tömörebben:\n", + "max([(g['hgoals'] + g['agoals'], g) for g in games], key=lambda x: x[0])[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'round': 3,\n", + " 'hteam': 'Manchester United',\n", + " 'ateam': 'Arsenal FC',\n", + " 'hgoals': 8,\n", + " 'agoals': 2}" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...még tömörebben:\n", + "max(games, key=lambda g: g['hgoals'] + g['agoals'])" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "n: 2\n" + ] + } + ], + "source": [ + "# A bajnokság állása az n. forduló után (rendezési szempontok: pontszám, gólkülönbség, több rúgott gól).\n", + "# - a győztes 3, a vesztes 0 pontot kap\n", + "# - döntetlen esetén mindkét csapat 1 pontot kap\n", + "\n", + "# n bekérése\n", + "n = int(input('n: '))" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [], + "source": [ + "teams = {} # kulcs: csapatnév, érték: [pontszám, gólkülönbség, rúgott gólok száma] - az n. forduló után\n", + "\n", + "# csapatok felvétele\n", + "for g in games:\n", + " teams[g['hteam']] = [0, 0, 0]\n", + " \n", + "# statisztikák frissítése\n", + "for g in games:\n", + " if g['round'] <= n:\n", + " hstats = teams[g['hteam']]\n", + " astats = teams[g['ateam']]\n", + " \n", + " # pontszám frissítése\n", + " if g['hgoals'] > g['agoals']:\n", + " hstats[0] += 3\n", + " elif g['hgoals'] == g['agoals']:\n", + " hstats[0] += 1\n", + " astats[0] += 1\n", + " else:\n", + " astats[0] += 3\n", + " \n", + " # gólkülönbség frissítése\n", + " gdiff = g['hgoals'] - g['agoals']\n", + " hstats[1] += gdiff\n", + " astats[1] -= gdiff\n", + " \n", + " # rúgott gólok számának frissítése\n", + " hstats[2] += g['hgoals']\n", + " astats[2] += g['agoals']" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Blackburn Rovers': [0, -3, 2],\n", + " 'Fulham FC': [1, -2, 0],\n", + " 'Liverpool FC': [4, 2, 3],\n", + " 'Queens Park Rangers': [3, -3, 1],\n", + " 'Wigan Athletic': [2, 0, 1],\n", + " 'Newcastle United': [4, 1, 1],\n", + " 'Stoke City': [2, 0, 1],\n", + " 'West Bromwich Albion': [0, -2, 2],\n", + " 'Manchester City': [6, 5, 7],\n", + " 'Tottenham Hotspur': [3, -1, 2],\n", + " 'Sunderland AFC': [1, -1, 1],\n", + " 'Arsenal FC': [1, -2, 0],\n", + " 'Aston Villa': [4, 2, 3],\n", + " 'Everton FC': [0, -3, 0],\n", + " 'Swansea City': [1, -4, 0],\n", + " 'Chelsea FC': [4, 1, 2],\n", + " 'Norwich City': [2, 0, 2],\n", + " 'Wolverhampton Wanderers': [6, 3, 4],\n", + " 'Bolton Wanderers': [3, 3, 6],\n", + " 'Manchester United': [6, 4, 5]}" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "teams" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [], + "source": [ + "# A statisztikák frissítése, tömörebben:\n", + "\n", + "teams = {} # kulcs: csapatnév, érték: [pontszám, gólkülönbség, rúgott gólok száma] - az n. forduló után\n", + "for g in games:\n", + " teams[g['hteam']] = [0, 0, 0] # inicializálás\n", + "\n", + "def update_stats(mgoals, ogoals, stats):\n", + " if mgoals > ogoals: stats[0] += 3\n", + " elif mgoals == ogoals: stats[0] += 1\n", + " \n", + " stats[1] += mgoals - ogoals\n", + " stats[2] += mgoals\n", + "\n", + "# statisztikák frissítése\n", + "for g in games:\n", + " if g['round'] <= n:\n", + " update_stats(g['hgoals'], g['agoals'], teams[g['hteam']]) # hazai \"nézőpont\"\n", + " update_stats(g['agoals'], g['hgoals'], teams[g['ateam']]) # vendég \"nézőpont\"" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Blackburn Rovers': [0, -3, 2],\n", + " 'Fulham FC': [1, -2, 0],\n", + " 'Liverpool FC': [4, 2, 3],\n", + " 'Queens Park Rangers': [3, -3, 1],\n", + " 'Wigan Athletic': [2, 0, 1],\n", + " 'Newcastle United': [4, 1, 1],\n", + " 'Stoke City': [2, 0, 1],\n", + " 'West Bromwich Albion': [0, -2, 2],\n", + " 'Manchester City': [6, 5, 7],\n", + " 'Tottenham Hotspur': [3, -1, 2],\n", + " 'Sunderland AFC': [1, -1, 1],\n", + " 'Arsenal FC': [1, -2, 0],\n", + " 'Aston Villa': [4, 2, 3],\n", + " 'Everton FC': [0, -3, 0],\n", + " 'Swansea City': [1, -4, 0],\n", + " 'Chelsea FC': [4, 1, 2],\n", + " 'Norwich City': [2, 0, 2],\n", + " 'Wolverhampton Wanderers': [6, 3, 4],\n", + " 'Bolton Wanderers': [3, 3, 6],\n", + " 'Manchester United': [6, 4, 5]}" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "teams" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "# rendezés\n", + "ranking = sorted(teams, key=lambda t: teams[t], reverse=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 1. Manchester City 5 7 6\n", + " 2. Manchester United 4 5 6\n", + " 3. Wolverhampton Wanderers 3 4 6\n", + " 4. Liverpool FC 2 3 4\n", + " 5. Aston Villa 2 3 4\n", + " 6. Chelsea FC 1 2 4\n", + " 7. Newcastle United 1 1 4\n", + " 8. Bolton Wanderers 3 6 3\n", + " 9. Tottenham Hotspur -1 2 3\n", + "10. Queens Park Rangers -3 1 3\n", + "11. Norwich City 0 2 2\n", + "12. Wigan Athletic 0 1 2\n", + "13. Stoke City 0 1 2\n", + "14. Sunderland AFC -1 1 1\n", + "15. Fulham FC -2 0 1\n", + "16. Arsenal FC -2 0 1\n", + "17. Swansea City -4 0 1\n", + "18. West Bromwich Albion -2 2 0\n", + "19. Blackburn Rovers -3 2 0\n", + "20. Everton FC -3 0 0\n" + ] + } + ], + "source": [ + "# formázott kiírás\n", + "idx = 0\n", + "for t in ranking:\n", + " idx += 1\n", + " s = teams[t]\n", + " print(f'{idx:2}. {t:25} {s[1]:4} {s[2]:4} {s[0]:4}')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/09_gyak.ipynb b/09_gyak.ipynb new file mode 100644 index 0000000..1187f5e --- /dev/null +++ b/09_gyak.ipynb @@ -0,0 +1,54 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 9. heti előadás anyagát tartalmazó Jupyter notebook (09_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Készítsünk programokat az alábbi feladatokra!\n", + "- Olvassuk be a 'matrix.txt' adatait, majd határozzuk meg minden egyes oszlopra az 1-esek darabszámát!\n", + "- Határozzuk meg az 'igazi.txt' fájlban található leghosszabb és legrövidebb szót!\n", + "- Hány olyan szó van a 'hamlet.txt' fájlban, amiben csak betű van?\n", + "- Határozzuk meg a 'hamlet.txt' fájl szavaira azt, hogy a szavak hányadrésze tartalmaz angol nagybetűt!\n", + "- Határozzuk meg a Premier League adatok ('pl.txt') alapján (a tabella elkészítése nélkül), hogy egy adott csapat (pl. 'Liverpool FC') hány gólt rúgott a szezonban!\n", + "- A Premier League eredménytáblázatát (a tabellát) ne a képernyőre, hanem szövegfájlba írjuk ki, ahol a fájl nevében szerepeljen a forduló sorszáma is (amellyel bezárólag készül a tabella, például: 'pl_tab_02.txt' a 2. forduló utáni tabellát tartalmazza)!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/10_ea.ipynb b/10_ea.ipynb new file mode 100644 index 0000000..bbde958 --- /dev/null +++ b/10_ea.ipynb @@ -0,0 +1,1019 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Kivételkezelés](https://docs.python.org/3/tutorial/errors.html)\n", + "\n", + "- A kivételkezelés egy modern megközelítés a hibakezelésre. Lehetővé teszi hogy a legalkalmasabb helyen végezzük el a hibakezelést.\n", + "- A korábban uralkodó a hibakód alapú nehézkesebb. Tegyük fel, hogy a függvényhívási stack sokadik szintjén lép fel egy hiba. A hibát a kód sok pontján kell kezelni (a hívó függvényben, a hívót hívó függvényben stb.), ami kódduplikáláshoz vagy GOTO utasítások alkalmazásához vezet.\n", + "- A kivételeket a [raise](https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement) utasítás segítségével lehet létrehozni, és a [try](https://docs.python.org/3/reference/compound_stmts.html#the-try-statement) utasítás segítségével lehet elkapni.\n", + "- A beépített kivétel típusok hierarchiája [itt](https://docs.python.org/3/library/exceptions.html#exception-hierarchy) tekinthető át." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kérek egy páros számot: 11\n" + ] + }, + { + "ename": "ValueError", + "evalue": "n páratlan", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[1], line 4\u001b[0m\n\u001b[0;32m 2\u001b[0m n \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(\u001b[38;5;28minput\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mKérek egy páros számot: \u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[0;32m 3\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m n \u001b[38;5;241m%\u001b[39m \u001b[38;5;241m2\u001b[39m \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[1;32m----> 4\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mn páratlan\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 5\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mVÉGE\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", + "\u001b[1;31mValueError\u001b[0m: n páratlan" + ] + } + ], + "source": [ + "# Kivétel létrehozása.\n", + "n = int(input('Kérek egy páros számot: '))\n", + "if n % 2 == 1:\n", + " raise ValueError('n páratlan')\n", + "print('VÉGE')" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x: asd\n", + "ValueError\n", + "FOO\n", + "VÉGE\n" + ] + } + ], + "source": [ + "# Kivétel elkapása.\n", + "try:\n", + " x = float(input('x: '))\n", + " y = float(input('y: '))\n", + " print(x / y)\n", + "except ValueError:\n", + " print('ValueError')\n", + "except ZeroDivisionError:\n", + " print('ZeroDivisionError')\n", + "finally:\n", + " print('FOO')\n", + " \n", + "print('VÉGE')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Hibakeresés" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "ename": "ZeroDivisionError", + "evalue": "division by zero", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[3], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Első lépés: A hibaüzenetet MINDIG olvassuk el! :-)\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;241m1\u001b[39m \u001b[38;5;241m/\u001b[39m \u001b[38;5;241m0\u001b[39m\n", + "\u001b[1;31mZeroDivisionError\u001b[0m: division by zero" + ] + } + ], + "source": [ + "# Első lépés: A hibaüzenetet MINDIG olvassuk el! :-)\n", + "1 / 0" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# Példa egy hibás függvényre.\n", + "def calc_average(list_of_lists):\n", + " joined = []\n", + " for l in list_of_lists:\n", + " joined.append(l)\n", + " return sum(joined) / len(joined)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "unsupported operand type(s) for +: 'int' and 'list'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[5], line 3\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Számítsuk ki az alábbi számok átlagát!\u001b[39;00m\n\u001b[0;32m 2\u001b[0m sequences \u001b[38;5;241m=\u001b[39m [[\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m3\u001b[39m], [\u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m], [\u001b[38;5;241m6\u001b[39m, \u001b[38;5;241m7\u001b[39m]]\n\u001b[1;32m----> 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(calc_average(sequences))\n", + "Cell \u001b[1;32mIn[4], line 6\u001b[0m, in \u001b[0;36mcalc_average\u001b[1;34m(list_of_lists)\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m l \u001b[38;5;129;01min\u001b[39;00m list_of_lists:\n\u001b[0;32m 5\u001b[0m joined\u001b[38;5;241m.\u001b[39mappend(l)\n\u001b[1;32m----> 6\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msum\u001b[39m(joined) \u001b[38;5;241m/\u001b[39m \u001b[38;5;28mlen\u001b[39m(joined)\n", + "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for +: 'int' and 'list'" + ] + } + ], + "source": [ + "# Számítsuk ki az alábbi számok átlagát!\n", + "sequences = [[1, 2, 3], [4, 5], [6, 7]]\n", + "print(calc_average(sequences))" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "> \u001b[1;32mc:\\users\\puszt\\appdata\\local\\temp\\ipykernel_20788\\261683529.py\u001b[0m(6)\u001b[0;36mcalc_average\u001b[1;34m()\u001b[0m\n", + "\n", + "ipdb> print(joined)\n", + "[[1, 2, 3], [4, 5], [6, 7]]\n", + "ipdb> q\n" + ] + } + ], + "source": [ + "# Keressük meg a hibát a %debug parancs segítségével!\n", + "%debug" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4.0\n" + ] + } + ], + "source": [ + "# A függvény javított változata.\n", + "def calc_average(list_of_lists):\n", + " joined = []\n", + " for l in list_of_lists:\n", + " joined.extend(l)\n", + " return sum(joined) / len(joined)\n", + "\n", + "print(calc_average(sequences))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Fejezetek a [standard könyvtárból](https://docs.python.org/3/library/index.html) II." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [collections](https://docs.python.org/3/library/collections.html)\n", + "- Specializált konténer adattípusokat tartalmaz." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "import collections" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Counter({'a': 5, 'b': 2, 'r': 2, 'k': 1, 'd': 1})" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Gyakoriságszámító szótár (Counter).\n", + "s = 'abrakadabra'\n", + "collections.Counter(s)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('the', 1145),\n", + " ('and', 973),\n", + " ('to', 736),\n", + " ('of', 674),\n", + " ('i', 565),\n", + " ('you', 539),\n", + " ('a', 534),\n", + " ('my', 513),\n", + " ('in', 431),\n", + " ('it', 409),\n", + " ('that', 381),\n", + " ('ham', 358),\n", + " ('is', 339),\n", + " ('not', 310),\n", + " ('his', 297),\n", + " ('this', 297),\n", + " ('with', 268),\n", + " ('but', 258),\n", + " ('for', 248),\n", + " ('your', 241),\n", + " ('me', 231),\n", + " ('lord', 223),\n", + " ('as', 219),\n", + " ('be', 216),\n", + " ('he', 213),\n", + " ('what', 200),\n", + " ('king', 195),\n", + " ('him', 195),\n", + " ('so', 194),\n", + " ('have', 180)]" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A szavak gyakorisága a Hamletben, Counterrel kiszámolva.\n", + "import collections, string\n", + "words = open('hamlet.txt').read().lower().split()\n", + "words = [w.strip(string.punctuation) for w in words]\n", + "collections.Counter(words).most_common(30)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "# Alapértelmezett értékkel rendelkező szótár (defaultdict).\n", + "d = collections.defaultdict(list)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "# Új kulcs-érték pár hozzáadása.\n", + "d['aa'] = [1, 2, 3]" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2, 3]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d['aa']" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hivatkozás nem létező kulcsra.\n", + "# Nem fog hibát adni, hanem az alapértelmezett értéket rendeli a kulcshoz.\n", + "# Az alapértelmezett érték a list() függvényhívással jön létre.\n", + "d['bb']" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "defaultdict(list, {'aa': [1, 2, 3], 'bb': []})" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "# Hivatkozás nem létező kulcsra, majd egy elem hozzáfűzése.\n", + "d['cc'].append(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "defaultdict(list, {'aa': [1, 2, 3], 'bb': [], 'cc': [10]})" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'aa': [1, 2, 3], 'bb': [], 'cc': [10]}" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hagyományos szótárrá konvertálás.\n", + "d2 = dict(d)\n", + "d2" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "defaultdict(, {'asdf': {10, 20, 30}})" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Defaultdict egyedi default értékkel.\n", + "def moricka():\n", + " return {10, 20}\n", + "\n", + "d3 = collections.defaultdict(moricka)\n", + "d3['asdf'].add(30)\n", + "d3" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "defaultdict(()>, {'asdf': {10, 20, 30}})" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d3 = collections.defaultdict(lambda: {10, 20})\n", + "d3['asdf'].add(30)\n", + "d3" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "# Nevesített elemekkel rendelkező tuple (namedtuple).\n", + "Game = collections.namedtuple('Game', ['round', 'hteam', 'ateam', 'hgoals', 'agoals'])" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Game(round=10, hteam='Liverpool', ateam='Arsenal', hgoals=1, agoals=2)" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tuple stílusú használat.\n", + "g = Game(10, 'Liverpool', 'Arsenal', 1, 2)\n", + "g" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Liverpool'" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Struktúra stílusú használat.\n", + "g.hteam" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{Game(round=10, hteam='Liverpool', ateam='Arsenal', hgoals=1, agoals=2): 'alma'}" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A namedtuple típus használható szótárkulcsként.\n", + "{g: 'alma'}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [copy](https://docs.python.org/3/library/copy.html)\n", + "- Sekély (shallow) és mély (deep) másoló függvényt tartalmaz." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "import copy" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[100, 20, 30]" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Pythonban az értékadás NEM végez másolást, csak hivatkozást hoz létre.\n", + "a = [10, 20, 30]\n", + "b = a # <= NEM készül másolat!\n", + "b[0] = 100\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[10, 20, 30]\n", + "[100, 20, 30]\n" + ] + } + ], + "source": [ + "# Sekély másolat készítése.\n", + "a = [10, 20, 30]\n", + "b = copy.copy(a) # sekély másolat készítése\n", + "b[0] = 100\n", + "print(a)\n", + "print(b)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[100], [20], [30]]\n", + "[[100], [20], [30]]\n" + ] + } + ], + "source": [ + "# Sekély másolat készítése egy listák listája objektumról.\n", + "a = [[10], [20], [30]]\n", + "b = copy.copy(a) # sekély másolat készítése\n", + "b[0][0] = 100\n", + "print(a)\n", + "print(b)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A copy.copy() csak az adatszerkezet legfelső szintjén végez másolást!" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[10], [20], [30]]\n", + "[[100], [20], [30]]\n" + ] + } + ], + "source": [ + "# Mély másolat készítése egy listák listája objektumról.\n", + "a = [[10], [20], [30]]\n", + "b = copy.deepcopy(a) # mély másolat készítése\n", + "b[0][0] = 100\n", + "print(a)\n", + "print(b)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [glob](https://docs.python.org/3/library/glob.html)\n", + "- Tartalmaz egy függvényt adott mintára illeszkedő fájlnevek összegyűjtésére." + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "import glob" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['celsius_fahrenheit.txt',\n", + " 'example_file.txt',\n", + " 'example_file_2.txt',\n", + " 'hamlet.txt',\n", + " 'hotels.txt',\n", + " 'igazi.txt',\n", + " 'investments.txt',\n", + " 'matrix.txt',\n", + " 'openair.txt',\n", + " 'pl.txt',\n", + " 'unicef.txt']" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# .txt kiterjeszésű fájlok az aktuális könyvtárban.\n", + "glob.glob('*.txt')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [gzip](https://docs.python.org/3/library/gzip.html)\n", + "\n", + "- GZIP formátumú tömörített fájlok olvasására és írására biztosít eszközöket.\n", + "- Megjegyzés: Egyéb tömörített formátumokat is támogat a standard könyvtár (pl. BZ2, LZMA, ZIP, TAR)." + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [], + "source": [ + "import gzip" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "200" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# GZIP formátumú fájl elkészítése.\n", + "text = 'Móricka Pythonozik. ' * 10\n", + "gzip.open('moricka.gz', 'wt').write(text)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. Móricka Pythonozik. '" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# GZIP formátumú fájl beolvasása.\n", + "gzip.open('moricka.gz', 'rt').read()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [os](https://docs.python.org/3/library/os.html)\n", + "\n", + "- Az operációs rendszer bizonyos szolgáltatásaihoz nyújt elérést." + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [], + "source": [ + "import os" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Létezik-e hamlet.txt nevű fájl az aktuális könyvtárban?\n", + "os.path.exists('hamlet.txt')" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/tmp/xyz'" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Könyvtárnév kinyerése egy elérési útvonalból.\n", + "os.path.dirname('/tmp/xyz/hamlet.txt')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [pickle](https://docs.python.org/3/library/pickle.html)\n", + "\n", + "- Python adatszerkezetek szerializálására (azaz bájtsorozattá alakítására) és deszerializálására nyújt egy megoldást.\n", + "- A \"pickle\" szó jelentése főnévként \"ecetes lé\", \"pác\", igeként \"savanyítás\" :-)." + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "import pickle" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "# Összetett objektum szerializálása fájlba.\n", + "data = [10, 20, {'abc', 'de'}]\n", + "pickle.dump(data, open('data.pkl', 'wb'))" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, {'abc', 'de'}]" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Deszerializálás.\n", + "data2 = pickle.load(open('data.pkl', 'rb'))\n", + "data2" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "b'\\x80\\x04\\x95\\x18\\x00\\x00\\x00\\x00\\x00\\x00\\x00]\\x94(K\\nK\\x14\\x8f\\x94(\\x8c\\x02de\\x94\\x8c\\x03abc\\x94\\x90e.'" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Szerializálás bájtsorozatba.\n", + "data = [10, 20, {'abc', 'de'}]\n", + "b = pickle.dumps(data)\n", + "b" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, {'abc', 'de'}]" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Deszerializálás.\n", + "pickle.loads(b)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [], + "source": [ + "# Két hasznos segédfüggvény.\n", + "\n", + "def to_pickle(obj, fname, protocol=4):\n", + " '''Serialize object to file.'''\n", + " pickle.dump(obj, open(fname, 'wb'), protocol)\n", + " \n", + "def from_pickle(fname):\n", + " '''Deserialize object from file.'''\n", + " return pickle.load(open(fname, 'rb'))" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [], + "source": [ + "to_pickle(data, 'data.pkl')" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[10, 20, {'abc', 'de'}]" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from_pickle('data.pkl')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/10_gyak.ipynb b/10_gyak.ipynb new file mode 100644 index 0000000..67302fc --- /dev/null +++ b/10_gyak.ipynb @@ -0,0 +1,115 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 10. heti előadás anyagát tartalmazó Jupyter notebook (10_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. feladat\n", + "\n", + "Hány olyan kétjegyű természetes szám van, amely osztható a számjegyei összegével?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. feladat\n", + "\n", + "Az $a$, $b$ és $c$ pozitív egész számok pitagoraszi számhármast alkotnak, ha $a^2 + b^2 = c^2$. Például a $(3, 4, 5)$ számhármas pitagoraszi, mivel $3^2 + 4^2 = 5^2$.\n", + "\n", + "- Hány olyan pitagoraszi számhármas létezik, melyre $c \\leq 500$? Az $(a, b, c)$ és a $(b, a, c)$ hármast ne tekintsük különbözőnek!\n", + "- Az előbbi számhármasok között hány primitív van, azaz hány olyan van, melyre $a$ és $b$ relatív prímek?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3. feladat\n", + "Készítsünk programot, amely:\n", + "- Egy 1 és 99 közötti arab számot római számmá alakít!\n", + "- Egy I és XCIX közötti római számot arab számmá alakít!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Bővítsük az előző feladatot úgy, hogy a használható egész számok intervalluma az [1, 99] helyett az [1, 3000] (ill. [I, MMM]) lehessen!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4. feladat\n", + "\n", + "Készítsünk programot, amely a [Conway-féle életjátékot](https://hu.wikipedia.org/wiki/%C3%89letj%C3%A1t%C3%A9k) valósítja meg!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/10_gyak_mego.ipynb b/10_gyak_mego.ipynb new file mode 100644 index 0000000..2e206a7 --- /dev/null +++ b/10_gyak_mego.ipynb @@ -0,0 +1,509 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. feladat\n", + "\n", + "Hány olyan kétjegyű természetes szám van, amely osztható a számjegyei összegével?" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "23\n" + ] + } + ], + "source": [ + "# 1. megoldás\n", + "n = 0\n", + "for i in range(10, 100): # végigmegyünk a kétjegyű számokon\n", + " s = sum([int(d) for d in str(i)]) # számjegyek összege\n", + " if i % s == 0:\n", + " n += 1\n", + "print(n)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "23\n" + ] + } + ], + "source": [ + "# 2. megoldás\n", + "n = 0\n", + "for t in range(1, 10): # tízesek\n", + " for e in range(10): # egyesek\n", + " if (t * 10 + e) % (t + e) == 0:\n", + " n += 1\n", + "print(n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. feladat\n", + "\n", + "Az $a$, $b$ és $c$ pozitív egész számok pitagoraszi számhármast alkotnak, ha $a^2 + b^2 = c^2$. Például a $(3, 4, 5)$ számhármas pitagoraszi, mivel $3^2 + 4^2 = 5^2$.\n", + "\n", + "- Hány olyan pitagoraszi számhármas létezik, melyre $c \\leq 500$? Az $(a, b, c)$ és a $(b, a, c)$ hármast ne tekintsük különbözőnek!" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# 1. megoldás\n", + "triplets = set()\n", + "for c in range(1, 501):\n", + " for a in range(1, c):\n", + " for b in range(a, c):\n", + " if b**2 + a**2 == c**2:\n", + " triplets.add((a, b, c))" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "386" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(triplets)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "# 2. megoldás\n", + "triplets = set()\n", + "for c in range(1, 501):\n", + " for a in range(1, c):\n", + " b = int((c**2 - a**2)**0.5 + 0.5)\n", + " if b >= a and a**2 + b**2 == c**2:\n", + " triplets.add((a, b, c))" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "386" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(triplets)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzés: Az előző megoldásokban a hármasokat egy listába tettük (az esetleges ellenőrzés végett, noha nem írtuk ki őket), a darabszám meghatározása (ami a feladat volt) enélkül is elvégezhető lett volna (pl. egy darabszámot adminisztráló változó használatával)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Az előbbi számhármasok között hány primitív van, azaz hány olyan van, melyre $a$ és $b$ relatív prímek?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3. feladat\n", + "Készítsünk programot, amely egy 1 és 99 közötti arab számot római számmá alakít!" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'XXIII'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# 1. megoldás\n", + "a = 23\n", + "r_ones = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX']\n", + "r_tens = ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC']\n", + "r = r_tens[a // 10] + r_ones[a % 10]\n", + "r" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# 2. megoldás: függvénybe csomagolva\n", + "def arabic_to_roman(a):\n", + " r_ones = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX']\n", + " r_tens = ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC']\n", + " return r_tens[a // 10] + r_ones[a % 10]" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'XLVII'" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "arabic_to_roman(47)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Készítsünk programot, amely egy I és XCIX közötti római számot arab számmá alakít!" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# Konverziós szótár\n", + "roman_to_arabic = {arabic_to_roman(a): a for a in range(1, 100)}" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "64" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "roman_to_arabic['LXIV']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4. feladat\n", + "\n", + "Készítsünk programot, amely a [Conway-féle életjátékot](https://hu.wikipedia.org/wiki/%C3%89letj%C3%A1t%C3%A9k) valósítja meg!" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Adjuk meg a kezdőállapotot egy sztringben!\n", + "# (Lehetne fájlból is beolvasni, de az egyszerűség kedvéért használjunk most sztringet!)\n", + "\n", + "worldstr = '''\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........oo.........\n", + "........oo..........\n", + ".........o..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "'''.strip()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# kezdőállapot beolvasása listák listájába\n", + "world = [list(row) for row in worldstr.split('\\n')]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def display_world(world):\n", + " for row in world:\n", + " print(''.join(row))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Szabályok:\n", + "- A sejt túléli a kört, ha két vagy három szomszédja van.\n", + "- A sejt elpusztul, ha kettőnél kevesebb (elszigetelődés), vagy háromnál több (túlnépesedés) szomszédja van.\n", + "- Új sejt születik minden olyan cellában, melynek környezetében pontosan három sejt található.\n", + "- Az átlós szomszédság is számít." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "import copy\n", + "\n", + "def count_neighbors(world, i, j):\n", + " nb = 0 # szomszédok száma\n", + " for di in [-1, 0, 1]: # végigmegyünk a szomszédos sorokon\n", + " for dj in [-1, 0, 1]: # végigmegyünk a szomszédos oszlopokon\n", + " if di == 0 and dj == 0: # önmagát ne számítsuk szomszédként\n", + " continue\n", + " if j + dj < 0 or i + di < 0: # negatív indext ne használjunk\n", + " continue\n", + " try:\n", + " if world[i + di][j + dj] == 'o': # ha találtunk szomszédot\n", + " nb += 1\n", + " except IndexError:\n", + " pass\n", + " return nb\n", + "\n", + "def update_world(world):\n", + " nrows = len(world)\n", + " ncols = len(world[0])\n", + " new_world = copy.deepcopy(world) # másolat készítése\n", + " for i in range(nrows):\n", + " for j in range(ncols):\n", + " nb = count_neighbors(world, i, j)\n", + " if nb < 2 or nb > 3: # elpusztul a sejt\n", + " new_world[i][j] = '.'\n", + " elif nb == 3: # új sejt születik\n", + " new_world[i][j] = 'o'\n", + " return new_world" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........oo.........\n", + "........oo..........\n", + ".........o..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "........ooo.........\n", + "........o...........\n", + "........oo..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........o..........\n", + "........oo..........\n", + ".......o..o.........\n", + "........oo..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "Interrupted by user", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mdisplay_world\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mworld\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mworld\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mupdate_world\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mworld\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0minput\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32mC:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel\\kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[1;34m(self, prompt)\u001b[0m\n\u001b[0;32m 858\u001b[0m \u001b[1;34m\"raw_input was called, but this frontend does not support input requests.\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 859\u001b[0m )\n\u001b[1;32m--> 860\u001b[1;33m return self._input_request(str(prompt),\n\u001b[0m\u001b[0;32m 861\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 862\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32mC:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel\\kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[1;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[0;32m 902\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 903\u001b[0m \u001b[1;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 904\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Interrupted by user\"\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 905\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 906\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Invalid Message:\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mKeyboardInterrupt\u001b[0m: Interrupted by user" + ] + } + ], + "source": [ + "while True:\n", + " display_world(world)\n", + " world = update_world(world)\n", + " input()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4. feladat - egyebek\n", + "- Teszteljük a játékot más kiinduló állapottal!\n", + "- Módosítsuk úgy a játékot, hogy:\n", + " - a játék addig folytatódjon, amíg a felhasználó a 'q' betűt meg nem adja (azaz minden más input esetén folytassuk, de a 'q' inputra fejezzük be a futást)\n", + " - a 'világ' más méretű legyen (pl. 10x10-es)\n", + " - érvényesítsünk más szabály(oka)t (pl. más feltételek mellett szülessen új sejt, vagy pusztuljon el egy élő sejt)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/11_ea.ipynb b/11_ea.ipynb new file mode 100644 index 0000000..d0f782d --- /dev/null +++ b/11_ea.ipynb @@ -0,0 +1,872 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [Objektumorientált programozás](https://docs.python.org/3/tutorial/classes.html), nulladik közelítésben\n", + "\n", + "Az objektumorientált programozás(OOP) olyan programozási módszertan, ahol az egymással kapcsolatban álló programegységek hierarchiájának megtervezése áll a középpontban.\n", + "- A korábban uralkodó procedurális megközelítés a műveletek megalkotására fókuszált.\n", + "- OOP esetén adatokat és az őket kezelő függvényeket egységbezárjuk (encapsulation).\n", + "- Az OOP másik fontos sajátossága az öröklődés (inheritance)." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 20\n" + ] + } + ], + "source": [ + "# Példa: téglalap osztály.\n", + "\n", + "class Rectangle:\n", + " def __init__(self, a, b): # konstruktor\n", + " self.a = a\n", + " self.b = b\n", + " \n", + " def calc_area(self): # területszámító metódus definiálása\n", + " return self.a * self.b\n", + "\n", + " def calc_perimeter(self): # kerületszámító metódus definiálása\n", + " return (self.a + self.b) * 2\n", + " \n", + "r1 = Rectangle(10, 20) # téglalap objektum létrehozása\n", + "print(r1.a, r1.b)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "200" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r1.calc_area() # metódus meghívása" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "200" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A Python a metódushívást a színfalak mögött függvényhívássá alakítja át.\n", + "Rectangle.calc_area(r1)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...ez a beépített típusokra is igaz.\n", + "(1).__add__(1)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int.__add__(1, 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "314.1592653589793\n", + "125.66370614359172\n" + ] + } + ], + "source": [ + "# Példa: kör osztály.\n", + "\n", + "import math\n", + "\n", + "class Circle:\n", + " def __init__(self, r): # konstruktor\n", + " self.r = r\n", + " \n", + " def calc_area(self): # területszámító metódus definiálása\n", + " return self.r**2 * math.pi\n", + "\n", + " def calc_perimeter(self): # kerületszámító metódus definiálása\n", + " return 2 * self.r * math.pi\n", + " \n", + "c1 = Circle(10)\n", + "c2 = Circle(20)\n", + "print(c1.calc_area())\n", + "print(c2.calc_perimeter())" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# A kerület-terület arány kiszámítása téglalapok és körök esetén ugyanúgy történik.\n", + "# Hozzunk létre egy egy síkidom ősosztályt, származtassuk ebből a téglalapot és a kört!\n", + "# A kerület-terület arány számítást az ősosztályba tegyük!\n", + "\n", + "class Shape:\n", + " def calc_pa_ratio(self):\n", + " return self.calc_perimeter() / self.calc_area()\n", + "\n", + "class Rectangle(Shape): # a téglalap a síkidomból származik\n", + " def __init__(self, a, b): # konstruktor\n", + " self.a = a\n", + " self.b = b\n", + " \n", + " def calc_area(self): # területszámító metódus definiálása\n", + " return self.a * self.b\n", + "\n", + " def calc_perimeter(self): # kerületszámító metódus definiálása\n", + " return (self.a + self.b) * 2\n", + "\n", + "class Circle(Shape): # a kör a síkidomból származik\n", + " def __init__(self, r): # konstruktor\n", + " self.r = r\n", + " \n", + " def calc_area(self): # területszámító metódus definiálása\n", + " return self.r**2 * math.pi\n", + "\n", + " def calc_perimeter(self): # kerületszámító metódus definiálása\n", + " return 2 * self.r * math.pi" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.6\n", + "1.6666666666666667\n", + "0.19999999999999998\n" + ] + } + ], + "source": [ + "shapes = [Rectangle(10, 5), Rectangle(2, 3), Circle(10)]\n", + "for s in shapes:\n", + " print(s.calc_pa_ratio())" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "def solve_quadratic(a, b, c):\n", + " '''Solve quadratic equation a*x^2 + b*x + c = 0,\n", + " and return solutions in a list.'''\n", + " \n", + " # diszkrimináns kiszámítása\n", + " d = b**2 - 4 * a * c\n", + "\n", + " # elágazás\n", + " if d > 0: # 2 megoldás\n", + " x1 = (-b + d**0.5) / (2 * a)\n", + " x2 = (-b - d**0.5) / (2 * a)\n", + " return [x1, x2]\n", + " elif d == 0: # 1 megoldás\n", + " return [-b / (2 * a)]\n", + " else:\n", + " return []" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# Feladat: Készítsünk másodfokú egyenlet megoldó osztályt!\n", + "class QuadraticEquation:\n", + " def __init__(self, a, b, c):\n", + " self.a = a\n", + " self.b = b\n", + " self.c = c\n", + "\n", + " def _calc_d(self):\n", + " return self.b**2 - 4 * self.a * self.c\n", + " \n", + " def nsolutions(self):\n", + " d = self._calc_d()\n", + " if d > 0: return 2\n", + " elif d == 0: return 1\n", + " else: return 0\n", + " \n", + " def solve(self):\n", + " '''Solve quadratic equation a*x^2 + b*x + c = 0,\n", + " and return solutions in a list.'''\n", + " \n", + " a, b, c = self.a, self.b, self.c\n", + "\n", + " # diszkrimináns kiszámítása\n", + " d = self._calc_d()\n", + "\n", + " # elágazás\n", + " if d > 0: # 2 megoldás\n", + " x1 = (-b + d**0.5) / (2 * a)\n", + " x2 = (-b - d**0.5) / (2 * a)\n", + " return [x1, x2]\n", + " elif d == 0: # 1 megoldás\n", + " return [-b / (2 * a)]\n", + " else:\n", + " return []" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[-1.0, -2.0]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "QuadraticEquation(1, 3, 2).solve()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[-1.0]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "QuadraticEquation(1, 2, 1).solve()" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "QuadraticEquation(1, 1, 3).solve()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "[-1.0, -2.0]\n" + ] + } + ], + "source": [ + "eq = QuadraticEquation(1, 3, 2)\n", + "print(eq.nsolutions())\n", + "print(eq.solve())" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "# Feladat: \"Éhes kutyák\".\n", + "\n", + "class Dog:\n", + " def __init__(self, name, is_hungry=False):\n", + " self.name = name\n", + " self.is_hungry = is_hungry\n", + "\n", + " def eat(self):\n", + " self.is_hungry = False\n", + " \n", + "dogs = [\n", + " Dog('Borzas', True),\n", + " Dog('Vadász', False),\n", + " Dog('Nokedli'),\n", + " Dog('Cézár', True),\n", + " Dog('Csibész', True)\n", + "]" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Borzas\n", + "Cézár\n", + "Csibész\n" + ] + } + ], + "source": [ + "# Nézzük meg, hogy kik éhesek!\n", + "for d in dogs:\n", + " if d.is_hungry:\n", + " print(d.name)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "# Etessük meg az összes éhes kutyát!\n", + "for d in dogs:\n", + " if d.is_hungry:\n", + " d.eat()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Borzas False\n", + "Vadász False\n", + "Nokedli False\n", + "Cézár False\n", + "Csibész False\n" + ] + } + ], + "source": [ + "# Nézzük meg, hogy mi az etetés eredmény!\n", + "for d in dogs:\n", + " print(d.name, d.is_hungry)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "# Éhezzenek meg a kutyák!\n", + "for d in dogs:\n", + " d.is_hungry = True" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Borzas\n", + "Vadász\n", + "Nokedli\n", + "Cézár\n", + "Csibész\n" + ] + } + ], + "source": [ + "# Újra nézzük meg, hogy kik éhesek!\n", + "for d in dogs:\n", + " if d.is_hungry:\n", + " print(d.name)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Borzas\n", + "Cézár\n", + "Csibész\n" + ] + } + ], + "source": [ + "# Oldjuk meg az \"éhes kutyák\" feladatot osztályok használata nélkül!\n", + "dogs = [\n", + " {'name': 'Borzas', 'is_hungry': True},\n", + " {'name': 'Vadász', 'is_hungry': False},\n", + " {'name': 'Nokedli', 'is_hungry': False},\n", + " {'name': 'Cézár', 'is_hungry': True},\n", + " {'name': 'Csibész', 'is_hungry': True}\n", + "]\n", + "\n", + "for d in dogs:\n", + " if d['is_hungry']:\n", + " print(d['name'])\n", + " \n", + "# ..." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Speciális (\"dunder\") [attribútumok](https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy) és [metódusok](https://docs.python.org/3/reference/datamodel.html#special-method-names)\n", + "\n", + "- `__doc__`, `__class__`, `__init__()`, `__hash__()`, `__code__`, ...\n", + "- attribútumtárolásra: `__dict__`, `__dir__()`\n", + "- kiírásra: `__repr__()`, `__str__()`\n", + "- műveletvégzésre: `__add__()`, `__mul__()`, ...\n", + "- indexelésre: `__getitem__()`, `__setitem__()`, `__len__()`\n", + "- iterálásra: `__iter__()`, `__next__()`\n", + "- kontextuskezelésre: `__enter__()`, `__exit__()`\n", + "- ..." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "# Példa: __repr__ metódussal rendelkező osztály.\n", + "class Student:\n", + " def __init__(self, name, neptun):\n", + " self.name = name\n", + " self.neptun = neptun\n", + " \n", + " def __repr__(self):\n", + " return f\"Student('{self.name}', '{self.neptun}')\"" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Student('Gipsz Jakab', 'ABC123')" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Student('Gipsz Jakab', 'ABC123')" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[10, 20, 30]\n" + ] + } + ], + "source": [ + "# A __repr__ metódus a beépített osztályokra is meg van valósítva.\n", + "l = [10, 20, 30]\n", + "print(l.__repr__())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Gyakorlás\n", + "\n", + "Készítsünk vektor osztályt, amely támogatja a vektorok közötti elemenkénti alapműveleteket (+, -, *, /), a vektor elemszámának lekérdezését, a haladó indexelést valamint a vektor sztringgé alakítását! Elvárt működés:\n", + "```\n", + "v1 = Vector([1.0, 2.0, 3.0])\n", + "v2 = Vector([4.0, 5.0, 6.0])\n", + "print(len(v1), v1[0], v1[:2]) # => 3 1.0 [1.0, 2.0]\n", + "print(v1 + v2) # => Vector([5.0, 7.0, 9.0])\n", + "print(v1 * v2) # => Vector([4.0, 10.0, 18.0]\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "class Vector:\n", + " def __init__(self, data):\n", + " self.data = data\n", + " \n", + " def __repr__(self):\n", + " return f'Vector({str(self.data)})'\n", + " \n", + " def __add__(self, other):\n", + " return Vector([x + y for x, y in zip(self.data, other.data)])\n", + "\n", + " def __sub__(self, other):\n", + " return Vector([x - y for x, y in zip(self.data, other.data)])\n", + "\n", + " def __mul__(self, other):\n", + " return Vector([x * y for x, y in zip(self.data, other.data)])\n", + "\n", + " def __truediv__(self, other):\n", + " return Vector([x / y for x, y in zip(self.data, other.data)])\n", + " \n", + " def __len__(self):\n", + " return len(self.data)\n", + " \n", + " def __getitem__(self, idx):\n", + " return self.data[idx]" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "# 2 vektor létrehozása\n", + "v1 = Vector([1.0, 2.0, 3.0])\n", + "v2 = Vector([4.0, 5.0, 6.0])" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Vector([1.0, 2.0, 3.0])" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v1" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Vector([5.0, 7.0, 9.0])" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# műveletek\n", + "v1 + v2" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Vector([-3.0, -3.0, -3.0])" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v1 - v2" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Vector([4.0, 10.0, 18.0])" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v1 * v2" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Vector([0.25, 0.4, 0.5])" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v1 / v2" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# elemszám lekérdezés\n", + "len(v1)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.0" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# indexelés\n", + "v1[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1.0, 2.0]" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# haladó indexelés\n", + "v1[:2]" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Vector([5.0, 7.0, 9.0])" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A műveletek a háttérben egyszerű függvényhívássá alakulnak át.\n", + "v1 + v2" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Vector([5.0, 7.0, 9.0])" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Vector.__add__(v1, v2)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/11_gyak.ipynb b/11_gyak.ipynb new file mode 100644 index 0000000..bb7d27e --- /dev/null +++ b/11_gyak.ipynb @@ -0,0 +1,174 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 11. heti előadás anyagát tartalmazó Jupyter notebook (11_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. Feladat\n", + "- A Jupyter notebook súgójával (help) derítsük ki azt, hogy milyen műveletei (dunder metódusai) vannak a bool osztálynak! Melyik ősétől mit örökölt?\n", + "- Próbáljuk ki néhány (pl. az előadás anyagában megemlített) dunder attribútum, ill. metódus használatát!\n", + "- Egészítsük ki az előadás anyagában szereplő Dog osztályt egy megfelelő `__repr__` metódussal és teszteljük ennek működését!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. feladat\n", + "\n", + "Készítsük el a [Conway-féle életjáték](https://hu.wikipedia.org/wiki/%C3%89letj%C3%A1t%C3%A9k) objektumorientált változatát!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "worldstr = '''\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........oo.........\n", + "........oo..........\n", + ".........o..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "'''.strip()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# kezdőállapot beolvasása listák listájába\n", + "world = [list(row) for row in worldstr.split('\\n')]\n", + "\n", + "def display_world(world):\n", + " for row in world:\n", + " print(''.join(row))\n", + " \n", + "def count_neighbors(world, i, j):\n", + " nb = 0 # szomszédok szám\n", + " for di in [-1, 0, 1]: # végigmegyünk a szomszédos sorokon\n", + " for dj in [-1, 0, 1]: # végigmegyünk a szomszédos oszlopokon\n", + " if di == 0 and dj == 0: # önmagát ne számítsuk szomszédként\n", + " continue\n", + " if j + dj < 0 or i + di < 0: # negatív indext ne használjunk\n", + " continue\n", + " \n", + " try:\n", + " if world[i + di][j + dj] == 'o': # ha találtunk szomszédot\n", + " nb += 1\n", + " except IndexError:\n", + " pass\n", + " return nb\n", + "\n", + "import copy\n", + "\n", + "def update_world(world):\n", + " nrows = len(world)\n", + " ncols = len(world[0])\n", + " new_world = copy.deepcopy(world) # másolat készítése\n", + " for i in range(nrows):\n", + " for j in range(ncols):\n", + " nb = count_neighbors(world, i, j)\n", + " if nb < 2 or nb > 3: # elpusztul a sejt\n", + " new_world[i][j] = '.'\n", + " elif nb == 3: # új sejt születik\n", + " new_world[i][j] = 'o'\n", + " return new_world\n", + "\n", + "while True:\n", + " display_world(world)\n", + " world = update_world(world)\n", + " input()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3. Feladat\n", + "- Definiáljunk egy osztályt (pl. Allat néven) az alábbiak szerint!\n", + " - Az osztályhoz tartozó objektumok rendelkezzenek névvel és egy vagy több táplálékkal! Az objektumok adatai (pl. 'medve', {'méz', 'málna'}) létrehozáskor (azaz a konstruktor meghívásakor) legyenek megadhatók!\n", + " - Definiáljuk az osztály `__repr__` metódusát!\n", + " - Legyen az osztálynak egy olyan metódusa, amellyel bővíteni lehessen egy adott objektum táplálékait!\n", + " - Teszteljük az osztályt, azaz hozzunk létre egy ehhez az osztályhoz tartozó objektumot, majd használjuk (pl. írjuk ki a képernyőre, hívjuk meg valamelyik metódusát, stb.)!\n", + "- Nehezítsük a feladatot úgy, hogy definiálunk egy másik osztályt is (pl. Kedvenc néven) az alábbiak szerint!\n", + " - Az új osztály az előzőleg elkészített osztályból származzon! \n", + " - Az osztály példányai rendelkezzenek egy becenévvel és egy vagy több tevékenységgel is (azon felül, amelyekkel, mint Allat objektumok rendelkeznek)!\n", + " - Az osztályhoz tartozó objektumok adatai (pl. 'medve', {'méz', 'málna'}, 'Brumi', {'mézet lejmol', 'brummog', 'téli álmot alszik'}) itt is példányosításkor legyenek megadhatók!\n", + " - A konstruktor (`__init__`) a szülő osztály konstruktorát használja az örökölt adatok értékeinek beállítására (lásd a `super` függvényt a súgóban)!\n", + " - Definiáljuk az osztály `__repr__` metódusát!\n", + " - Legyen az osztálynak egy olyan metódusa (pl. mit_csinal néven), amelyik egy véletlenszerűen kiválasztott tevékenységet ad eredményül!\n", + " - Teszteljük az osztályt, azaz hozzunk létre egy ehhez az osztályhoz tartozó objektumot, majd használjuk (pl. írjuk ki a képernyőre, hívjuk meg valamelyik metódusát, stb.)!\n", + "- Teszteljük együtt a két osztályt úgy, hogy hozzunk létre objektumokat (Allat és Kedvenc osztályhoz tartozókat is, pl. egy listában), majd használjuk ezeket az objektumokat (pl. Kedvenc típusú objektum esetén írjuk ki a képernyőre a becenevét és a `mit_csinal` függvény egy hívásának eredményét, egyébként meg, Allat típusú objektum esetén, a nevét és a táplálékát/táplálékait)! Egy adott objektum egy adott osztályhoz való 'tartozásának' eldöntésére használjuk a `isinstance` függvényt (lásd súgó)! \n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/11_gyak_2_feladat_mego.ipynb b/11_gyak_2_feladat_mego.ipynb new file mode 100644 index 0000000..6650946 --- /dev/null +++ b/11_gyak_2_feladat_mego.ipynb @@ -0,0 +1,309 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. feladat\n", + "\n", + "Készítsük el a [Conway-féle életjáték](https://hu.wikipedia.org/wiki/%C3%89letj%C3%A1t%C3%A9k) objektumorientált változatát!" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "worldstr = '''\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........oo.........\n", + "........oo..........\n", + ".........o..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "'''.strip()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........oo.........\n", + "........oo..........\n", + ".........o..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "........ooo.........\n", + "........o...........\n", + "........oo..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "Interrupted by user", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 40\u001b[0m \u001b[0mdisplay_world\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mworld\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 41\u001b[0m \u001b[0mworld\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mupdate_world\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mworld\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 42\u001b[1;33m \u001b[0minput\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32mC:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel\\kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[1;34m(self, prompt)\u001b[0m\n\u001b[0;32m 858\u001b[0m \u001b[1;34m\"raw_input was called, but this frontend does not support input requests.\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 859\u001b[0m )\n\u001b[1;32m--> 860\u001b[1;33m return self._input_request(str(prompt),\n\u001b[0m\u001b[0;32m 861\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 862\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32mC:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel\\kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[1;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[0;32m 902\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 903\u001b[0m \u001b[1;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 904\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Interrupted by user\"\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 905\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 906\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Invalid Message:\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mKeyboardInterrupt\u001b[0m: Interrupted by user" + ] + } + ], + "source": [ + "# kezdőállapot beolvasása listák listájába\n", + "world = [list(row) for row in worldstr.split('\\n')]\n", + "\n", + "def display_world(world):\n", + " for row in world:\n", + " print(''.join(row))\n", + " \n", + "def count_neighbors(world, i, j):\n", + " nb = 0 # szomszédok szám\n", + " for di in [-1, 0, 1]: # végigmegyünk a szomszédos sorokon\n", + " for dj in [-1, 0, 1]: # végigmegyünk a szomszédos oszlopokon\n", + " if di == 0 and dj == 0: # önmagát ne számítsuk szomszédként\n", + " continue\n", + " if j + dj < 0 or i + di < 0: # negatív indext ne használjunk\n", + " continue\n", + " \n", + " try:\n", + " if world[i + di][j + dj] == 'o': # ha találtunk szomszédot\n", + " nb += 1\n", + " except IndexError:\n", + " pass\n", + " return nb\n", + "\n", + "import copy\n", + "\n", + "def update_world(world):\n", + " nrows = len(world)\n", + " ncols = len(world[0])\n", + " new_world = copy.deepcopy(world) # másolat készítése\n", + " for i in range(nrows):\n", + " for j in range(ncols):\n", + " nb = count_neighbors(world, i, j)\n", + " if nb < 2 or nb > 3: # elpusztul a sejt\n", + " new_world[i][j] = '.'\n", + " elif nb == 3: # új sejt születik\n", + " new_world[i][j] = 'o'\n", + " return new_world\n", + "\n", + "while True:\n", + " display_world(world)\n", + " world = update_world(world)\n", + " input()" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "import copy\n", + "\n", + "class Game:\n", + " def __init__(self, worldstr):\n", + " # kezdőállapot beolvasása listák listájába\n", + " self.world = [list(row) for row in worldstr.split('\\n')]\n", + " \n", + " def run(self, nsteps=None):\n", + " step = 0\n", + " while nsteps == None or step < nsteps:\n", + " self.display_world() # megjelenítés\n", + " self.world = self.update_world() # léptetés\n", + " input() # enter bekérése\n", + " step += 1\n", + " \n", + " def update_world(self):\n", + " nrows = len(self.world)\n", + " ncols = len(self.world[0])\n", + " new_world = copy.deepcopy(self.world) # másolat készítése\n", + " for i in range(nrows):\n", + " for j in range(ncols):\n", + " nb = self.count_neighbors(i, j)\n", + " if nb < 2 or nb > 3: # elpusztul a sejt\n", + " new_world[i][j] = '.'\n", + " elif nb == 3: # új sejt születik\n", + " new_world[i][j] = 'o'\n", + " return new_world\n", + " \n", + " def display_world(self):\n", + " for row in self.world:\n", + " print(''.join(row))\n", + " \n", + " def count_neighbors(self, i, j):\n", + " nb = 0 # szomszédok száma\n", + " for di in [-1, 0, 1]: # végigmegyünk a szomszédos sorokon\n", + " for dj in [-1, 0, 1]: # végigmegyünk a szomszédos oszlopokon\n", + " if di == 0 and dj == 0: # önmagát ne számítsuk szomszédként\n", + " continue\n", + " if j + dj < 0 or i + di < 0: # negatív indext ne használjunk\n", + " continue\n", + "\n", + " try:\n", + " if self.world[i + di][j + dj] == 'o': # ha találtunk szomszédot\n", + " nb += 1\n", + " except IndexError:\n", + " pass\n", + " return nb" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........oo.........\n", + "........oo..........\n", + ".........o..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "........ooo.........\n", + "........o...........\n", + "........oo..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + ".........o..........\n", + "........oo..........\n", + ".......o..o.........\n", + "........oo..........\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "....................\n", + "\n" + ] + } + ], + "source": [ + "Game(worldstr).run(3)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/12_ea.ipynb b/12_ea.ipynb new file mode 100644 index 0000000..11b8db8 --- /dev/null +++ b/12_ea.ipynb @@ -0,0 +1,1757 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [NumPy](http://www.numpy.org/)\n", + "\n", + "A NumPy egy alacsony szintű matematikai csomag, numerikus számításokhoz.\n", + "\n", + "- Alapvető adatszerkezete az [n dimenziós tömb](https://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html).\n", + "- C nyelven íródott. A szokásos tömbműveletek hatékonyan vannak benne megvalósítva.\n", + "- Többek között tartalmaz lineáris algebrai és véletlenszám generáló almodult.\n", + "- Számos magasabb szintű csomag (pl. scipy, matplotlib, pandas, scikit-learn) épül rá.\n", + "\n", + "A NumPy külső csomag, a telepítésére többféle lehetőség van, például:\n", + "- `pip install numpy --user`\n", + "- `sudo apt-get install python3-numpy`\n", + "- `conda install numpy`" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# A NumPy modul importálása np néven.\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'1.24.3'" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Verzió lekérdezése.\n", + "np.__version__" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Tömbök létrehozása" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# 1 dimenziós, egész számokból álló tömb létrehozása.\n", + "a = np.array([2, 3, 4])" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([2, 3, 4])" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "numpy.ndarray" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A tömb objektum típusa.\n", + "type(a)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hány dimenziós a tömb?\n", + "a.ndim" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(3,)" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A dimenziók mérete.\n", + "a.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dtype('int32')" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az elemek típusának lekérdezése.\n", + "# A NumPy tömbök homogének (kivéve az objektumtömböt).\n", + "a.dtype" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "# 2 dimenziós, lebegőpontos tömb létrehozása.\n", + "b = np.array([[2.0, 3.0, 4.0], [5.5, 6.6, 7.7]])" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[2. , 3. , 4. ],\n", + " [5.5, 6.6, 7.7]])" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "b" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "(2, 3)\n", + "float64\n" + ] + } + ], + "source": [ + "# Dimenziók száma, mérete, az elemek típusa.\n", + "print(b.ndim)\n", + "print(b.shape)\n", + "print(b.dtype)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([3, 4, 5, 6], dtype=uint8)" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az elemek adattípusának beállítása, 1. példa.\n", + "np.array([3, 4, 5, 6], dtype='uint8')" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([3.3, 4.4], dtype=float32)" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az elemek adattípusának beállítása, 2. példa.\n", + "np.array([3.3, 4.4], dtype='float32')" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0., 1., 1., 0., 1., 0., 1., 1., 0., 1.],\n", + " [0., 0., 1., 0., 1., 1., 0., 1., 0., 1.],\n", + " [0., 0., 1., 0., 0., 0., 1., 1., 0., 0.],\n", + " [0., 1., 0., 0., 1., 0., 1., 1., 0., 0.],\n", + " [1., 0., 1., 1., 0., 0., 1., 0., 1., 1.],\n", + " [1., 0., 1., 0., 0., 1., 1., 0., 1., 0.],\n", + " [1., 1., 1., 0., 1., 1., 1., 0., 1., 1.],\n", + " [0., 0., 0., 0., 0., 1., 0., 1., 0., 1.],\n", + " [1., 1., 0., 1., 0., 1., 1., 1., 0., 0.],\n", + " [1., 0., 1., 0., 1., 0., 0., 1., 0., 1.]])" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tömb betöltése szövegfájlból.\n", + "np.genfromtxt('matrix.txt')" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Nullákból álló tömb létrehozása, 1. példa.\n", + "np.zeros(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0, 0],\n", + " [0, 0],\n", + " [0, 0]], dtype=int16)" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Nullákból álló tömb létrehozása, 2. példa.\n", + "np.zeros((3, 2), dtype='int16')" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([1, 1, 1, 1, 1, 1, 1], dtype=uint32)" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egyesekből álló tömb létrehozása, 1. példa.\n", + "np.ones(7, dtype='uint32')" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[[1., 1.],\n", + " [1., 1.]],\n", + "\n", + " [[1., 1.],\n", + " [1., 1.]]])" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egyesekből álló tömb létrehozása, 2. példa.\n", + "np.ones((2, 2, 2))" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1., 0., 0., 0., 0.],\n", + " [0., 1., 0., 0., 0.],\n", + " [0., 0., 1., 0., 0.],\n", + " [0., 0., 0., 1., 0.],\n", + " [0., 0., 0., 0., 1.]])" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egységmátrix létrehozása.\n", + "np.eye(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([0. , 0.4, 0.8, 1.2, 1.6])" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Értéktartomány létrehozása a lépésköz megadásával.\n", + "np.arange(0, 2, 0.4)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([-1. , -0.5, 0. , 0.5, 1. , 1.5, 2. ])" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Értéktartomány létrehozása az elemszám megadásával.\n", + "np.linspace(-1, 2, 7)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([2, 3, 4, 5, 6])" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Vektorok összefűzése.\n", + "a = np.array([2, 3])\n", + "b = np.array([4, 5, 6])\n", + "np.concatenate([a, b])" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[2, 3, 4, 2, 3, 4],\n", + " [5, 6, 7, 5, 6, 7]])" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Mátrixok összefűzése vízszintesen.\n", + "a = np.array([[2, 3, 4],\n", + " [5, 6, 7]])\n", + "np.hstack([a, a])" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[2, 3, 4],\n", + " [5, 6, 7],\n", + " [2, 3, 4],\n", + " [5, 6, 7],\n", + " [2, 3, 4],\n", + " [5, 6, 7]])" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Mátrixok összefűzése függőlegesen.\n", + "np.vstack([a, a, a])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Elemek és résztömbök" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre egy példamátrixot!\n", + "a = np.array([[3, 4, 5],\n", + " [6, 7, 8]])" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elem kiválasztása (az indexelés 0-tól indul).\n", + "a[0, 1] # 0. sor, 1. oszlop" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a[(0, 1)]" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...a háttérben ez történik:\n", + "np.ndarray.__getitem__(a, (0, 1))" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([6, 7, 8])" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Teljes sor kiválasztása.\n", + "a[1, :]" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([6, 7, 8])" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Így is lehetne.\n", + "a[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A kiválasztott sor egy 1 dimenziós tömb.\n", + "a[1].ndim" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([5, 8])" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Oszlop kiválasztása.\n", + "a[:, 2]" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[3, 4],\n", + " [6, 7]])" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Résztömb kiválasztása.\n", + "a[:, :-1]" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[4, 3, 4],\n", + " [7, 6, 7]])" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Adott indexű oszlopok kiválasztása.\n", + "a[:, [1, 0, 1]]" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([4, 6, 8])" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemek kiválasztása logikai feltétel alapján.\n", + "# (Az eredmény 1 dimenziós.)\n", + "a[a % 2 == 0]" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[100, 4, 5],\n", + " [ 6, 7, 8]])" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A tömb elemei módosíthatók.\n", + "a[0, 0] = 100\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[100, 20, 5],\n", + " [ 6, 30, 8]])" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Oszlop módosítása.\n", + "a[:, 1] = [20, 30]\n", + "a" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Tömbműveletek" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "# Hozzunk létre 2 példatömböt!\n", + "a = np.array([[1, 2 ,3],\n", + " [4, 5, 6]])\n", + "b = np.array([[1, 1, 1],\n", + " [2, 2, 2]])" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[2, 3, 4],\n", + " [6, 7, 8]])" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemenkénti összeadás.\n", + "a + b" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0, 1, 2],\n", + " [2, 3, 4]])" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemenkénti kivonás.\n", + "a - b" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 1, 2, 3],\n", + " [ 8, 10, 12]])" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemenkénti szorzás.\n", + "a * b" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1. , 2. , 3. ],\n", + " [2. , 2.5, 3. ]])" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemenkénti osztás.\n", + "a / b" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1, 2, 3],\n", + " [2, 2, 3]])" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemenkénti egészosztás.\n", + "a // b" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 1, 2, 3],\n", + " [16, 25, 36]])" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemenkénti hatványozás.\n", + "a**b" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "operands could not be broadcast together with shapes (3,) (2,) ", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[45], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# A művelet nem feltétlenül végezhető el.\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m np\u001b[38;5;241m.\u001b[39marray([\u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m4\u001b[39m]) \u001b[38;5;241m+\u001b[39m np\u001b[38;5;241m.\u001b[39marray([\u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m6\u001b[39m])\n", + "\u001b[1;31mValueError\u001b[0m: operands could not be broadcast together with shapes (3,) (2,) " + ] + } + ], + "source": [ + "# A művelet nem feltétlenül végezhető el.\n", + "np.array([2, 3, 4]) + np.array([5, 6])" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1, 2, 3],\n", + " [4, 5, 6]])" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Jelenítsük meg újra az \"a\" tömböt!\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 2.71828183, 7.3890561 , 20.08553692],\n", + " [ 54.59815003, 148.4131591 , 403.42879349]])" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elemenkénti függvények (exp, log, sin, cos, ...).\n", + "np.exp(a)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 0.84147098, 0.90929743, 0.14112001],\n", + " [-0.7568025 , -0.95892427, -0.2794155 ]])" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "np.sin(a)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 6 21 3.5 1.707825127659933\n" + ] + } + ], + "source": [ + "# Statisztikai műveletek: min, max, sum, mean (átlag), std (szórás).\n", + "print(a.min(), a.max(), a.sum(), a.mean(), a.std())" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([5, 7, 9])" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Oszloponkénti statisztikák.\n", + "# A 0. dimenzió azaz a sorok mentén aggregálunk, ezért ez a dimenzió fog eltűnni.\n", + "a.sum(axis=0) # oszloponkénti összeg" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([3, 6])" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Soronkénti statisztikák.\n", + "# A 1. dimenzió azaz az oszlopok mentén aggregálunk, ezért ez a dimenzió fog eltűnni.\n", + "a.max(axis=1) # soronkénti maximum" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1., 2., 3.],\n", + " [4., 5., 6.]], dtype=float32)" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Típuskonverzió.\n", + "b = a.astype('float32')\n", + "b" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[1 2 3]\n", + " [4 5 6]]\n", + "[[1 4]\n", + " [2 5]\n", + " [3 6]]\n" + ] + } + ], + "source": [ + "# Transzponálás.\n", + "print(a)\n", + "print(a.T)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 1, 20, 3],\n", + " [ 4, 5, 6]])" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A transzponálás nem végez másolást, csak egy új nézetet hoz létre az eredeti adattartalomra.\n", + "a.T[1, 0] = 20\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hozzunk létre egy 12 elemű példatömböt!\n", + "a = np.arange(12)\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 0, 1, 2, 3, 4, 5],\n", + " [ 6, 7, 8, 9, 10, 11]])" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Átalakítás 2×6-ossá.\n", + "a.reshape((2, 6))" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 0, 1, 2, 3, 4, 5],\n", + " [ 6, 7, 8, 9, 10, 11]])" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Elég csak az egyik dimenzió méretét megadni, a másik helyére írhatunk (-1)-et.\n", + "a.reshape((2, -1))" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 0, 1, 2],\n", + " [ 3, 4, 5],\n", + " [ 6, 7, 8],\n", + " [ 9, 10, 11]])" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Átalakítás 4×3-assá.\n", + "a.reshape((-1, 3))" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "cannot reshape array of size 12 into shape (5,newaxis)", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[49], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Ha olyan méretet adunk meg, ahol az összelemszám nem jöhet ki 12-re, akkor hibaüzenetet kapunk.\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m a\u001b[38;5;241m.\u001b[39mreshape((\u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m))\n", + "\u001b[1;31mValueError\u001b[0m: cannot reshape array of size 12 into shape (5,newaxis)" + ] + } + ], + "source": [ + "# Ha olyan méretet adunk meg, ahol az összelemszám nem jöhet ki 12-re, akkor hibaüzenetet kapunk.\n", + "a.reshape((5, -1))" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[[ 0, 1, 2],\n", + " [ 3, 4, 5]],\n", + "\n", + " [[ 6, 7, 8],\n", + " [ 9, 10, 11]]])" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Átalakítás 2×2×3-assá.\n", + "a.reshape((2, 2, 3))" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([200, 3, 4])" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az értékadás NumPy esetén sem végez másolást.\n", + "a = np.array([2, 3, 4])\n", + "b = a\n", + "b[0] = 200\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([2, 3, 4])" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Másolni a copy metódussal lehet.\n", + "a = np.array([2, 3, 4])\n", + "b = a.copy()\n", + "b[0] = 200\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([0, 3], dtype=int64)" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Keresés.\n", + "# Példa: Mely indexeknél találhatók az 5-nél kisebb elemek?\n", + "a = np.array([3, 10, 11, 4, 7, 8])\n", + "idxs = np.where(a < 5)[0]\n", + "idxs" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([3, 4])" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a[idxs]" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 3, 4, 7, 8, 10, 11])" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Rendezés helyben.\n", + "a = np.array([3, 10, 11, 4, 7, 8])\n", + "a.sort()\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ 3 10 11 4 7 8]\n", + "[ 3 4 7 8 10 11]\n" + ] + } + ], + "source": [ + "# Rendezés új tömbbe.\n", + "a = np.array([3, 10, 11, 4, 7, 8])\n", + "b = np.sort(a)\n", + "print(a)\n", + "print(b)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzés:\n", + "- NumPy tömbök rendezésére ne használjuk a standard sorted függvényt!\n", + "- Ugyanígy, NumPy tömbök esetén ne használjuk a standard math modul függvényeit!" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([11, 10, 8, 7, 4, 3])" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Rendezés csökkenő sorrendbe.\n", + "np.sort(a)[::-1]" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ 3 10 11 4 7 8]\n", + "[0 3 4 5 1 2]\n" + ] + } + ], + "source": [ + "# A rendezett tömb elemei mely indexeknél találhatók az eredeti tömbben?\n", + "idxs = a.argsort()\n", + "print(a)\n", + "print(idxs)" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 3, 4, 7, 8, 10, 11])" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A tömb rendezése az indextömb segítségével.\n", + "a[idxs]" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 60, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Van argmin és argmax függvény is.\n", + "a.argmax()" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "24" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Két vektor skaláris szorzata.\n", + "a = np.array([3, 4, 5])\n", + "b = np.array([2, 2, 2])\n", + "a @ b" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 29, 56],\n", + " [ 56, 110]])" + ] + }, + "execution_count": 62, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Mátrixszorzás.\n", + "A = np.array([[2, 3, 4],\n", + " [5, 6, 7]])\n", + "A @ A.T" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[29, 36, 43],\n", + " [36, 45, 54],\n", + " [43, 54, 65]])" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "A.T @ A" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### [Broadcastolás](https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n", + "- A broadcastolás a különböző alakú operandusok kezelésére szolgál.\n", + "- Példa: \n", + "```\n", + "A (4d tömb): 8 x 1 x 6 x 5\n", + "B (3d tömb): 7 x 1 x 5\n", + "Eredmény (4d tömb): 8 x 7 x 6 x 5\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([20, 30, 40])" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Vektor szorzása skalárral.\n", + "a = np.array([2, 3, 4])\n", + "b = 10\n", + "\n", + "# a: 3\n", + "# b: -\n", + "\n", + "a * b" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "operands could not be broadcast together with shapes (2,) (3,) ", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[65], line 8\u001b[0m\n\u001b[0;32m 3\u001b[0m b \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([\u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m6\u001b[39m])\n\u001b[0;32m 5\u001b[0m \u001b[38;5;66;03m# a: 2\u001b[39;00m\n\u001b[0;32m 6\u001b[0m \u001b[38;5;66;03m# b: 3\u001b[39;00m\n\u001b[1;32m----> 8\u001b[0m a \u001b[38;5;241m+\u001b[39m b\n", + "\u001b[1;31mValueError\u001b[0m: operands could not be broadcast together with shapes (2,) (3,) " + ] + } + ], + "source": [ + "# Példa nem broadcastolható tömbökre.\n", + "a = np.array([2, 3])\n", + "b = np.array([4, 5, 6])\n", + "\n", + "# a: 2\n", + "# b: 3\n", + "\n", + "a + b" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 3, 8, 15],\n", + " [ 5, 12, 21]])" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Mátrix szorzása vektorral.\n", + "A = np.array([[3, 4, 5],\n", + " [5, 6, 7]])\n", + "b = np.array([1, 2, 3])\n", + "\n", + "# A: 2 3\n", + "# b: - 3\n", + "\n", + "A * b # Oszloponkénti szorzás." + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 3, 4, 5],\n", + " [10, 12, 14]])" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Soronkénti szorzás.\n", + "A = np.array([[3, 4, 5],\n", + " [5, 6, 7]])\n", + "b = np.array([1, 2])\n", + "(A.T * b).T" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/12_gyak.ipynb b/12_gyak.ipynb new file mode 100644 index 0000000..b00ba25 --- /dev/null +++ b/12_gyak.ipynb @@ -0,0 +1,184 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 12. heti előadás anyagát tartalmazó Jupyter notebook (12_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. feladat\n", + "\n", + "Hozzunk létre egy 3×3-as, csupa True logikai értéket tartalmazó, NumPy tömböt!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. feladat\n", + "\n", + "Írjuk ki a páratlan elemeket az alábbi 2 dimenziós NumPy tömbben!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3. feladat\n", + "\n", + "Írjuk ki a 3-nál nagyobb elemeket az alábbi 2 dimenziós NumPy tömbben!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4. feladat\n", + "\n", + "Írjuk ki az átlag feletti elemeket az alábbi NumPy tömbben!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 5. feladat\n", + "\n", + "Készítsünk programot, amely egyenletes eloszlás szerint generál 1000 db térbeli pontot az egységkockában, majd meghatározza az 1. ponttól legtávolabb eső pontot!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 6. feladat\n", + "\n", + "Készítsünk olyan programot (a lineáris regresszió feladat megoldása alapján), ami nem a magassághoz ad testsúlyt, hanem fordítva, testsúlyhoz magasságot! Kell-e új modellparamétert számolnunk, vagy használhatjuk a magasság-testsúly meghatározás modellparaméterét? A kétféle megközelítés, ill. számolás miért számol másmilyen eredményt?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 7. feladat\n", + "\n", + "Készítsen függvényt, amely egy adott $n$ pozitív egész számra (mint bemenő paraméter) eredményként előállít egy olyan négyzetes mátrixot (mint numpy tömböt), amelyik négy db $n*n$-es részmátrixból áll úgy, hogy a bal felső részmátrix 1-eseket, a jobb felső 2-eseket, a bal alsó 3-asokat, és a jobb alsó 4-eseket tartalmazzon!\n", + "\n", + "Példák:\n", + "```\n", + "n = 1 n = 2 n = 3 \n", + "1 2 1 1 2 2 1 1 1 2 2 2\n", + "3 4 1 1 2 2 1 1 1 2 2 2\n", + " 3 3 4 4 1 1 1 2 2 2\n", + " 3 3 4 4 3 3 3 4 4 4\n", + " 3 3 3 4 4 4\n", + " 3 3 3 4 4 4\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 8. feladat\n", + "\n", + "Készítsünk függvényt, amely egy paraméterként kapott mátrix (mint kétdimenziós numpy tömb) alapján előállít egy új mátrixot (mint kétdimenziós numpy tömböt), ami már nem tartalmazza a mátrix egy adott indexű oszlopát!\n", + "\n", + "Elvárt működés:\n", + "```\n", + " Input Output\n", + "\n", + " A mátrix A mátrix\n", + " 1.0, 2.0, 3.0 1.0, 3.0\n", + " 4.0, 5.0, 6.0 4.0, 6.0\n", + " \n", + " A törlendő oszlop indexe\n", + " 1\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/12_gyak_mego.ipynb b/12_gyak_mego.ipynb new file mode 100644 index 0000000..889e797 --- /dev/null +++ b/12_gyak_mego.ipynb @@ -0,0 +1,418 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. feladat\n", + "\n", + "Hozzunk létre egy 3×3-as, csupa True logikai értéket tartalmazó, NumPy tömböt!" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ True, True, True],\n", + " [ True, True, True],\n", + " [ True, True, True]])" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# 1. megoldás\n", + "np.array([[True] * 3] * 3)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ True, True, True],\n", + " [ True, True, True],\n", + " [ True, True, True]])" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# 2. megoldás\n", + "np.ones((3, 3), dtype='bool')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. feladat\n", + "\n", + "Írjuk ki a páratlan elemeket az alábbi 2 dimenziós NumPy tömbben!" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3 5 7]\n" + ] + } + ], + "source": [ + "b = np.array([[2, 3, 4], [5, 6, 7]])\n", + "print(b[b % 2 == 1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3. feladat\n", + "\n", + "Írjuk ki a 3-nál nagyobb elemeket az alábbi 2 dimenziós NumPy tömbben!" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[4 5 6 7]\n" + ] + } + ], + "source": [ + "b = np.array([[2, 3, 4], [5, 6, 7]])\n", + "print(b[b > 3])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4. feladat\n", + "\n", + "Írjuk ki az átlag feletti elemeket az alábbi NumPy tömbben!" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[10 8 9]\n" + ] + } + ], + "source": [ + "b = np.array([1, 10, 2, 8, 3, 5, 9])\n", + "print(b[b > b.mean()])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 5. feladat\n", + "\n", + "Készítsünk programot, amely egyenletes eloszlás szerint generál 1000 db térbeli pontot az egységkockában, majd meghatározza az 1. ponttól legtávolabb eső pontot!" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.37454012, 0.95071431, 0.73199394],\n", + " [0.59865848, 0.15601864, 0.15599452],\n", + " [0.05808361, 0.86617615, 0.60111501],\n", + " ...,\n", + " [0.80000348, 0.55270708, 0.39655368],\n", + " [0.13171503, 0.86529576, 0.15727321],\n", + " [0.30978786, 0.29004553, 0.87141403]])" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# pontok generálása\n", + "rs = np.random.RandomState(42)\n", + "P = rs.uniform(size=(1000, 3))\n", + "P" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.89633582 0.01300192 0.08550853]\n" + ] + } + ], + "source": [ + "# legtávolabbi pont kiszámítása, 1. megoldás\n", + "\n", + "p = P[0]\n", + "dmax = 0\n", + "for pi in P:\n", + " act = ((p[0] - pi[0])**2 + (p[1] - pi[1])**2 +(p[2] - pi[2])**2)**0.5\n", + " if act > dmax:\n", + " dmax = act\n", + " pmax = pi\n", + "print(pmax)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([0.89633582, 0.01300192, 0.08550853])" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# legtávolabbi pont kiszámítása, 2. megoldás (vektorizálással)\n", + "\n", + "# P: 1000 3\n", + "# p: - 3\n", + "\n", + "P[((P - p)**2).sum(axis=1).argmax()]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 6. feladat\n", + "\n", + "A [baseball.txt](baseball.txt) szövegfájl professzionális baseball játékosok testmagasságáról és testsúlyáról tartalmaz adatokat. Készítsünk programot, amely lineáris modellt ad a testsúly testmagasságból történő előrejelzésére! Részfeladatok:\n", + "- Határozzuk meg a minimális SSE (sum squared error) hibát adó modellparamétert!\n", + "- Adjunk becslést egy 180 cm magas játékos testsúlyára!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[188., 82.],\n", + " [188., 98.],\n", + " [183., 95.],\n", + " ...,\n", + " [190., 93.],\n", + " [190., 86.],\n", + " [185., 88.]])" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Adatok betöltése.\n", + "data = np.genfromtxt('baseball.txt', delimiter=',')\n", + "data" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "# bemeneti vektor\n", + "x = data[:, 0]\n", + "\n", + "# célvektor\n", + "y = data[:, 1]" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "# átlag kivonása\n", + "xm = x.mean()\n", + "ym = y.mean()\n", + "x -= xm\n", + "y -= ym" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 0.92836399, 0.92836399, -4.07163601, ..., 2.92836399,\n", + " 2.92836399, -2.07163601])" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([-9.50338819, 6.49661181, 3.49661181, ..., 1.49661181,\n", + " -5.50338819, -3.50338819])" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.8561919786085497" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Optimális modellparaméter.\n", + "w = (x @ y) / (x @ x)\n", + "w" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "85.4487101609531" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Becslés egy 180 cm magas játékos testsúlyára.\n", + "(180 - xm) * w + ym" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/13_ea.ipynb b/13_ea.ipynb new file mode 100644 index 0000000..0fa88a5 --- /dev/null +++ b/13_ea.ipynb @@ -0,0 +1,2808 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## [pandas](https://pandas.pydata.org/)\n", + "\n", + "- A pandas egy NumPy-ra épülő adatfeldolgozó és elemző eszköz. Alapötleteit az R nyelvből vette.\n", + "- Alapvető adattípusa a DataFrame (tábla) és a Series (oszlop). Segítségükkel memóriabeli, oszlopalapú adatbázis kezelés valósítható meg.\n", + "- https://pandas.pydata.org/docs/user_guide/10min.html." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# A pandas modul importálása pd néven.\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'1.5.3'" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A pandas verziószáma.\n", + "pd.__version__" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# DataFrame létrehozása oszlopokból.\n", + "# A bemenet egy szótár, ahol a kulcsok az oszlopnevek, az értékek az oszlopok.\n", + "df1 = pd.DataFrame({'aa': [1, 2, 3], 'bb': ['x', 'y', 'z']})" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
aabb
01x
12y
23z
\n", + "
" + ], + "text/plain": [ + " aa bb\n", + "0 1 x\n", + "1 2 y\n", + "2 3 z" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df1" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "pandas.core.frame.DataFrame" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az eredmény típusa.\n", + "type(df1)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Index(['aa', 'bb'], dtype='object')" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Oszlopnevek.\n", + "df1.columns" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "aa\n", + "bb\n" + ] + } + ], + "source": [ + "# Iterálás az oszlopneveken.\n", + "for c in df1:\n", + " print(c)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sorok száma.\n", + "len(df1)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(3, 2)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A DataFrame alakja.\n", + "df1.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 3 entries, 0 to 2\n", + "Data columns (total 2 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 aa 3 non-null int64 \n", + " 1 bb 3 non-null object\n", + "dtypes: int64(1), object(1)\n", + "memory usage: 180.0+ bytes\n" + ] + } + ], + "source": [ + "# Összesítő információ.\n", + "df1.info()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
aa
count3.0
mean2.0
std1.0
min1.0
25%1.5
50%2.0
75%2.5
max3.0
\n", + "
" + ], + "text/plain": [ + " aa\n", + "count 3.0\n", + "mean 2.0\n", + "std 1.0\n", + "min 1.0\n", + "25% 1.5\n", + "50% 2.0\n", + "75% 2.5\n", + "max 3.0" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Alapvető oszlopstatisztikák (a numerikus oszlopokról).\n", + "df1.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "# DataFrame létrehozása sorokból.\n", + "# A bemenet szótárak listája, ahol minden szótár egy sort reprezentál.\n", + "data = [\n", + " {'alma': 10, 'körte': 20},\n", + " {'alma': 30},\n", + " {'alma': 40, 'körte': 50}\n", + "]\n", + "df2 = pd.DataFrame(data)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
almakörte
01020.0
130NaN
24050.0
\n", + "
" + ], + "text/plain": [ + " alma körte\n", + "0 10 20.0\n", + "1 30 NaN\n", + "2 40 50.0" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- A pandas a hiányzó adatokat NaN (\"not a number\") értékkel reprezentálja.\n", + "- Ez hatékony, de vannak veszélyei." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import numpy as np\n", + "np.nan == np.nan" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "RangeIndex(start=0, stop=3, step=1)" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Minden DataFrame-hez (és Series-hez) tartozik index.\n", + "# Alapértelmezés szerint az index 0-tól induló, 1-esével növekedő sorszám.\n", + "df2.index" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
almakörte
x1020.0
y30NaN
z4050.0
\n", + "
" + ], + "text/plain": [ + " alma körte\n", + "x 10 20.0\n", + "y 30 NaN\n", + "z 40 50.0" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Másfajta indexet is használhatunk.\n", + "df3 = pd.DataFrame(data, ['x', 'y', 'z'])\n", + "df3" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Index(['x', 'y', 'z'], dtype='object')" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df3.index" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 20\n", + "1 30\n", + "2 40\n", + "dtype: int64" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Series létrehozása index megadása nélkül.\n", + "se1 = pd.Series([20, 30, 40])\n", + "se1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "pandas.core.series.Series" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az eredmény típusa.\n", + "type(se1)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dtype('int64')" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "se1.dtype" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "aa 20\n", + "bb 30\n", + "cc 40\n", + "dtype: int64" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Series létrehozása index megadásával.\n", + "se2 = pd.Series([20, 30, 40], ['aa', 'bb', 'cc'])\n", + "se2" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
aabb
01x
12y
23z
\n", + "
" + ], + "text/plain": [ + " aa bb\n", + "0 1 x\n", + "1 2 y\n", + "2 3 z" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# DataFrame-ből [] operátorral lehet kiválasztani oszlopot.\n", + "df1" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 1\n", + "1 2\n", + "2 3\n", + "Name: aa, dtype: int64" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df1['aa']" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "pandas.core.series.Series" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(df1['aa'])" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 1\n", + "1 2\n", + "2 3\n", + "Name: aa, dtype: int64" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...illetve ha az oszlop neve érvényes azonosítónév, akkor . operátorral is.\n", + "df1.aa" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
bbaa
0x1
1y2
2z3
\n", + "
" + ], + "text/plain": [ + " bb aa\n", + "0 x 1\n", + "1 y 2\n", + "2 z 3" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Több oszlop kiválasztása.\n", + "df1[['bb', 'aa']]" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
bb
0x
1y
2z
\n", + "
" + ], + "text/plain": [ + " bb\n", + "0 x\n", + "1 y\n", + "2 z" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ha 1 elemű listával indexelünk, akkor az eredmény DataFrame típusú.\n", + "df1[['bb']]" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "pandas.core.frame.DataFrame" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(df1[['bb']])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Megjegyzés\n", + "- Az 1 oszlopos DataFrame nem ugyanaz, mint a Series!" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
almakörte
x1020.0
y30NaN
z4050.0
\n", + "
" + ], + "text/plain": [ + " alma körte\n", + "x 10 20.0\n", + "y 30 NaN\n", + "z 40 50.0" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Sor(ok) kiválasztása DataFrame-ből.\n", + "df3" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "alma 10.0\n", + "körte 20.0\n", + "Name: x, dtype: float64" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy sor kiválasztása.\n", + "df3.loc['x']" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
almakörte
x1020.0
z4050.0
\n", + "
" + ], + "text/plain": [ + " alma körte\n", + "x 10 20.0\n", + "z 40 50.0" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Több sor kiválasztása.\n", + "df3.loc[['x', 'z']]" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "alma 10.0\n", + "körte 20.0\n", + "Name: x, dtype: float64" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...pozíció alapján is lehet sort kiválasztani.\n", + "df3.iloc[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
almakörte
x1020.0
y30NaN
\n", + "
" + ], + "text/plain": [ + " alma körte\n", + "x 10 20.0\n", + "y 30 NaN" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...első néhány elem kiválasztása.\n", + "df3[:2]" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "aa 20\n", + "bb 30\n", + "cc 40\n", + "dtype: int64" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A se2 tartalma (mert ezt fogjuk használni az alábbi néhány példában).\n", + "se2" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "30" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy elem kiválasztása Series-ből.\n", + "se2['bb']" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "cc 40\n", + "bb 30\n", + "dtype: int64" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Több elem kiválasztása Series-ből.\n", + "se2[['cc', 'bb']]" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([20, 30, 40], dtype=int64)" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Nyers adattartalom kinyerése Series-ből.\n", + "se2.values" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "numpy.ndarray" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...és annak típusa.\n", + "type(se2.values)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[10., 20.],\n", + " [30., nan],\n", + " [40., 50.]])" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Nyers adattartalom kinyerése DataFrame-ből.\n", + "df2.values" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Kiválasztás](https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html) (SELECT)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tanulótantárgyosztályzat
0Gipsz JakabMatematika5
1Gipsz JakabTestnevelés2
2Bank ArankaMatematika3
3Bank ArankaMatematika5
4Bank ArankaTestnevelés4
5Rontó RóbertMatematika1
6Rontó RóbertMatematika2
7Rontó RóbertTestnevelés5
\n", + "
" + ], + "text/plain": [ + " tanuló tantárgy osztályzat\n", + "0 Gipsz Jakab Matematika 5\n", + "1 Gipsz Jakab Testnevelés 2\n", + "2 Bank Aranka Matematika 3\n", + "3 Bank Aranka Matematika 5\n", + "4 Bank Aranka Testnevelés 4\n", + "5 Rontó Róbert Matematika 1\n", + "6 Rontó Róbert Matematika 2\n", + "7 Rontó Róbert Testnevelés 5" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hozzunk létre egy példa DataFrame-et!\n", + "df = pd.DataFrame([\n", + " {'tanuló': 'Gipsz Jakab', 'tantárgy': 'Matematika', 'osztályzat': 5},\n", + " {'tanuló': 'Gipsz Jakab', 'tantárgy': 'Testnevelés', 'osztályzat': 2},\n", + " {'tanuló': 'Bank Aranka', 'tantárgy': 'Matematika', 'osztályzat': 3},\n", + " {'tanuló': 'Bank Aranka', 'tantárgy': 'Matematika', 'osztályzat': 5},\n", + " {'tanuló': 'Bank Aranka', 'tantárgy': 'Testnevelés', 'osztályzat': 4},\n", + " {'tanuló': 'Rontó Róbert', 'tantárgy': 'Matematika', 'osztályzat': 1},\n", + " {'tanuló': 'Rontó Róbert', 'tantárgy': 'Matematika', 'osztályzat': 2},\n", + " {'tanuló': 'Rontó Róbert', 'tantárgy': 'Testnevelés', 'osztályzat': 5},\n", + "])\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 True\n", + "1 True\n", + "2 False\n", + "3 False\n", + "4 False\n", + "5 False\n", + "6 False\n", + "7 False\n", + "Name: tanuló, dtype: bool" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Logikai feltétel oszlop.\n", + "df['tanuló'] == 'Gipsz Jakab'" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "pandas.core.series.Series" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...aminek a típusa:\n", + "type(df['tanuló'] == 'Gipsz Jakab')" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tanulótantárgyosztályzat
0Gipsz JakabMatematika5
1Gipsz JakabTestnevelés2
\n", + "
" + ], + "text/plain": [ + " tanuló tantárgy osztályzat\n", + "0 Gipsz Jakab Matematika 5\n", + "1 Gipsz Jakab Testnevelés 2" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Gipsz Jakab összes osztályzata.\n", + "df[df['tanuló'] == 'Gipsz Jakab']\n", + "# SQL-ben: SELECT * FROM df WHERE tanuló='Gipsz Jakab'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Műveletek\n", + "A logikai értékű Series adatok műveletei: & (és), | (vagy), ~ (tagadás)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tanulótantárgyosztályzat
1Gipsz JakabTestnevelés2
2Bank ArankaMatematika3
4Bank ArankaTestnevelés4
6Rontó RóbertMatematika2
\n", + "
" + ], + "text/plain": [ + " tanuló tantárgy osztályzat\n", + "1 Gipsz Jakab Testnevelés 2\n", + "2 Bank Aranka Matematika 3\n", + "4 Bank Aranka Testnevelés 4\n", + "6 Rontó Róbert Matematika 2" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az 1-esnél jobb és 5-ösnél rosszabb osztályzatok (az és (&) művelettel).\n", + "df[(df['osztályzat'] > 1) & (df['osztályzat'] < 5)]" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tanulótantárgyosztályzat
1Gipsz JakabTestnevelés2
2Bank ArankaMatematika3
4Bank ArankaTestnevelés4
6Rontó RóbertMatematika2
\n", + "
" + ], + "text/plain": [ + " tanuló tantárgy osztályzat\n", + "1 Gipsz Jakab Testnevelés 2\n", + "2 Bank Aranka Matematika 3\n", + "4 Bank Aranka Testnevelés 4\n", + "6 Rontó Róbert Matematika 2" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...mint előbb, a vagy (|) művelettel.\n", + "df[(df['osztályzat'] == 2) | (df['osztályzat'] == 3) | (df['osztályzat'] == 4)]" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tanulótantárgyosztályzat
1Gipsz JakabTestnevelés2
2Bank ArankaMatematika3
4Bank ArankaTestnevelés4
6Rontó RóbertMatematika2
\n", + "
" + ], + "text/plain": [ + " tanuló tantárgy osztályzat\n", + "1 Gipsz Jakab Testnevelés 2\n", + "2 Bank Aranka Matematika 3\n", + "4 Bank Aranka Testnevelés 4\n", + "6 Rontó Róbert Matematika 2" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...mint előbb, a tagadás (~) művelettel.\n", + "df[~((df['osztályzat'] == 1) | (df['osztályzat'] == 5))]" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.6666666666666665" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Rontó Róbert osztályzatainak átlaga.\n", + "df[df['tanuló'] == 'Rontó Róbert']['osztályzat'].mean()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### [Csoportosítás](https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html) (GROUPBY)\n", + "\n", + "Pandas-ban a csoportosítás folyamata az alábbi lépésekből áll:\n", + "\n", + "- Az adatok **felosztása (split)** csoportokra, valamilyen feltétel alapján.\n", + "- Valamely **függvény alkalmazása (apply)** az egyes csoportokra külön-külön.\n", + "- Az eredmények **kombinálása (combine)** egy adatszerkezetbe.\n", + "\n", + "Ezek közül a felosztás a legegyszerűbb. A felosztás kritériuma általában egy oszlopban (vagy oszlop kombinációban) található érték. A függvényalkalmazás lehet aggregáló jellegű (pl. csoportonkénti elemszám, összeg, átlag, minimum, maximum, első rekord, utolsó rekord) vagy egyéb (pl. csoportonkénti standardizálás, adathiány kitöltés vagy szűrés). A kombinálási lépés az aggregáló típusú függvények esetén automatikusan lefut, egyéb esetekben a programozónak kell kezdeményeznie." + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tanulótantárgyosztályzat
0Gipsz JakabMatematika5
1Gipsz JakabTestnevelés2
2Bank ArankaMatematika3
3Bank ArankaMatematika5
4Bank ArankaTestnevelés4
5Rontó RóbertMatematika1
6Rontó RóbertMatematika2
7Rontó RóbertTestnevelés5
\n", + "
" + ], + "text/plain": [ + " tanuló tantárgy osztályzat\n", + "0 Gipsz Jakab Matematika 5\n", + "1 Gipsz Jakab Testnevelés 2\n", + "2 Bank Aranka Matematika 3\n", + "3 Bank Aranka Matematika 5\n", + "4 Bank Aranka Testnevelés 4\n", + "5 Rontó Róbert Matematika 1\n", + "6 Rontó Róbert Matematika 2\n", + "7 Rontó Róbert Testnevelés 5" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Használjuk az előző DataFrame-et!\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [], + "source": [ + "# Csoportosítás tantárgyak szerint.\n", + "gb = df.groupby('tantárgy')" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az eredmény típusa.\n", + "gb" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tantárgy\n", + "Matematika 5\n", + "Testnevelés 3\n", + "dtype: int64" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hány rekord tartozik az egyes tantárgyakhoz?\n", + "gb.size()" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tantárgy\n", + "Matematika 5\n", + "Testnevelés 3\n", + "dtype: int64" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Ugyanez, az átmeneti GroupBy objektum használata nélkül.\n", + "df.groupby('tantárgy').size()\n", + "# SQL-ben: SELECT tantárgy, COUNT(*) FROM df GROUP BY tantárgy" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tantárgy\n", + "Matematika 3.200000\n", + "Testnevelés 3.666667\n", + "Name: osztályzat, dtype: float64" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tantárgyankénti átlag.\n", + "df.groupby('tantárgy')['osztályzat'].mean()" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tantárgy\n", + "Matematika 3.200000\n", + "Testnevelés 3.666667\n", + "Name: osztályzat, dtype: float64" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...ugyanez csúnyábban:\n", + "df['osztályzat'].groupby(df['tantárgy']).mean()" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tanuló tantárgy \n", + "Bank Aranka Matematika 4.0\n", + " Testnevelés 4.0\n", + "Gipsz Jakab Matematika 5.0\n", + " Testnevelés 2.0\n", + "Rontó Róbert Matematika 1.5\n", + " Testnevelés 5.0\n", + "Name: osztályzat, dtype: float64" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Tantárgyankénti átlag minden tanulóhoz.\n", + "df.groupby(['tanuló', 'tantárgy'])['osztályzat'].mean()" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tanulótantárgyosztályzat
0Bank ArankaMatematika4.0
1Bank ArankaTestnevelés4.0
2Gipsz JakabMatematika5.0
3Gipsz JakabTestnevelés2.0
4Rontó RóbertMatematika1.5
5Rontó RóbertTestnevelés5.0
\n", + "
" + ], + "text/plain": [ + " tanuló tantárgy osztályzat\n", + "0 Bank Aranka Matematika 4.0\n", + "1 Bank Aranka Testnevelés 4.0\n", + "2 Gipsz Jakab Matematika 5.0\n", + "3 Gipsz Jakab Testnevelés 2.0\n", + "4 Rontó Róbert Matematika 1.5\n", + "5 Rontó Róbert Testnevelés 5.0" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az index átalakítása két hagyományos oszloppá.\n", + "df.groupby(['tanuló', 'tantárgy'])['osztályzat'].mean().reset_index()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Rendezés, minimum, maximum" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ab
01020
11229
2821
31519
\n", + "
" + ], + "text/plain": [ + " a b\n", + "0 10 20\n", + "1 12 29\n", + "2 8 21\n", + "3 15 19" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Példa tábla a rendezéshez.\n", + "df4 = pd.DataFrame([\n", + " {'a': 10, 'b': 20},\n", + " {'a': 12, 'b': 29},\n", + " {'a': 8, 'b': 21},\n", + " {'a': 15, 'b': 19}\n", + "])\n", + "df4" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ab
2821
01020
11229
31519
\n", + "
" + ], + "text/plain": [ + " a b\n", + "2 8 21\n", + "0 10 20\n", + "1 12 29\n", + "3 15 19" + ] + }, + "execution_count": 58, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Rendezés 'a' szerint.\n", + "df4.sort_values('a')" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ab
31519
11229
01020
2821
\n", + "
" + ], + "text/plain": [ + " a b\n", + "3 15 19\n", + "1 12 29\n", + "0 10 20\n", + "2 8 21" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Rendezés csökkenő sorrendbe.\n", + "df4.sort_values('a', ascending=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1 29\n", + "2 21\n", + "0 20\n", + "Name: b, dtype: int64" + ] + }, + "execution_count": 60, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy oszlop elemeinek rendezése (a három legnagyobb elem meghatározásához).\n", + "df4['b'].sort_values(ascending=False)[:3]" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "29" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A 'b' oszlop maximuma.\n", + "df4['b'].max()" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 62, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Mely indexnél található a 'b' oszlop maximuma?\n", + "df4['b'].idxmax()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Módosítás" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
abc
0102030
1122941
282129
3151934
\n", + "
" + ], + "text/plain": [ + " a b c\n", + "0 10 20 30\n", + "1 12 29 41\n", + "2 8 21 29\n", + "3 15 19 34" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Új oszlop felvétele.\n", + "df4['c'] = df4['a'] + df4['b']\n", + "df4" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "41" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy elem 'elérése'.\n", + "df4['c'][1]" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "41" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...ugyanez másképp:\n", + "df4.loc[1]['c']" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "41" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...ugyanez másképp:\n", + "df4.iloc[1]['c']" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
abc
0102030
11229100
282129
3151934
\n", + "
" + ], + "text/plain": [ + " a b c\n", + "0 10 20 30\n", + "1 12 29 100\n", + "2 8 21 29\n", + "3 15 19 34" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Egy elem módosítása.\n", + "df4['c'][1] = 100\n", + "df4" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ab
01020
11229
2821
31519
\n", + "
" + ], + "text/plain": [ + " a b\n", + "0 10 20\n", + "1 12 29\n", + "2 8 21\n", + "3 15 19" + ] + }, + "execution_count": 68, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Oszlop törlése.\n", + "del df4['c']\n", + "df4" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/13_gyak.ipynb b/13_gyak.ipynb new file mode 100644 index 0000000..f32b8a9 --- /dev/null +++ b/13_gyak.ipynb @@ -0,0 +1,63 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Előadás anyag\n", + "Nézzük meg a 13. heti előadás anyagát tartalmazó Jupyter notebook (13_ea.ipynb) tartalmát! Futtassuk az egyes cellákat, módosítsunk, kisérletezzünk szabadon!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "\n", + "Oldjuk meg az alábbi feladatokat a pandas segítségével!\n", + "\n", + "A [pl.txt](pl.txt) szövegfájl a Premier League 2011-12-es szezonjának eredményeit tartalmazza. Készítsünk programot, amely:\n", + "- Betölti a fájl adatait egy DataFrame-be!\n", + "- Meghatározza, hogy:\n", + " - hány mérkőzés volt ez egyes fordulókban?\n", + " - hány gól esett az egyes fordulókban?\n", + " - melyik fordulóban esett a legtöbb gól?\n", + " - mennyi volt az átlagos mérkőzésenkénti gólszám az egyes fordulókban?\n", + " - a mérkőzések hány százalékán esett gól?\n", + " - melyik mérkőzésen esett a legtöbb gól?\n", + " - hány gólt rúgott összesen a Manchester United?\n", + "- Kiírja: \n", + " - a tíz leggólgazdagabb fordulót a gólszámokkal együtt!\n", + " - a 10., 20. és 30. fordulóban hány gól esett összesen!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/13_gyak_mego.ipynb b/13_gyak_mego.ipynb new file mode 100644 index 0000000..69aa506 --- /dev/null +++ b/13_gyak_mego.ipynb @@ -0,0 +1,994 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Feladatok\n", + "Oldjuk meg az alábbi feladatokat a pandas segítségével!\n", + "\n", + "A [pl.txt](pl.txt) szövegfájl a Premier League 2011-12-es szezonjának eredményeit tartalmazza. Készítsünk programot, amely:\n", + "- Betölti a fájl adatait egy DataFrame-be!\n", + "- Meghatározza, hogy:\n", + " - hány mérkőzés volt ez egyes fordulókban?\n", + " - hány gól esett az egyes fordulókban?\n", + " - mennyi volt az átlagos mérkőzésenkénti gólszám az egyes fordulókban?\n", + " - melyik fordulóban esett a legtöbb gól?\n", + " - a mérkőzések hány százalékán esett gól?\n", + " - melyik mérkőzésen esett a legtöbb gól?\n", + " - hány gólt rúgott összesen a Manchester United?\n", + "\n", + "- Kiírja: \n", + " - a tíz leggólgazdagabb fordulót a gólszámokkal együtt!\n", + " - a 10., 20. és 30. fordulóban hány gól esett összesen!" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# A megoldáshoz a pandas-t használjuk.\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
roundhteamateamhgoalsagoals
01Blackburn RoversWolverhampton Wanderers12
11Fulham FCAston Villa00
21Liverpool FCSunderland AFC11
31Queens Park RangersBolton Wanderers04
41Wigan AthleticNorwich City11
..................
37538Sunderland AFCManchester United01
37638Swansea CityLiverpool FC10
37738Tottenham HotspurFulham FC20
37838West Bromwich AlbionArsenal FC23
37938Wigan AthleticWolverhampton Wanderers32
\n", + "

380 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " round hteam ateam hgoals agoals\n", + "0 1 Blackburn Rovers Wolverhampton Wanderers 1 2\n", + "1 1 Fulham FC Aston Villa 0 0\n", + "2 1 Liverpool FC Sunderland AFC 1 1\n", + "3 1 Queens Park Rangers Bolton Wanderers 0 4\n", + "4 1 Wigan Athletic Norwich City 1 1\n", + ".. ... ... ... ... ...\n", + "375 38 Sunderland AFC Manchester United 0 1\n", + "376 38 Swansea City Liverpool FC 1 0\n", + "377 38 Tottenham Hotspur Fulham FC 2 0\n", + "378 38 West Bromwich Albion Arsenal FC 2 3\n", + "379 38 Wigan Athletic Wolverhampton Wanderers 3 2\n", + "\n", + "[380 rows x 5 columns]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Töltsük be a pl.txt fájl adatait DataFrame-be!\n", + "names = ['round', 'hteam', 'ateam', 'hgoals', 'agoals']\n", + "df = pd.read_csv('pl.txt', sep='\\t', skiprows=6, names=names)\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 380 entries, 0 to 379\n", + "Data columns (total 5 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 round 380 non-null int64 \n", + " 1 hteam 380 non-null object\n", + " 2 ateam 380 non-null object\n", + " 3 hgoals 380 non-null int64 \n", + " 4 agoals 380 non-null int64 \n", + "dtypes: int64(3), object(2)\n", + "memory usage: 15.0+ KB\n" + ] + } + ], + "source": [ + "df.info()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
roundhgoalsagoals
count380.000000380.000000380.000000
mean19.5000001.5894741.215789
std10.9803131.3315311.204987
min1.0000000.0000000.000000
25%10.0000001.0000000.000000
50%19.5000001.0000001.000000
75%29.0000002.0000002.000000
max38.0000008.0000006.000000
\n", + "
" + ], + "text/plain": [ + " round hgoals agoals\n", + "count 380.000000 380.000000 380.000000\n", + "mean 19.500000 1.589474 1.215789\n", + "std 10.980313 1.331531 1.204987\n", + "min 1.000000 0.000000 0.000000\n", + "25% 10.000000 1.000000 0.000000\n", + "50% 19.500000 1.000000 1.000000\n", + "75% 29.000000 2.000000 2.000000\n", + "max 38.000000 8.000000 6.000000" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
roundhteamateamhgoalsagoalsgoals
01Blackburn RoversWolverhampton Wanderers123
11Fulham FCAston Villa000
21Liverpool FCSunderland AFC112
31Queens Park RangersBolton Wanderers044
41Wigan AthleticNorwich City112
.....................
37538Sunderland AFCManchester United011
37638Swansea CityLiverpool FC101
37738Tottenham HotspurFulham FC202
37838West Bromwich AlbionArsenal FC235
37938Wigan AthleticWolverhampton Wanderers325
\n", + "

380 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " round hteam ateam hgoals agoals \\\n", + "0 1 Blackburn Rovers Wolverhampton Wanderers 1 2 \n", + "1 1 Fulham FC Aston Villa 0 0 \n", + "2 1 Liverpool FC Sunderland AFC 1 1 \n", + "3 1 Queens Park Rangers Bolton Wanderers 0 4 \n", + "4 1 Wigan Athletic Norwich City 1 1 \n", + ".. ... ... ... ... ... \n", + "375 38 Sunderland AFC Manchester United 0 1 \n", + "376 38 Swansea City Liverpool FC 1 0 \n", + "377 38 Tottenham Hotspur Fulham FC 2 0 \n", + "378 38 West Bromwich Albion Arsenal FC 2 3 \n", + "379 38 Wigan Athletic Wolverhampton Wanderers 3 2 \n", + "\n", + " goals \n", + "0 3 \n", + "1 0 \n", + "2 2 \n", + "3 4 \n", + "4 2 \n", + ".. ... \n", + "375 1 \n", + "376 1 \n", + "377 2 \n", + "378 5 \n", + "379 5 \n", + "\n", + "[380 rows x 6 columns]" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# \"Gólok száma\" oszlop felvétele.\n", + "df['goals'] = df['hgoals'] + df['agoals']\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "round\n", + "1 10\n", + "2 10\n", + "3 10\n", + "4 10\n", + "5 10\n", + "6 10\n", + "7 10\n", + "8 10\n", + "9 10\n", + "10 10\n", + "11 10\n", + "12 10\n", + "13 10\n", + "14 10\n", + "15 10\n", + "16 10\n", + "17 10\n", + "18 10\n", + "19 10\n", + "20 10\n", + "21 10\n", + "22 10\n", + "23 10\n", + "24 10\n", + "25 10\n", + "26 10\n", + "27 10\n", + "28 10\n", + "29 10\n", + "30 10\n", + "31 10\n", + "32 10\n", + "33 10\n", + "34 10\n", + "35 10\n", + "36 10\n", + "37 10\n", + "38 10\n", + "dtype: int64" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Példák csoportosításra (groupby).\n", + "# Hány mérkőzés volt az egyes fordulókban?\n", + "df.groupby('round').size()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1 10\n", + "29 10\n", + "22 10\n", + "23 10\n", + "24 10\n", + "25 10\n", + "26 10\n", + "27 10\n", + "28 10\n", + "30 10\n", + "2 10\n", + "31 10\n", + "32 10\n", + "33 10\n", + "34 10\n", + "35 10\n", + "36 10\n", + "37 10\n", + "21 10\n", + "20 10\n", + "19 10\n", + "18 10\n", + "3 10\n", + "4 10\n", + "5 10\n", + "6 10\n", + "7 10\n", + "8 10\n", + "9 10\n", + "10 10\n", + "11 10\n", + "12 10\n", + "13 10\n", + "14 10\n", + "15 10\n", + "16 10\n", + "17 10\n", + "38 10\n", + "Name: round, dtype: int64" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# (majdnem) ugyanez, tömörebben\n", + "df['round'].value_counts()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "round\n", + "1 20\n", + "2 23\n", + "3 31\n", + "4 22\n", + "5 38\n", + "6 27\n", + "7 34\n", + "8 32\n", + "9 31\n", + "10 39\n", + "11 31\n", + "12 30\n", + "13 25\n", + "14 30\n", + "15 30\n", + "16 18\n", + "17 31\n", + "18 19\n", + "19 26\n", + "20 29\n", + "21 22\n", + "22 35\n", + "23 23\n", + "24 31\n", + "25 36\n", + "26 30\n", + "27 24\n", + "28 17\n", + "29 27\n", + "30 25\n", + "31 35\n", + "32 23\n", + "33 29\n", + "34 28\n", + "35 22\n", + "36 35\n", + "37 26\n", + "38 32\n", + "Name: goals, dtype: int64" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hány gól esett az egyes fordulókban?\n", + "df.groupby('round')['goals'].sum()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Melyik fordulóban esett a legtöbb gól?\n", + "df.groupby('round')['goals'].sum().idxmax()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "round\n", + "1 2.0\n", + "2 2.3\n", + "3 3.1\n", + "4 2.2\n", + "5 3.8\n", + "6 2.7\n", + "7 3.4\n", + "8 3.2\n", + "9 3.1\n", + "10 3.9\n", + "11 3.1\n", + "12 3.0\n", + "13 2.5\n", + "14 3.0\n", + "15 3.0\n", + "16 1.8\n", + "17 3.1\n", + "18 1.9\n", + "19 2.6\n", + "20 2.9\n", + "21 2.2\n", + "22 3.5\n", + "23 2.3\n", + "24 3.1\n", + "25 3.6\n", + "26 3.0\n", + "27 2.4\n", + "28 1.7\n", + "29 2.7\n", + "30 2.5\n", + "31 3.5\n", + "32 2.3\n", + "33 2.9\n", + "34 2.8\n", + "35 2.2\n", + "36 3.5\n", + "37 2.6\n", + "38 3.2\n", + "Name: goals, dtype: float64" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Az átlagos mérkőzésenkénti gólszám az egyes fordulókban.\n", + "df.groupby('round')['goals'].mean()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "round\n", + "10 39\n", + "5 38\n", + "25 36\n", + "22 35\n", + "36 35\n", + "31 35\n", + "7 34\n", + "38 32\n", + "8 32\n", + "9 31\n", + "Name: goals, dtype: int64" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Írjuk ki a tíz leggólgazdagabb fordulót a gólszámokkal együtt!\n", + "df.groupby('round')['goals'].sum().sort_values(ascending=False).head(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "92.89473684210526" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# A mérkőzések hány százalékán esett gól?\n", + "(df['goals'] > 0).mean() * 100" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "round 3\n", + "hteam Manchester United\n", + "ateam Arsenal FC\n", + "hgoals 8\n", + "agoals 2\n", + "goals 10\n", + "Name: 29, dtype: object" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Melyik mérkőzésen esett a legtöbb gól?\n", + "df.loc[df['goals'].idxmax()]" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "93" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Írjuk ki, hogy a 10., 20. és 30. fordulóban hány gól esett összesen!\n", + "df[(df['round'] == 10) | (df['round'] == 20) | (df['round'] == 30)]['goals'].sum()" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "93" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...alternatív megoldás:\n", + "df[df['round'].isin({10, 20, 30})]['goals'].sum()" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "93" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...harmadik megoldás:\n", + "df.groupby('round')['goals'].sum()[[10, 20, 30]].sum()" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "93" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...negyedik megoldás:\n", + "df[(df['round'] % 10 == 0)]['goals'].sum()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "89" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Hány gólt rúgott összesen a Manchester United?\n", + "df[df['hteam'] == 'Manchester United']['hgoals'].sum() + df[df['ateam'] == 'Manchester United']['agoals'].sum()" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "89" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# ...alternatív megoldás:\n", + "sum([df[df[f'{p}team'] == 'Manchester United'][f'{p}goals'].sum() for p in 'ha'])" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/baseball.txt b/baseball.txt new file mode 100644 index 0000000..a1e9aff --- /dev/null +++ b/baseball.txt @@ -0,0 +1,1034 @@ +# height(cm),weight(kg) +188,82 +188,98 +183,95 +183,95 +185,85 +175,80 +175,95 +180,91 +193,105 +180,82 +185,85 +185,82 +188,84 +188,73 +175,82 +178,84 +183,89 +185,86 +190,84 +198,99 +201,104 +193,93 +188,104 +193,88 +183,82 +180,87 +190,102 +196,92 +188,88 +185,83 +188,85 +198,91 +185,82 +190,91 +185,91 +190,111 +190,109 +188,98 +175,84 +180,79 +188,90 +185,91 +185,98 +193,91 +188,93 +188,93 +178,84 +183,85 +196,100 +188,95 +178,88 +193,111 +190,88 +185,91 +190,91 +193,96 +193,102 +198,95 +188,93 +188,100 +193,88 +196,91 +206,118 +198,103 +190,122 +196,91 +190,95 +193,86 +188,100 +183,82 +183,93 +190,95 +185,100 +185,96 +185,91 +178,82 +178,86 +178,77 +193,104 +173,70 +180,84 +183,84 +190,91 +190,102 +190,102 +190,100 +173,73 +188,93 +198,107 +180,113 +185,95 +193,86 +188,73 +188,91 +201,93 +190,101 +185,88 +193,93 +188,100 +188,100 +185,77 +183,84 +188,88 +185,100 +188,104 +183,82 +185,100 +175,82 +183,82 +185,77 +190,95 +190,98 +185,91 +183,97 +183,82 +193,87 +188,107 +183,84 +193,104 +196,107 +188,95 +196,101 +190,95 +193,104 +203,100 +188,82 +188,86 +190,91 +198,95 +185,88 +185,82 +188,86 +190,109 +193,91 +180,90 +185,91 +188,88 +193,95 +193,100 +188,86 +185,95 +188,102 +178,82 +183,84 +185,77 +185,84 +185,84 +185,82 +180,81 +188,79 +188,91 +183,92 +188,96 +180,86 +188,95 +190,109 +185,86 +190,86 +190,84 +201,132 +185,79 +190,84 +193,91 +188,100 +193,77 +198,100 +188,86 +193,100 +183,93 +188,91 +193,113 +188,102 +190,98 +198,95 +190,98 +183,88 +188,91 +183,88 +188,100 +178,82 +180,82 +178,77 +190,88 +180,82 +180,77 +185,93 +183,93 +180,91 +185,102 +183,91 +190,102 +178,102 +188,106 +188,82 +190,102 +185,82 +196,100 +185,82 +193,108 +190,98 +188,86 +193,107 +190,86 +185,82 +180,75 +193,88 +190,91 +183,86 +180,86 +196,84 +185,84 +188,93 +180,86 +183,93 +188,93 +190,100 +185,94 +183,77 +190,88 +190,95 +188,86 +183,96 +188,104 +180,77 +178,84 +190,104 +188,84 +196,109 +196,102 +190,95 +190,79 +198,104 +190,91 +193,98 +185,90 +190,102 +190,126 +201,98 +196,104 +193,109 +180,84 +190,99 +188,77 +175,99 +180,86 +193,102 +183,100 +183,80 +178,86 +183,89 +185,92 +180,76 +183,82 +180,88 +185,100 +183,98 +185,84 +188,86 +188,93 +183,93 +185,91 +190,91 +188,95 +188,98 +196,91 +190,93 +185,96 +183,86 +180,94 +188,91 +196,95 +190,105 +190,104 +190,95 +198,100 +198,95 +188,92 +193,96 +198,102 +193,77 +178,86 +183,91 +203,108 +188,100 +188,77 +180,88 +178,86 +183,68 +180,100 +188,91 +180,86 +183,84 +180,84 +188,91 +175,78 +193,100 +190,102 +190,86 +193,88 +185,99 +193,86 +185,89 +196,91 +185,88 +183,95 +183,80 +196,100 +196,107 +180,82 +188,88 +188,88 +185,86 +198,104 +190,86 +185,91 +178,86 +188,86 +183,91 +185,91 +185,84 +190,91 +190,82 +188,99 +193,85 +185,91 +188,100 +190,93 +185,93 +190,86 +183,77 +185,73 +185,98 +183,79 +188,93 +198,91 +193,97 +185,91 +188,86 +190,82 +178,93 +190,100 +180,86 +183,98 +198,107 +190,87 +185,91 +185,82 +180,91 +190,95 +196,109 +183,84 +175,75 +185,86 +188,84 +183,79 +178,70 +190,95 +178,77 +183,79 +183,100 +188,95 +185,93 +188,91 +190,102 +193,93 +190,88 +203,109 +183,68 +190,91 +185,98 +188,92 +188,91 +185,86 +190,93 +190,86 +180,73 +185,98 +190,84 +188,91 +188,86 +183,95 +188,84 +188,100 +188,86 +185,92 +193,93 +190,100 +183,79 +185,73 +185,86 +185,91 +183,104 +183,93 +183,100 +183,82 +180,88 +190,79 +196,113 +190,85 +188,104 +185,86 +190,91 +201,86 +188,99 +193,107 +185,82 +188,82 +188,82 +183,91 +188,106 +188,84 +190,100 +198,101 +188,91 +188,95 +188,91 +196,95 +178,86 +185,80 +188,103 +185,82 +180,88 +190,90 +180,79 +183,84 +196,109 +188,95 +178,82 +196,88 +185,102 +196,125 +188,88 +183,82 +193,93 +180,88 +193,104 +198,104 +190,100 +185,91 +198,113 +188,86 +201,94 +190,111 +193,113 +183,73 +190,87 +190,100 +178,77 +183,89 +178,70 +188,86 +180,91 +193,100 +185,95 +193,103 +180,86 +175,73 +183,84 +183,82 +175,82 +185,91 +175,80 +185,73 +188,101 +188,96 +183,88 +180,91 +188,95 +185,102 +183,79 +183,93 +193,109 +193,84 +193,118 +188,84 +193,100 +190,93 +180,91 +183,77 +180,91 +185,93 +190,84 +193,93 +190,111 +180,100 +190,95 +188,100 +183,84 +185,79 +185,77 +185,82 +185,91 +193,95 +183,79 +193,100 +185,93 +185,82 +185,95 +190,88 +190,91 +196,91 +185,74 +183,82 +190,100 +178,88 +188,93 +183,77 +203,109 +180,95 +180,88 +188,91 +188,93 +185,87 +190,86 +193,77 +185,109 +196,91 +183,93 +185,79 +196,113 +193,100 +180,102 +190,95 +185,88 +188,82 +196,111 +180,79 +183,82 +185,98 +175,79 +185,82 +178,88 +188,104 +193,104 +185,93 +185,98 +190,88 +185,82 +201,93 +188,82 +185,86 +188,82 +196,86 +190,86 +188,100 +185,95 +196,116 +185,86 +196,104 +188,91 +188,93 +185,95 +196,102 +188,98 +196,100 +190,93 +196,91 +190,100 +180,89 +188,102 +178,85 +201,111 +183,84 +183,84 +178,79 +188,91 +188,82 +183,85 +185,102 +183,91 +188,95 +188,111 +193,97 +208,105 +188,75 +188,103 +178,95 +185,113 +185,87 +188,86 +196,91 +183,98 +193,115 +185,105 +185,82 +183,98 +188,100 +188,82 +180,91 +183,77 +190,88 +188,95 +188,91 +196,100 +178,75 +180,82 +185,91 +193,91 +180,77 +190,102 +188,100 +183,82 +193,90 +201,109 +193,108 +185,84 +193,95 +198,100 +190,91 +193,88 +183,100 +183,104 +185,77 +185,100 +190,104 +180,75 +193,93 +178,87 +190,95 +188,93 +190,91 +185,95 +180,84 +180,88 +183,92 +185,93 +185,88 +183,82 +175,91 +185,84 +198,109 +180,84 +185,100 +190,93 +193,93 +178,82 +188,91 +196,86 +190,94 +201,109 +183,82 +196,104 +185,88 +190,98 +190,86 +190,88 +185,98 +185,98 +193,100 +196,100 +190,104 +178,88 +180,86 +180,88 +190,95 +188,92 +175,77 +178,84 +190,93 +183,79 +190,95 +185,86 +183,82 +183,82 +183,73 +193,107 +190,91 +188,95 +190,102 +175,82 +185,86 +183,89 +183,92 +190,93 +196,77 +193,91 +203,113 +196,91 +193,100 +201,91 +180,86 +190,77 +185,86 +193,100 +196,98 +185,93 +193,98 +178,84 +190,107 +185,85 +190,104 +178,88 +175,76 +180,86 +183,73 +183,91 +185,91 +178,86 +178,82 +185,86 +193,91 +190,100 +183,85 +185,109 +201,86 +180,82 +183,84 +188,95 +188,100 +188,99 +183,86 +193,88 +193,79 +183,82 +183,98 +180,95 +183,91 +183,86 +178,84 +196,100 +188,77 +183,88 +193,93 +180,88 +193,95 +180,86 +185,86 +178,82 +185,100 +185,86 +183,84 +180,84 +180,86 +180,82 +183,86 +183,77 +188,95 +188,109 +188,100 +180,82 +183,95 +190,95 +183,88 +180,73 +183,82 +183,93 +183,91 +183,84 +188,111 +188,86 +196,95 +190,91 +185,91 +190,101 +185,98 +193,109 +183,77 +196,100 +190,71 +183,86 +180,92 +180,100 +190,91 +183,86 +185,95 +185,86 +180,91 +178,75 +190,86 +180,84 +193,104 +185,94 +173,95 +180,79 +183,82 +188,91 +196,93 +183,91 +193,113 +198,95 +206,104 +183,111 +185,92 +193,109 +183,91 +183,98 +188,80 +193,95 +185,77 +193,98 +190,98 +178,90 +180,91 +188,100 +183,77 +185,91 +193,104 +193,105 +185,83 +180,87 +173,76 +180,86 +180,82 +188,82 +196,98 +175,73 +183,93 +193,101 +185,93 +190,79 +193,77 +190,86 +193,109 +183,79 +188,104 +193,101 +188,89 +183,76 +190,88 +198,86 +196,113 +178,86 +183,86 +201,86 +188,77 +180,73 +173,68 +196,102 +190,100 +180,95 +183,95 +178,80 +183,118 +183,88 +185,86 +183,84 +188,82 +183,88 +183,88 +190,99 +183,102 +185,96 +188,92 +183,84 +198,91 +190,95 +183,91 +188,88 +190,103 +190,95 +193,86 +188,96 +188,86 +185,99 +188,100 +180,86 +188,107 +190,95 +193,91 +188,85 +193,95 +193,107 +185,85 +190,98 +190,98 +188,100 +173,82 +183,84 +190,91 +180,95 +178,100 +183,84 +185,105 +183,95 +190,88 +188,91 +178,93 +185,91 +193,91 +180,86 +208,113 +183,84 +185,82 +188,77 +180,82 +190,94 +196,107 +183,98 +188,111 +183,100 +185,84 +198,104 +196,86 +185,91 +185,82 +185,86 +185,89 +185,82 +193,104 +190,102 +178,73 +185,81 +183,93 +185,84 +190,95 +188,82 +185,86 +185,91 +193,117 +185,86 +190,100 +178,75 +196,93 +183,91 +196,94 +188,84 +190,98 +190,77 +190,107 +190,95 +183,77 +188,82 +180,77 +193,86 +180,68 +190,104 +193,92 +211,118 +190,112 +188,84 +193,95 +183,90 +183,95 +190,98 +190,82 +183,91 +196,111 +185,91 +183,87 +178,87 +188,91 +183,87 +188,93 +183,86 +180,84 +178,77 +180,89 +193,99 +188,91 +193,100 +188,94 +188,102 +188,94 +190,96 +190,102 +180,77 +180,86 +188,95 +196,104 +180,95 +188,91 +190,108 +196,106 +193,101 +188,91 +193,86 +183,77 +180,100 +183,101 +190,95 +185,98 +173,89 +183,79 +175,79 +185,86 +185,93 +190,95 +178,82 +178,82 +188,89 +190,100 +188,103 +188,86 +185,92 +188,75 +190,98 +196,100 +185,94 +188,95 +193,98 +188,88 +190,91 +185,98 +193,104 +198,109 +190,94 +185,93 +196,94 +188,84 +183,86 +188,77 +183,94 +180,102 +185,86 +190,102 +185,84 +170,82 +170,75 +193,109 +188,100 +185,96 +178,74 +190,98 +178,79 +183,93 +196,95 +201,93 +198,94 +188,98 +190,82 +190,91 +198,104 +193,96 +190,104 +175,86 +190,100 +183,82 +190,93 +185,86 +188,82 +190,93 +190,86 +185,88 diff --git a/example_file.txt b/example_file.txt new file mode 100644 index 0000000..397f27b --- /dev/null +++ b/example_file.txt @@ -0,0 +1,4 @@ +# example data +apple,10 +pear,20 +cherry,30 diff --git a/hamlet.txt b/hamlet.txt new file mode 100644 index 0000000..e553895 --- /dev/null +++ b/hamlet.txt @@ -0,0 +1,6777 @@ +HAMLET, PRINCE OF DENMARK + +by William Shakespeare + + + + +PERSONS REPRESENTED. + +Claudius, King of Denmark. +Hamlet, Son to the former, and Nephew to the present King. +Polonius, Lord Chamberlain. +Horatio, Friend to Hamlet. +Laertes, Son to Polonius. +Voltimand, Courtier. +Cornelius, Courtier. +Rosencrantz, Courtier. +Guildenstern, Courtier. +Osric, Courtier. +A Gentleman, Courtier. +A Priest. +Marcellus, Officer. +Bernardo, Officer. +Francisco, a Soldier +Reynaldo, Servant to Polonius. +Players. +Two Clowns, Grave-diggers. +Fortinbras, Prince of Norway. +A Captain. +English Ambassadors. +Ghost of Hamlet's Father. + +Gertrude, Queen of Denmark, and Mother of Hamlet. +Ophelia, Daughter to Polonius. + +Lords, Ladies, Officers, Soldiers, Sailors, Messengers, and other +Attendants. + +SCENE. Elsinore. + + + +ACT I. + +Scene I. Elsinore. A platform before the Castle. + +[Francisco at his post. Enter to him Bernardo.] + +Ber. +Who's there? + +Fran. +Nay, answer me: stand, and unfold yourself. + +Ber. +Long live the king! + +Fran. +Bernardo? + +Ber. +He. + +Fran. +You come most carefully upon your hour. + +Ber. +'Tis now struck twelve. Get thee to bed, Francisco. + +Fran. +For this relief much thanks: 'tis bitter cold, +And I am sick at heart. + +Ber. +Have you had quiet guard? + +Fran. +Not a mouse stirring. + +Ber. +Well, good night. +If you do meet Horatio and Marcellus, +The rivals of my watch, bid them make haste. + +Fran. +I think I hear them.--Stand, ho! Who is there? + +[Enter Horatio and Marcellus.] + +Hor. +Friends to this ground. + +Mar. +And liegemen to the Dane. + +Fran. +Give you good-night. + +Mar. +O, farewell, honest soldier; +Who hath reliev'd you? + +Fran. +Bernardo has my place. +Give you good-night. + +[Exit.] + +Mar. +Holla! Bernardo! + +Ber. +Say. +What, is Horatio there? + +Hor. +A piece of him. + +Ber. +Welcome, Horatio:--Welcome, good Marcellus. + +Mar. +What, has this thing appear'd again to-night? + +Ber. +I have seen nothing. + +Mar. +Horatio says 'tis but our fantasy, +And will not let belief take hold of him +Touching this dreaded sight, twice seen of us: +Therefore I have entreated him along +With us to watch the minutes of this night; +That, if again this apparition come +He may approve our eyes and speak to it. + +Hor. +Tush, tush, 'twill not appear. + +Ber. +Sit down awhile, +And let us once again assail your ears, +That are so fortified against our story, +What we two nights have seen. + +Hor. +Well, sit we down, +And let us hear Bernardo speak of this. + +Ber. +Last night of all, +When yond same star that's westward from the pole +Had made his course to illume that part of heaven +Where now it burns, Marcellus and myself, +The bell then beating one,-- + +Mar. +Peace, break thee off; look where it comes again! + +[Enter Ghost, armed.] + +Ber. +In the same figure, like the king that's dead. + +Mar. +Thou art a scholar; speak to it, Horatio. + +Ber. +Looks it not like the King? mark it, Horatio. + +Hor. +Most like:--it harrows me with fear and wonder. + +Ber. +It would be spoke to. + +Mar. +Question it, Horatio. + +Hor. +What art thou, that usurp'st this time of night, +Together with that fair and warlike form +In which the majesty of buried Denmark +Did sometimes march? By heaven I charge thee, speak! + +Mar. +It is offended. + +Ber. +See, it stalks away! + +Hor. +Stay! speak, speak! I charge thee speak! + +[Exit Ghost.] + +Mar. +'Tis gone, and will not answer. + +Ber. +How now, Horatio! You tremble and look pale: +Is not this something more than fantasy? +What think you on't? + +Hor. +Before my God, I might not this believe +Without the sensible and true avouch +Of mine own eyes. + +Mar. +Is it not like the King? + +Hor. +As thou art to thyself: +Such was the very armour he had on +When he the ambitious Norway combated; +So frown'd he once when, in an angry parle, +He smote the sledded Polacks on the ice. +'Tis strange. + +Mar. +Thus twice before, and jump at this dead hour, +With martial stalk hath he gone by our watch. + +Hor. +In what particular thought to work I know not; +But, in the gross and scope of my opinion, +This bodes some strange eruption to our state. + +Mar. +Good now, sit down, and tell me, he that knows, +Why this same strict and most observant watch +So nightly toils the subject of the land; +And why such daily cast of brazen cannon, +And foreign mart for implements of war; +Why such impress of shipwrights, whose sore task +Does not divide the Sunday from the week; +What might be toward, that this sweaty haste +Doth make the night joint-labourer with the day: +Who is't that can inform me? + +Hor. +That can I; +At least, the whisper goes so. Our last king, +Whose image even but now appear'd to us, +Was, as you know, by Fortinbras of Norway, +Thereto prick'd on by a most emulate pride, +Dar'd to the combat; in which our valiant Hamlet,-- +For so this side of our known world esteem'd him,-- +Did slay this Fortinbras; who, by a seal'd compact, +Well ratified by law and heraldry, +Did forfeit, with his life, all those his lands, +Which he stood seiz'd of, to the conqueror: +Against the which, a moiety competent +Was gaged by our king; which had return'd +To the inheritance of Fortinbras, +Had he been vanquisher; as by the same cov'nant, +And carriage of the article design'd, +His fell to Hamlet. Now, sir, young Fortinbras, +Of unimproved mettle hot and full, +Hath in the skirts of Norway, here and there, +Shark'd up a list of lawless resolutes, +For food and diet, to some enterprise +That hath a stomach in't; which is no other,-- +As it doth well appear unto our state,-- +But to recover of us, by strong hand, +And terms compulsatory, those foresaid lands +So by his father lost: and this, I take it, +Is the main motive of our preparations, +The source of this our watch, and the chief head +Of this post-haste and romage in the land. + +Ber. +I think it be no other but e'en so: +Well may it sort, that this portentous figure +Comes armed through our watch; so like the king +That was and is the question of these wars. + +Hor. +A mote it is to trouble the mind's eye. +In the most high and palmy state of Rome, +A little ere the mightiest Julius fell, +The graves stood tenantless, and the sheeted dead +Did squeak and gibber in the Roman streets; +As, stars with trains of fire and dews of blood, +Disasters in the sun; and the moist star, +Upon whose influence Neptune's empire stands, +Was sick almost to doomsday with eclipse: +And even the like precurse of fierce events,-- +As harbingers preceding still the fates, +And prologue to the omen coming on,-- +Have heaven and earth together demonstrated +Unto our climature and countrymen.-- +But, soft, behold! lo, where it comes again! + +[Re-enter Ghost.] + +I'll cross it, though it blast me.--Stay, illusion! +If thou hast any sound, or use of voice, +Speak to me: +If there be any good thing to be done, +That may to thee do ease, and, race to me, +Speak to me: +If thou art privy to thy country's fate, +Which, happily, foreknowing may avoid, +O, speak! +Or if thou hast uphoarded in thy life +Extorted treasure in the womb of earth, +For which, they say, you spirits oft walk in death, +[The cock crows.] +Speak of it:--stay, and speak!--Stop it, Marcellus! + +Mar. +Shall I strike at it with my partisan? + +Hor. +Do, if it will not stand. + +Ber. +'Tis here! + +Hor. +'Tis here! + +Mar. +'Tis gone! + +[Exit Ghost.] + +We do it wrong, being so majestical, +To offer it the show of violence; +For it is, as the air, invulnerable, +And our vain blows malicious mockery. + +Ber. +It was about to speak, when the cock crew. + +Hor. +And then it started, like a guilty thing +Upon a fearful summons. I have heard +The cock, that is the trumpet to the morn, +Doth with his lofty and shrill-sounding throat +Awake the god of day; and at his warning, +Whether in sea or fire, in earth or air, +The extravagant and erring spirit hies +To his confine: and of the truth herein +This present object made probation. + +Mar. +It faded on the crowing of the cock. +Some say that ever 'gainst that season comes +Wherein our Saviour's birth is celebrated, +The bird of dawning singeth all night long; +And then, they say, no spirit dare stir abroad; +The nights are wholesome; then no planets strike, +No fairy takes, nor witch hath power to charm; +So hallow'd and so gracious is the time. + +Hor. +So have I heard, and do in part believe it. +But, look, the morn, in russet mantle clad, +Walks o'er the dew of yon high eastward hill: +Break we our watch up: and by my advice, +Let us impart what we have seen to-night +Unto young Hamlet; for, upon my life, +This spirit, dumb to us, will speak to him: +Do you consent we shall acquaint him with it, +As needful in our loves, fitting our duty? + +Mar. +Let's do't, I pray; and I this morning know +Where we shall find him most conveniently. + +[Exeunt.] + + + +Scene II. Elsinore. A room of state in the Castle. + +[Enter the King, Queen, Hamlet, Polonius, Laertes, Voltimand, +Cornelius, Lords, and Attendant.] + +King. +Though yet of Hamlet our dear brother's death +The memory be green, and that it us befitted +To bear our hearts in grief, and our whole kingdom +To be contracted in one brow of woe; +Yet so far hath discretion fought with nature +That we with wisest sorrow think on him, +Together with remembrance of ourselves. +Therefore our sometime sister, now our queen, +Th' imperial jointress to this warlike state, +Have we, as 'twere with a defeated joy,-- +With an auspicious and one dropping eye, +With mirth in funeral, and with dirge in marriage, +In equal scale weighing delight and dole,-- +Taken to wife; nor have we herein barr'd +Your better wisdoms, which have freely gone +With this affair along:--or all, our thanks. +Now follows, that you know, young Fortinbras, +Holding a weak supposal of our worth, +Or thinking by our late dear brother's death +Our state to be disjoint and out of frame, +Colleagued with this dream of his advantage, +He hath not fail'd to pester us with message, +Importing the surrender of those lands +Lost by his father, with all bonds of law, +To our most valiant brother. So much for him,-- +Now for ourself and for this time of meeting: +Thus much the business is:--we have here writ +To Norway, uncle of young Fortinbras,-- +Who, impotent and bed-rid, scarcely hears +Of this his nephew's purpose,--to suppress +His further gait herein; in that the levies, +The lists, and full proportions are all made +Out of his subject:--and we here dispatch +You, good Cornelius, and you, Voltimand, +For bearers of this greeting to old Norway; +Giving to you no further personal power +To business with the king, more than the scope +Of these dilated articles allow. +Farewell; and let your haste commend your duty. + +Cor. and Volt. +In that and all things will we show our duty. + +King. +We doubt it nothing: heartily farewell. + +[Exeunt Voltimand and Cornelius.] + +And now, Laertes, what's the news with you? +You told us of some suit; what is't, Laertes? +You cannot speak of reason to the Dane, +And lose your voice: what wouldst thou beg, Laertes, +That shall not be my offer, not thy asking? +The head is not more native to the heart, +The hand more instrumental to the mouth, +Than is the throne of Denmark to thy father. +What wouldst thou have, Laertes? + +Laer. +Dread my lord, +Your leave and favour to return to France; +From whence though willingly I came to Denmark, +To show my duty in your coronation; +Yet now, I must confess, that duty done, +My thoughts and wishes bend again toward France, +And bow them to your gracious leave and pardon. + +King. +Have you your father's leave? What says Polonius? + +Pol. +He hath, my lord, wrung from me my slow leave +By laboursome petition; and at last +Upon his will I seal'd my hard consent: +I do beseech you, give him leave to go. + +King. +Take thy fair hour, Laertes; time be thine, +And thy best graces spend it at thy will!-- +But now, my cousin Hamlet, and my son-- + +Ham. +[Aside.] A little more than kin, and less than kind! + +King. +How is it that the clouds still hang on you? + +Ham. +Not so, my lord; I am too much i' the sun. + +Queen. +Good Hamlet, cast thy nighted colour off, +And let thine eye look like a friend on Denmark. +Do not for ever with thy vailed lids +Seek for thy noble father in the dust: +Thou know'st 'tis common,--all that lives must die, +Passing through nature to eternity. + +Ham. +Ay, madam, it is common. + +Queen. +If it be, +Why seems it so particular with thee? + +Ham. +Seems, madam! Nay, it is; I know not seems. +'Tis not alone my inky cloak, good mother, +Nor customary suits of solemn black, +Nor windy suspiration of forc'd breath, +No, nor the fruitful river in the eye, +Nor the dejected 'havior of the visage, +Together with all forms, moods, shows of grief, +That can denote me truly: these, indeed, seem; +For they are actions that a man might play; +But I have that within which passeth show; +These but the trappings and the suits of woe. + +King. +'Tis sweet and commendable in your nature, Hamlet, +To give these mourning duties to your father; +But, you must know, your father lost a father; +That father lost, lost his; and the survivor bound, +In filial obligation, for some term +To do obsequious sorrow: but to persevere +In obstinate condolement is a course +Of impious stubbornness; 'tis unmanly grief; +It shows a will most incorrect to heaven; +A heart unfortified, a mind impatient; +An understanding simple and unschool'd; +For what we know must be, and is as common +As any the most vulgar thing to sense, +Why should we, in our peevish opposition, +Take it to heart? Fie! 'tis a fault to heaven, +A fault against the dead, a fault to nature, +To reason most absurd; whose common theme +Is death of fathers, and who still hath cried, +From the first corse till he that died to-day, +'This must be so.' We pray you, throw to earth +This unprevailing woe; and think of us +As of a father: for let the world take note +You are the most immediate to our throne; +And with no less nobility of love +Than that which dearest father bears his son +Do I impart toward you. For your intent +In going back to school in Wittenberg, +It is most retrograde to our desire: +And we beseech you bend you to remain +Here in the cheer and comfort of our eye, +Our chiefest courtier, cousin, and our son. + +Queen. +Let not thy mother lose her prayers, Hamlet: +I pray thee stay with us; go not to Wittenberg. + +Ham. +I shall in all my best obey you, madam. + +King. +Why, 'tis a loving and a fair reply: +Be as ourself in Denmark.--Madam, come; +This gentle and unforc'd accord of Hamlet +Sits smiling to my heart: in grace whereof, +No jocund health that Denmark drinks to-day +But the great cannon to the clouds shall tell; +And the king's rouse the heaven shall bruit again, +Re-speaking earthly thunder. Come away. + +[Exeunt all but Hamlet.] + +Ham. +O that this too too solid flesh would melt, +Thaw, and resolve itself into a dew! +Or that the Everlasting had not fix'd +His canon 'gainst self-slaughter! O God! O God! +How weary, stale, flat, and unprofitable +Seem to me all the uses of this world! +Fie on't! O fie! 'tis an unweeded garden, +That grows to seed; things rank and gross in nature +Possess it merely. That it should come to this! +But two months dead!--nay, not so much, not two: +So excellent a king; that was, to this, +Hyperion to a satyr; so loving to my mother, +That he might not beteem the winds of heaven +Visit her face too roughly. Heaven and earth! +Must I remember? Why, she would hang on him +As if increase of appetite had grown +By what it fed on: and yet, within a month,-- +Let me not think on't,--Frailty, thy name is woman!-- +A little month; or ere those shoes were old +With which she followed my poor father's body +Like Niobe, all tears;--why she, even she,-- +O God! a beast that wants discourse of reason, +Would have mourn'd longer,--married with mine uncle, +My father's brother; but no more like my father +Than I to Hercules: within a month; +Ere yet the salt of most unrighteous tears +Had left the flushing in her galled eyes, +She married:-- O, most wicked speed, to post +With such dexterity to incestuous sheets! +It is not, nor it cannot come to good; +But break my heart,--for I must hold my tongue! + +[Enter Horatio, Marcellus, and Bernardo.] + +Hor. +Hail to your lordship! + +Ham. +I am glad to see you well: +Horatio,--or I do forget myself. + +Hor. +The same, my lord, and your poor servant ever. + +Ham. +Sir, my good friend; I'll change that name with you: +And what make you from Wittenberg, Horatio?-- +Marcellus? + +Mar. +My good lord,-- + +Ham. +I am very glad to see you.--Good even, sir.-- +But what, in faith, make you from Wittenberg? + +Hor. +A truant disposition, good my lord. + +Ham. +I would not hear your enemy say so; +Nor shall you do my ear that violence, +To make it truster of your own report +Against yourself: I know you are no truant. +But what is your affair in Elsinore? +We'll teach you to drink deep ere you depart. + +Hor. +My lord, I came to see your father's funeral. + +Ham. +I prithee do not mock me, fellow-student. +I think it was to see my mother's wedding. + +Hor. +Indeed, my lord, it follow'd hard upon. + +Ham. +Thrift, thrift, Horatio! The funeral bak'd meats +Did coldly furnish forth the marriage tables. +Would I had met my dearest foe in heaven +Or ever I had seen that day, Horatio!-- +My father,--methinks I see my father. + +Hor. +Where, my lord? + +Ham. +In my mind's eye, Horatio. + +Hor. +I saw him once; he was a goodly king. + +Ham. +He was a man, take him for all in all, +I shall not look upon his like again. + +Hor. +My lord, I think I saw him yesternight. + +Ham. +Saw who? + +Hor. +My lord, the king your father. + +Ham. +The King my father! + +Hor. +Season your admiration for awhile +With an attent ear, till I may deliver, +Upon the witness of these gentlemen, +This marvel to you. + +Ham. +For God's love let me hear. + +Hor. +Two nights together had these gentlemen, +Marcellus and Bernardo, on their watch +In the dead vast and middle of the night, +Been thus encounter'd. A figure like your father, +Armed at point exactly, cap-a-pe, +Appears before them and with solemn march +Goes slow and stately by them: thrice he walk'd +By their oppress'd and fear-surprised eyes, +Within his truncheon's length; whilst they, distill'd +Almost to jelly with the act of fear, +Stand dumb, and speak not to him. This to me +In dreadful secrecy impart they did; +And I with them the third night kept the watch: +Where, as they had deliver'd, both in time, +Form of the thing, each word made true and good, +The apparition comes: I knew your father; +These hands are not more like. + +Ham. +But where was this? + +Mar. +My lord, upon the platform where we watch'd. + +Ham. +Did you not speak to it? + +Hor. +My lord, I did; +But answer made it none: yet once methought +It lifted up it head, and did address +Itself to motion, like as it would speak: +But even then the morning cock crew loud, +And at the sound it shrunk in haste away, +And vanish'd from our sight. + +Ham. +'Tis very strange. + +Hor. +As I do live, my honour'd lord, 'tis true; +And we did think it writ down in our duty +To let you know of it. + +Ham. +Indeed, indeed, sirs, but this troubles me. +Hold you the watch to-night? + +Mar. and Ber. +We do, my lord. + +Ham. +Arm'd, say you? + +Both. +Arm'd, my lord. + +Ham. +From top to toe? + +Both. +My lord, from head to foot. + +Ham. +Then saw you not his face? + +Hor. +O, yes, my lord: he wore his beaver up. + +Ham. +What, look'd he frowningly? + +Hor. +A countenance more in sorrow than in anger. + +Ham. +Pale or red? + +Hor. +Nay, very pale. + +Ham. +And fix'd his eyes upon you? + +Hor. +Most constantly. + +Ham. +I would I had been there. + +Hor. +It would have much amaz'd you. + +Ham. +Very like, very like. Stay'd it long? + +Hor. +While one with moderate haste might tell a hundred. + +Mar. and Ber. +Longer, longer. + +Hor. +Not when I saw't. + +Ham. +His beard was grizzled,--no? + +Hor. +It was, as I have seen it in his life, +A sable silver'd. + +Ham. +I will watch to-night; +Perchance 'twill walk again. + +Hor. +I warr'nt it will. + +Ham. +If it assume my noble father's person, +I'll speak to it, though hell itself should gape +And bid me hold my peace. I pray you all, +If you have hitherto conceal'd this sight, +Let it be tenable in your silence still; +And whatsoever else shall hap to-night, +Give it an understanding, but no tongue: +I will requite your loves. So, fare ye well: +Upon the platform, 'twixt eleven and twelve, +I'll visit you. + +All. +Our duty to your honour. + +Ham. +Your loves, as mine to you: farewell. + +[Exeunt Horatio, Marcellus, and Bernardo.] + +My father's spirit in arms! All is not well; +I doubt some foul play: would the night were come! +Till then sit still, my soul: foul deeds will rise, +Though all the earth o'erwhelm them, to men's eyes. + +[Exit.] + + + +Scene III. A room in Polonius's house. + +[Enter Laertes and Ophelia.] + +Laer. +My necessaries are embark'd: farewell: +And, sister, as the winds give benefit +And convoy is assistant, do not sleep, +But let me hear from you. + +Oph. +Do you doubt that? + +Laer. +For Hamlet, and the trifling of his favour, +Hold it a fashion, and a toy in blood: +A violet in the youth of primy nature, +Forward, not permanent, sweet, not lasting; +The perfume and suppliance of a minute; +No more. + +Oph. +No more but so? + +Laer. +Think it no more: +For nature, crescent, does not grow alone +In thews and bulk; but as this temple waxes, +The inward service of the mind and soul +Grows wide withal. Perhaps he loves you now; +And now no soil nor cautel doth besmirch +The virtue of his will: but you must fear, +His greatness weigh'd, his will is not his own; +For he himself is subject to his birth: +He may not, as unvalu'd persons do, +Carve for himself; for on his choice depends +The safety and health of this whole state; +And therefore must his choice be circumscrib'd +Unto the voice and yielding of that body +Whereof he is the head. Then if he says he loves you, +It fits your wisdom so far to believe it +As he in his particular act and place +May give his saying deed; which is no further +Than the main voice of Denmark goes withal. +Then weigh what loss your honour may sustain +If with too credent ear you list his songs, +Or lose your heart, or your chaste treasure open +To his unmaster'd importunity. +Fear it, Ophelia, fear it, my dear sister; +And keep you in the rear of your affection, +Out of the shot and danger of desire. +The chariest maid is prodigal enough +If she unmask her beauty to the moon: +Virtue itself scopes not calumnious strokes: +The canker galls the infants of the spring +Too oft before their buttons be disclos'd: +And in the morn and liquid dew of youth +Contagious blastments are most imminent. +Be wary then; best safety lies in fear: +Youth to itself rebels, though none else near. + +Oph. +I shall th' effect of this good lesson keep +As watchman to my heart. But, good my brother, +Do not, as some ungracious pastors do, +Show me the steep and thorny way to heaven; +Whilst, like a puff'd and reckless libertine, +Himself the primrose path of dalliance treads +And recks not his own read. + +Laer. +O, fear me not. +I stay too long:--but here my father comes. + +[Enter Polonius.] + +A double blessing is a double grace; +Occasion smiles upon a second leave. + +Pol. +Yet here, Laertes! aboard, aboard, for shame! +The wind sits in the shoulder of your sail, +And you are stay'd for. There,--my blessing with thee! + +[Laying his hand on Laertes's head.] + +And these few precepts in thy memory +Look thou character. Give thy thoughts no tongue, +Nor any unproportion'd thought his act. +Be thou familiar, but by no means vulgar. +Those friends thou hast, and their adoption tried, +Grapple them unto thy soul with hoops of steel; +But do not dull thy palm with entertainment +Of each new-hatch'd, unfledg'd comrade. Beware +Of entrance to a quarrel; but, being in, +Bear't that the opposed may beware of thee. +Give every man thine ear, but few thy voice: +Take each man's censure, but reserve thy judgment. +Costly thy habit as thy purse can buy, +But not express'd in fancy; rich, not gaudy: +For the apparel oft proclaims the man; +And they in France of the best rank and station +Are most select and generous chief in that. +Neither a borrower nor a lender be: +For loan oft loses both itself and friend; +And borrowing dulls the edge of husbandry. +This above all,--to thine own self be true; +And it must follow, as the night the day, +Thou canst not then be false to any man. +Farewell: my blessing season this in thee! + +Laer. +Most humbly do I take my leave, my lord. + +Pol. +The time invites you; go, your servants tend. + +Laer. +Farewell, Ophelia; and remember well +What I have said to you. + +Oph. +'Tis in my memory lock'd, +And you yourself shall keep the key of it. + +Laer. +Farewell. + +[Exit.] + +Pol. +What is't, Ophelia, he hath said to you? + +Oph. +So please you, something touching the Lord Hamlet. + +Pol. +Marry, well bethought: +'Tis told me he hath very oft of late +Given private time to you; and you yourself +Have of your audience been most free and bounteous; +If it be so,--as so 'tis put on me, +And that in way of caution,--I must tell you +You do not understand yourself so clearly +As it behooves my daughter and your honour. +What is between you? give me up the truth. + +Oph. +He hath, my lord, of late made many tenders +Of his affection to me. + +Pol. +Affection! pooh! you speak like a green girl, +Unsifted in such perilous circumstance. +Do you believe his tenders, as you call them? + +Oph. +I do not know, my lord, what I should think. + +Pol. +Marry, I'll teach you: think yourself a baby; +That you have ta'en these tenders for true pay, +Which are not sterling. Tender yourself more dearly; +Or,--not to crack the wind of the poor phrase, +Wronging it thus,--you'll tender me a fool. + +Oph. +My lord, he hath importun'd me with love +In honourable fashion. + +Pol. +Ay, fashion you may call it; go to, go to. + +Oph. +And hath given countenance to his speech, my lord, +With almost all the holy vows of heaven. + +Pol. +Ay, springes to catch woodcocks. I do know, +When the blood burns, how prodigal the soul +Lends the tongue vows: these blazes, daughter, +Giving more light than heat,--extinct in both, +Even in their promise, as it is a-making,-- +You must not take for fire. From this time +Be something scanter of your maiden presence; +Set your entreatments at a higher rate +Than a command to parley. For Lord Hamlet, +Believe so much in him, that he is young; +And with a larger tether may he walk +Than may be given you: in few, Ophelia, +Do not believe his vows; for they are brokers,-- +Not of that dye which their investments show, +But mere implorators of unholy suits, +Breathing like sanctified and pious bawds, +The better to beguile. This is for all,-- +I would not, in plain terms, from this time forth +Have you so slander any moment leisure +As to give words or talk with the Lord Hamlet. +Look to't, I charge you; come your ways. + +Oph. +I shall obey, my lord. + +[Exeunt.] + + + +Scene IV. The platform. + +[Enter Hamlet, Horatio, and Marcellus.] + +Ham. +The air bites shrewdly; it is very cold. + +Hor. +It is a nipping and an eager air. + +Ham. +What hour now? + +Hor. +I think it lacks of twelve. + +Mar. +No, it is struck. + +Hor. +Indeed? I heard it not: then draws near the season +Wherein the spirit held his wont to walk. + +[A flourish of trumpets, and ordnance shot off within.] + +What does this mean, my lord? + +Ham. +The King doth wake to-night and takes his rouse, +Keeps wassail, and the swaggering up-spring reels; +And, as he drains his draughts of Rhenish down, +The kettle-drum and trumpet thus bray out +The triumph of his pledge. + +Hor. +Is it a custom? + +Ham. +Ay, marry, is't; +But to my mind,--though I am native here, +And to the manner born,--it is a custom +More honour'd in the breach than the observance. +This heavy-headed revel east and west +Makes us traduc'd and tax'd of other nations: +They clepe us drunkards, and with swinish phrase +Soil our addition; and, indeed, it takes +From our achievements, though perform'd at height, +The pith and marrow of our attribute. +So oft it chances in particular men +That, for some vicious mole of nature in them, +As in their birth,--wherein they are not guilty, +Since nature cannot choose his origin,-- +By the o'ergrowth of some complexion, +Oft breaking down the pales and forts of reason; +Or by some habit, that too much o'er-leavens +The form of plausive manners;--that these men,-- +Carrying, I say, the stamp of one defect, +Being nature's livery, or fortune's star,-- +Their virtues else,--be they as pure as grace, +As infinite as man may undergo,-- +Shall in the general censure take corruption +From that particular fault: the dram of eale +Doth all the noble substance often doubt +To his own scandal. + +Hor. +Look, my lord, it comes! + +[Enter Ghost.] + +Ham. +Angels and ministers of grace defend us!-- +Be thou a spirit of health or goblin damn'd, +Bring with thee airs from heaven or blasts from hell, +Be thy intents wicked or charitable, +Thou com'st in such a questionable shape +That I will speak to thee: I'll call thee Hamlet, +King, father, royal Dane; O, answer me! +Let me not burst in ignorance; but tell +Why thy canoniz'd bones, hearsed in death, +Have burst their cerements; why the sepulchre, +Wherein we saw thee quietly in-urn'd, +Hath op'd his ponderous and marble jaws +To cast thee up again! What may this mean, +That thou, dead corse, again in complete steel, +Revisit'st thus the glimpses of the moon, +Making night hideous, and we fools of nature +So horridly to shake our disposition +With thoughts beyond the reaches of our souls? +Say, why is this? wherefore? what should we do? + +[Ghost beckons Hamlet.] + +Hor. +It beckons you to go away with it, +As if it some impartment did desire +To you alone. + +Mar. +Look with what courteous action +It waves you to a more removed ground: +But do not go with it! + +Hor. +No, by no means. + +Ham. +It will not speak; then will I follow it. + +Hor. +Do not, my lord. + +Ham. +Why, what should be the fear? +I do not set my life at a pin's fee; +And for my soul, what can it do to that, +Being a thing immortal as itself? +It waves me forth again;--I'll follow it. + +Hor. +What if it tempt you toward the flood, my lord, +Or to the dreadful summit of the cliff +That beetles o'er his base into the sea, +And there assume some other horrible form +Which might deprive your sovereignty of reason, +And draw you into madness? think of it: +The very place puts toys of desperation, +Without more motive, into every brain +That looks so many fadoms to the sea +And hears it roar beneath. + +Ham. +It waves me still.-- +Go on; I'll follow thee. + +Mar. +You shall not go, my lord. + +Ham. +Hold off your hands. + +Hor. +Be rul'd; you shall not go. + +Ham. +My fate cries out, +And makes each petty artery in this body +As hardy as the Nemean lion's nerve.-- + +[Ghost beckons.] + +Still am I call'd;--unhand me, gentlemen;-- + +[Breaking free from them.] + +By heaven, I'll make a ghost of him that lets me!-- +I say, away!--Go on; I'll follow thee. + +[Exeunt Ghost and Hamlet.] + +Hor. +He waxes desperate with imagination. + +Mar. +Let's follow; 'tis not fit thus to obey him. + +Hor. +Have after.--To what issue will this come? + +Mar. +Something is rotten in the state of Denmark. + +Hor. +Heaven will direct it. + +Mar. +Nay, let's follow him. + +[Exeunt.] + + + +Scene V. A more remote part of the Castle. + +[Enter Ghost and Hamlet.] + +Ham. +Whither wilt thou lead me? speak! I'll go no further. + +Ghost. +Mark me. + +Ham. +I will. + +Ghost. +My hour is almost come, +When I to sulph'uous and tormenting flames +Must render up myself. + +Ham. +Alas, poor ghost! + +Ghost. +Pity me not, but lend thy serious hearing +To what I shall unfold. + +Ham. +Speak; I am bound to hear. + +Ghost. +So art thou to revenge, when thou shalt hear. + +Ham. +What? + +Ghost. +I am thy father's spirit; +Doom'd for a certain term to walk the night, +And for the day confin'd to wastein fires, +Till the foul crimes done in my days of nature +Are burnt and purg'd away. But that I am forbid +To tell the secrets of my prison-house, +I could a tale unfold whose lightest word +Would harrow up thy soul; freeze thy young blood; +Make thy two eyes, like stars, start from their spheres; +Thy knotted and combined locks to part, +And each particular hair to stand on end +Like quills upon the fretful porcupine: +But this eternal blazon must not be +To ears of flesh and blood.--List, list, O, list!-- +If thou didst ever thy dear father love-- + +Ham. +O God! + +Ghost. +Revenge his foul and most unnatural murder. + +Ham. +Murder! + +Ghost. +Murder most foul, as in the best it is; +But this most foul, strange, and unnatural. + +Ham. +Haste me to know't, that I, with wings as swift +As meditation or the thoughts of love, +May sweep to my revenge. + +Ghost. +I find thee apt; +And duller shouldst thou be than the fat weed +That rots itself in ease on Lethe wharf, +Wouldst thou not stir in this. Now, Hamlet, hear. +'Tis given out that, sleeping in my orchard, +A serpent stung me; so the whole ear of Denmark +Is by a forged process of my death +Rankly abus'd; but know, thou noble youth, +The serpent that did sting thy father's life +Now wears his crown. + +Ham. +O my prophetic soul! +Mine uncle! + +Ghost. +Ay, that incestuous, that adulterate beast, +With witchcraft of his wit, with traitorous gifts,-- +O wicked wit and gifts, that have the power +So to seduce!--won to his shameful lust +The will of my most seeming-virtuous queen: +O Hamlet, what a falling-off was there! +From me, whose love was of that dignity +That it went hand in hand even with the vow +I made to her in marriage; and to decline +Upon a wretch whose natural gifts were poor +To those of mine! +But virtue, as it never will be mov'd, +Though lewdness court it in a shape of heaven; +So lust, though to a radiant angel link'd, +Will sate itself in a celestial bed +And prey on garbage. +But soft! methinks I scent the morning air; +Brief let me be.--Sleeping within my orchard, +My custom always of the afternoon, +Upon my secure hour thy uncle stole, +With juice of cursed hebenon in a vial, +And in the porches of my ears did pour +The leperous distilment; whose effect +Holds such an enmity with blood of man +That, swift as quicksilver, it courses through +The natural gates and alleys of the body; +And with a sudden vigour it doth posset +And curd, like eager droppings into milk, +The thin and wholesome blood; so did it mine; +And a most instant tetter bark'd about, +Most lazar-like, with vile and loathsome crust +All my smooth body. +Thus was I, sleeping, by a brother's hand, +Of life, of crown, of queen, at once dispatch'd: +Cut off even in the blossoms of my sin, +Unhous'led, disappointed, unanel'd; +No reckoning made, but sent to my account +With all my imperfections on my head: +O, horrible! O, horrible! most horrible! +If thou hast nature in thee, bear it not; +Let not the royal bed of Denmark be +A couch for luxury and damned incest. +But, howsoever thou pursu'st this act, +Taint not thy mind, nor let thy soul contrive +Against thy mother aught: leave her to heaven, +And to those thorns that in her bosom lodge, +To prick and sting her. Fare thee well at once! +The glowworm shows the matin to be near, +And 'gins to pale his uneffectual fire: +Adieu, adieu! Hamlet, remember me. + +[Exit.] + +Ham. +O all you host of heaven! O earth! what else? +And shall I couple hell? O, fie!--Hold, my heart; +And you, my sinews, grow not instant old, +But bear me stiffly up.--Remember thee! +Ay, thou poor ghost, while memory holds a seat +In this distracted globe. Remember thee! +Yea, from the table of my memory +I'll wipe away all trivial fond records, +All saws of books, all forms, all pressures past, +That youth and observation copied there; +And thy commandment all alone shall live +Within the book and volume of my brain, +Unmix'd with baser matter: yes, by heaven!-- +O most pernicious woman! +O villain, villain, smiling, damned villain! +My tables,--meet it is I set it down, +That one may smile, and smile, and be a villain; +At least, I am sure, it may be so in Denmark: + +[Writing.] + +So, uncle, there you are. Now to my word; +It is 'Adieu, adieu! remember me:' +I have sworn't. + +Hor. +[Within.] My lord, my lord,-- + +Mar. +[Within.] Lord Hamlet,-- + +Hor. +[Within.] Heaven secure him! + +Ham. +So be it! + +Mar. +[Within.] Illo, ho, ho, my lord! + +Ham. +Hillo, ho, ho, boy! Come, bird, come. + +[Enter Horatio and Marcellus.] + +Mar. +How is't, my noble lord? + +Hor. +What news, my lord? + +Ham. +O, wonderful! + +Hor. +Good my lord, tell it. + +Ham. +No; you'll reveal it. + +Hor. +Not I, my lord, by heaven. + +Mar. +Nor I, my lord. + +Ham. +How say you then; would heart of man once think it?-- +But you'll be secret? + +Hor. and Mar. +Ay, by heaven, my lord. + +Ham. +There's ne'er a villain dwelling in all Denmark +But he's an arrant knave. + +Hor. +There needs no ghost, my lord, come from the grave +To tell us this. + +Ham. +Why, right; you are i' the right; +And so, without more circumstance at all, +I hold it fit that we shake hands and part: +You, as your business and desires shall point you,-- +For every man hath business and desire, +Such as it is;--and for my own poor part, +Look you, I'll go pray. + +Hor. +These are but wild and whirling words, my lord. + +Ham. +I'm sorry they offend you, heartily; +Yes, faith, heartily. + +Hor. +There's no offence, my lord. + +Ham. +Yes, by Saint Patrick, but there is, Horatio, +And much offence too. Touching this vision here,-- +It is an honest ghost, that let me tell you: +For your desire to know what is between us, +O'ermaster't as you may. And now, good friends, +As you are friends, scholars, and soldiers, +Give me one poor request. + +Hor. +What is't, my lord? we will. + +Ham. +Never make known what you have seen to-night. + +Hor. and Mar. +My lord, we will not. + +Ham. +Nay, but swear't. + +Hor. +In faith, +My lord, not I. + +Mar. +Nor I, my lord, in faith. + +Ham. +Upon my sword. + +Mar. +We have sworn, my lord, already. + +Ham. +Indeed, upon my sword, indeed. + +Ghost. +[Beneath.] Swear. + +Ham. +Ha, ha boy! say'st thou so? art thou there, truepenny?-- +Come on!--you hear this fellow in the cellarage,-- +Consent to swear. + +Hor. +Propose the oath, my lord. + +Ham. +Never to speak of this that you have seen, +Swear by my sword. + +Ghost. +[Beneath.] Swear. + +Ham. +Hic et ubique? then we'll shift our ground.-- +Come hither, gentlemen, +And lay your hands again upon my sword: +Never to speak of this that you have heard, +Swear by my sword. + +Ghost. +[Beneath.] Swear. + +Ham. +Well said, old mole! canst work i' the earth so fast? +A worthy pioner!--Once more remove, good friends. + +Hor. +O day and night, but this is wondrous strange! + +Ham. +And therefore as a stranger give it welcome. +There are more things in heaven and earth, Horatio, +Than are dreamt of in your philosophy. +But come;-- +Here, as before, never, so help you mercy, +How strange or odd soe'er I bear myself,-- +As I, perchance, hereafter shall think meet +To put an antic disposition on,-- +That you, at such times seeing me, never shall, +With arms encumber'd thus, or this head-shake, +Or by pronouncing of some doubtful phrase, +As 'Well, well, we know'; or 'We could, an if we would';-- +Or 'If we list to speak'; or 'There be, an if they might';-- +Or such ambiguous giving out, to note +That you know aught of me:--this is not to do, +So grace and mercy at your most need help you, +Swear. + +Ghost. +[Beneath.] Swear. + +Ham. +Rest, rest, perturbed spirit!--So, gentlemen, +With all my love I do commend me to you: +And what so poor a man as Hamlet is +May do, to express his love and friending to you, +God willing, shall not lack. Let us go in together; +And still your fingers on your lips, I pray. +The time is out of joint:--O cursed spite, +That ever I was born to set it right!-- +Nay, come, let's go together. + +[Exeunt.] + + + +Act II. + +Scene I. A room in Polonius's house. + +[Enter Polonius and Reynaldo.] + +Pol. +Give him this money and these notes, Reynaldo. + +Rey. +I will, my lord. + +Pol. +You shall do marvellous wisely, good Reynaldo, +Before You visit him, to make inquiry +Of his behaviour. + +Rey. +My lord, I did intend it. + +Pol. +Marry, well said; very well said. Look you, sir, +Enquire me first what Danskers are in Paris; +And how, and who, what means, and where they keep, +What company, at what expense; and finding, +By this encompassment and drift of question, +That they do know my son, come you more nearer +Than your particular demands will touch it: +Take you, as 'twere, some distant knowledge of him; +As thus, 'I know his father and his friends, +And in part him;--do you mark this, Reynaldo? + +Rey. +Ay, very well, my lord. + +Pol. +'And in part him;--but,' you may say, 'not well: +But if't be he I mean, he's very wild; +Addicted so and so;' and there put on him +What forgeries you please; marry, none so rank +As may dishonour him; take heed of that; +But, sir, such wanton, wild, and usual slips +As are companions noted and most known +To youth and liberty. + +Rey. +As gaming, my lord. + +Pol. +Ay, or drinking, fencing, swearing, quarrelling, +Drabbing:--you may go so far. + +Rey. +My lord, that would dishonour him. + +Pol. +Faith, no; as you may season it in the charge. +You must not put another scandal on him, +That he is open to incontinency; +That's not my meaning: but breathe his faults so quaintly +That they may seem the taints of liberty; +The flash and outbreak of a fiery mind; +A savageness in unreclaimed blood, +Of general assault. + +Rey. +But, my good lord,-- + +Pol. +Wherefore should you do this? + +Rey. +Ay, my lord, +I would know that. + +Pol. +Marry, sir, here's my drift; +And I believe it is a fetch of warrant: +You laying these slight sullies on my son +As 'twere a thing a little soil'd i' the working, +Mark you, +Your party in converse, him you would sound, +Having ever seen in the prenominate crimes +The youth you breathe of guilty, be assur'd +He closes with you in this consequence; +'Good sir,' or so; or 'friend,' or 'gentleman'-- +According to the phrase or the addition +Of man and country. + +Rey. +Very good, my lord. + +Pol. +And then, sir, does he this,--he does--What was I about to say?-- +By the mass, I was about to say something:--Where did I leave? + +Rey. +At 'closes in the consequence,' at 'friend or so,' and +gentleman.' + +Pol. +At--closes in the consequence'--ay, marry! +He closes with you thus:--'I know the gentleman; +I saw him yesterday, or t'other day, +Or then, or then; with such, or such; and, as you say, +There was he gaming; there o'ertook in's rouse; +There falling out at tennis': or perchance, +'I saw him enter such a house of sale,'-- +Videlicet, a brothel,--or so forth.-- +See you now; +Your bait of falsehood takes this carp of truth: +And thus do we of wisdom and of reach, +With windlaces, and with assays of bias, +By indirections find directions out: +So, by my former lecture and advice, +Shall you my son. You have me, have you not? + +Rey. +My lord, I have. + +Pol. +God b' wi' you, fare you well. + +Rey. +Good my lord! + +Pol. +Observe his inclination in yourself. + +Rey. +I shall, my lord. + +Pol. +And let him ply his music. + +Rey. +Well, my lord. + +Pol. +Farewell! + +[Exit Reynaldo.] + +[Enter Ophelia.] + +How now, Ophelia! what's the matter? + +Oph. +Alas, my lord, I have been so affrighted! + +Pol. +With what, i' the name of God? + +Oph. +My lord, as I was sewing in my chamber, +Lord Hamlet,--with his doublet all unbrac'd; +No hat upon his head; his stockings foul'd, +Ungart'red, and down-gyved to his ankle; +Pale as his shirt; his knees knocking each other; +And with a look so piteous in purport +As if he had been loosed out of hell +To speak of horrors,--he comes before me. + +Pol. +Mad for thy love? + +Oph. +My lord, I do not know; +But truly I do fear it. + +Pol. +What said he? + +Oph. +He took me by the wrist, and held me hard; +Then goes he to the length of all his arm; +And with his other hand thus o'er his brow, +He falls to such perusal of my face +As he would draw it. Long stay'd he so; +At last,--a little shaking of mine arm, +And thrice his head thus waving up and down,-- +He rais'd a sigh so piteous and profound +As it did seem to shatter all his bulk +And end his being: that done, he lets me go: +And, with his head over his shoulder turn'd +He seem'd to find his way without his eyes; +For out o' doors he went without their help, +And to the last bended their light on me. + +Pol. +Come, go with me: I will go seek the king. +This is the very ecstasy of love; +Whose violent property fordoes itself, +And leads the will to desperate undertakings, +As oft as any passion under heaven +That does afflict our natures. I am sorry,-- +What, have you given him any hard words of late? + +Oph. +No, my good lord; but, as you did command, +I did repel his letters and denied +His access to me. + +Pol. +That hath made him mad. +I am sorry that with better heed and judgment +I had not quoted him: I fear'd he did but trifle, +And meant to wreck thee; but beshrew my jealousy! +It seems it as proper to our age +To cast beyond ourselves in our opinions +As it is common for the younger sort +To lack discretion. Come, go we to the king: +This must be known; which, being kept close, might move +More grief to hide than hate to utter love. + +[Exeunt.] + + + +Scene II. A room in the Castle. + +[Enter King, Rosencrantz, Guildenstern, and Attendants.] + +King. +Welcome, dear Rosencrantz and Guildenstern! +Moreover that we much did long to see you, +The need we have to use you did provoke +Our hasty sending. Something have you heard +Of Hamlet's transformation; so I call it, +Since nor the exterior nor the inward man +Resembles that it was. What it should be, +More than his father's death, that thus hath put him +So much from the understanding of himself, +I cannot dream of: I entreat you both +That, being of so young days brought up with him, +And since so neighbour'd to his youth and humour, +That you vouchsafe your rest here in our court +Some little time: so by your companies +To draw him on to pleasures, and to gather, +So much as from occasion you may glean, +Whether aught, to us unknown, afflicts him thus, +That, open'd, lies within our remedy. + +Queen. +Good gentlemen, he hath much talk'd of you, +And sure I am two men there are not living +To whom he more adheres. If it will please you +To show us so much gentry and good-will +As to expend your time with us awhile, +For the supply and profit of our hope, +Your visitation shall receive such thanks +As fits a king's remembrance. + +Ros. +Both your majesties +Might, by the sovereign power you have of us, +Put your dread pleasures more into command +Than to entreaty. + +Guil. +We both obey, +And here give up ourselves, in the full bent, +To lay our service freely at your feet, +To be commanded. + +King. +Thanks, Rosencrantz and gentle Guildenstern. + +Queen. +Thanks, Guildenstern and gentle Rosencrantz: +And I beseech you instantly to visit +My too-much-changed son.--Go, some of you, +And bring these gentlemen where Hamlet is. + +Guil. +Heavens make our presence and our practices +Pleasant and helpful to him! + +Queen. +Ay, amen! + +[Exeunt Rosencrantz, Guildenstern, and some Attendants]. + +[Enter Polonius.] + +Pol. +Th' ambassadors from Norway, my good lord, +Are joyfully return'd. + +King. +Thou still hast been the father of good news. + +Pol. +Have I, my lord? Assure you, my good liege, +I hold my duty, as I hold my soul, +Both to my God and to my gracious king: +And I do think,--or else this brain of mine +Hunts not the trail of policy so sure +As it hath us'd to do,--that I have found +The very cause of Hamlet's lunacy. + +King. +O, speak of that; that do I long to hear. + +Pol. +Give first admittance to the ambassadors; +My news shall be the fruit to that great feast. + +King. +Thyself do grace to them, and bring them in. + +[Exit Polonius.] + +He tells me, my sweet queen, he hath found +The head and source of all your son's distemper. + +Queen. +I doubt it is no other but the main,-- +His father's death and our o'erhasty marriage. + +King. +Well, we shall sift him. + +[Enter Polonius, with Voltimand and Cornelius.] + +Welcome, my good friends! +Say, Voltimand, what from our brother Norway? + +Volt. +Most fair return of greetings and desires. +Upon our first, he sent out to suppress +His nephew's levies; which to him appear'd +To be a preparation 'gainst the Polack; +But, better look'd into, he truly found +It was against your highness; whereat griev'd,-- +That so his sickness, age, and impotence +Was falsely borne in hand,--sends out arrests +On Fortinbras; which he, in brief, obeys; +Receives rebuke from Norway; and, in fine, +Makes vow before his uncle never more +To give th' assay of arms against your majesty. +Whereon old Norway, overcome with joy, +Gives him three thousand crowns in annual fee; +And his commission to employ those soldiers, +So levied as before, against the Polack: +With an entreaty, herein further shown, +[Gives a paper.] +That it might please you to give quiet pass +Through your dominions for this enterprise, +On such regards of safety and allowance +As therein are set down. + +King. +It likes us well; +And at our more consider'd time we'll read, +Answer, and think upon this business. +Meantime we thank you for your well-took labour: +Go to your rest; at night we'll feast together: +Most welcome home! + +[Exeunt Voltimand and Cornelius.] + +Pol. +This business is well ended.-- +My liege, and madam,--to expostulate +What majesty should be, what duty is, +Why day is day, night is night, and time is time. +Were nothing but to waste night, day, and time. +Therefore, since brevity is the soul of wit, +And tediousness the limbs and outward flourishes, +I will be brief:--your noble son is mad: +Mad call I it; for to define true madness, +What is't but to be nothing else but mad? +But let that go. + +Queen. +More matter, with less art. + +Pol. +Madam, I swear I use no art at all. +That he is mad, 'tis true: 'tis true 'tis pity; +And pity 'tis 'tis true: a foolish figure; +But farewell it, for I will use no art. +Mad let us grant him then: and now remains +That we find out the cause of this effect; +Or rather say, the cause of this defect, +For this effect defective comes by cause: +Thus it remains, and the remainder thus. +Perpend. +I have a daughter,--have whilst she is mine,-- +Who, in her duty and obedience, mark, +Hath given me this: now gather, and surmise. +[Reads.] +'To the celestial, and my soul's idol, the most beautified +Ophelia,'-- +That's an ill phrase, a vile phrase; 'beautified' is a vile +phrase: but you shall hear. Thus: +[Reads.] +'In her excellent white bosom, these, &c.' + +Queen. +Came this from Hamlet to her? + +Pol. +Good madam, stay awhile; I will be faithful. +[Reads.] + 'Doubt thou the stars are fire; + Doubt that the sun doth move; + Doubt truth to be a liar; + But never doubt I love. +'O dear Ophelia, I am ill at these numbers; I have not art to +reckon my groans: but that I love thee best, O most best, believe +it. Adieu. + 'Thine evermore, most dear lady, whilst this machine is to him, + HAMLET.' +This, in obedience, hath my daughter show'd me; +And more above, hath his solicitings, +As they fell out by time, by means, and place, +All given to mine ear. + +King. +But how hath she +Receiv'd his love? + +Pol. +What do you think of me? + +King. +As of a man faithful and honourable. + +Pol. +I would fain prove so. But what might you think, +When I had seen this hot love on the wing,-- +As I perceiv'd it, I must tell you that, +Before my daughter told me,-- what might you, +Or my dear majesty your queen here, think, +If I had play'd the desk or table-book, +Or given my heart a winking, mute and dumb; +Or look'd upon this love with idle sight;-- +What might you think? No, I went round to work, +And my young mistress thus I did bespeak: +'Lord Hamlet is a prince, out of thy sphere; +This must not be:' and then I precepts gave her, +That she should lock herself from his resort, +Admit no messengers, receive no tokens. +Which done, she took the fruits of my advice; +And he, repulsed,--a short tale to make,-- +Fell into a sadness; then into a fast; +Thence to a watch; thence into a weakness; +Thence to a lightness; and, by this declension, +Into the madness wherein now he raves, +And all we wail for. + +King. +Do you think 'tis this? + +Queen. +It may be, very likely. + +Pol. +Hath there been such a time,--I'd fain know that-- +That I have positively said ''Tis so,' +When it prov'd otherwise? + +King. +Not that I know. + +Pol. +Take this from this, if this be otherwise: +[Points to his head and shoulder.] +If circumstances lead me, I will find +Where truth is hid, though it were hid indeed +Within the centre. + +King. +How may we try it further? + +Pol. +You know sometimes he walks for hours together +Here in the lobby. + +Queen. +So he does indeed. + +Pol. +At such a time I'll loose my daughter to him: +Be you and I behind an arras then; +Mark the encounter: if he love her not, +And he not from his reason fall'n thereon +Let me be no assistant for a state, +But keep a farm and carters. + +King. +We will try it. + +Queen. +But look where sadly the poor wretch comes reading. + +Pol. +Away, I do beseech you, both away +I'll board him presently:--O, give me leave. + +[Exeunt King, Queen, and Attendants.] + +[Enter Hamlet, reading.] + +How does my good Lord Hamlet? + +Ham. +Well, God-a-mercy. + +Pol. +Do you know me, my lord? + +Ham. +Excellent well; you're a fishmonger. + +Pol. +Not I, my lord. + +Ham. +Then I would you were so honest a man. + +Pol. +Honest, my lord! + +Ham. +Ay, sir; to be honest, as this world goes, is to be one man +picked out of ten thousand. + +Pol. +That's very true, my lord. + +Ham. +For if the sun breed maggots in a dead dog, being a god-kissing +carrion,--Have you a daughter? + +Pol. +I have, my lord. + +Ham. +Let her not walk i' the sun: conception is a blessing, but not +as your daughter may conceive:--friend, look to't. + +Pol. +How say you by that?--[Aside.] Still harping on my daughter:--yet +he knew me not at first; he said I was a fishmonger: he is far +gone, far gone: and truly in my youth I suffered much extremity +for love; very near this. I'll speak to him again.--What do you +read, my lord? + +Ham. +Words, words, words. + +Pol. +What is the matter, my lord? + +Ham. +Between who? + +Pol. +I mean, the matter that you read, my lord. + +Ham. +Slanders, sir: for the satirical slave says here that old men +have grey beards; that their faces are wrinkled; their eyes +purging thick amber and plum-tree gum; and that they have a +plentiful lack of wit, together with most weak hams: all which, +sir, though I most powerfully and potently believe, yet I hold it +not honesty to have it thus set down; for you yourself, sir, +should be old as I am, if, like a crab, you could go backward. + +Pol. +[Aside.] Though this be madness, yet there is a method in't.-- +Will you walk out of the air, my lord? + +Ham. +Into my grave? + +Pol. +Indeed, that is out o' the air. [Aside.] How pregnant sometimes +his replies are! a happiness that often madness hits on, which +reason and sanity could not so prosperously be delivered of. I +will leave him and suddenly contrive the means of meeting between +him and my daughter.--My honourable lord, I will most humbly take +my leave of you. + +Ham. +You cannot, sir, take from me anything that I will more +willingly part withal,--except my life, except my life, except my +life. + +Pol. +Fare you well, my lord. + +Ham. +These tedious old fools! + +[Enter Rosencrantz and Guildenstern.] + +Pol. +You go to seek the Lord Hamlet; there he is. + +Ros. +[To Polonius.] God save you, sir! + +[Exit Polonius.] + +Guil. +My honoured lord! + +Ros. +My most dear lord! + +Ham. +My excellent good friends! How dost thou, Guildenstern? Ah, +Rosencrantz! Good lads, how do ye both? + +Ros. +As the indifferent children of the earth. + +Guil. +Happy in that we are not over-happy; +On fortune's cap we are not the very button. + +Ham. +Nor the soles of her shoe? + +Ros. +Neither, my lord. + +Ham. +Then you live about her waist, or in the middle of her +favours? + +Guil. +Faith, her privates we. + +Ham. +In the secret parts of fortune? O, most true; she is a +strumpet. What's the news? + +Ros. +None, my lord, but that the world's grown honest. + +Ham. +Then is doomsday near; but your news is not true. Let me +question more in particular: what have you, my good friends, +deserved at the hands of fortune, that she sends you to prison +hither? + +Guil. +Prison, my lord! + +Ham. +Denmark's a prison. + +Ros. +Then is the world one. + +Ham. +A goodly one; in which there are many confines, wards, and +dungeons, Denmark being one o' the worst. + +Ros. +We think not so, my lord. + +Ham. +Why, then 'tis none to you; for there is nothing either good +or bad but thinking makes it so: to me it is a prison. + +Ros. +Why, then, your ambition makes it one; 'tis too narrow for your +mind. + +Ham. +O God, I could be bounded in a nutshell, and count myself a +king of infinite space, were it not that I have bad dreams. + +Guil. +Which dreams, indeed, are ambition; for the very substance of +the ambitious is merely the shadow of a dream. + +Ham. +A dream itself is but a shadow. + +Ros. +Truly, and I hold ambition of so airy and light a quality that +it is but a shadow's shadow. + +Ham. +Then are our beggars bodies, and our monarchs and outstretch'd +heroes the beggars' shadows. Shall we to the court? for, by my +fay, I cannot reason. + +Ros. and Guild. +We'll wait upon you. + +Ham. +No such matter: I will not sort you with the rest of my +servants; for, to speak to you like an honest man, I am most +dreadfully attended. But, in the beaten way of friendship, what +make you at Elsinore? + +Ros. +To visit you, my lord; no other occasion. + +Ham. +Beggar that I am, I am even poor in thanks; but I thank you: +and sure, dear friends, my thanks are too dear a halfpenny. Were +you not sent for? Is it your own inclining? Is it a free +visitation? Come, deal justly with me: come, come; nay, speak. + +Guil. +What should we say, my lord? + +Ham. +Why, anything--but to the purpose. You were sent for; and +there is a kind of confession in your looks, which your modesties +have not craft enough to colour: I know the good king and queen +have sent for you. + +Ros. +To what end, my lord? + +Ham. +That you must teach me. But let me conjure you, by the rights +of our fellowship, by the consonancy of our youth, by the +obligation of our ever-preserved love, and by what more dear a +better proposer could charge you withal, be even and direct with +me, whether you were sent for or no. + +Ros. +[To Guildenstern.] What say you? + +Ham. +[Aside.] Nay, then, I have an eye of you.--If you love me, hold +not off. + +Guil. +My lord, we were sent for. + +Ham. +I will tell you why; so shall my anticipation prevent your +discovery, and your secrecy to the king and queen moult no +feather. I have of late,--but wherefore I know not,--lost all my +mirth, forgone all custom of exercises; and indeed, it goes so +heavily with my disposition that this goodly frame, the earth, +seems to me a sterile promontory; this most excellent canopy, the +air, look you, this brave o'erhanging firmament, this majestical +roof fretted with golden fire,--why, it appears no other thing +to me than a foul and pestilent congregation of vapours. What a +piece of work is man! How noble in reason! how infinite in +faculties! in form and moving, how express and admirable! in +action how like an angel! in apprehension, how like a god! the +beauty of the world! the paragon of animals! And yet, to me, what +is this quintessence of dust? Man delights not me; no, nor woman +neither, though by your smiling you seem to say so. + +Ros. +My lord, there was no such stuff in my thoughts. + +Ham. +Why did you laugh then, when I said 'Man delights not me'? + +Ros. +To think, my lord, if you delight not in man, what lenten +entertainment the players shall receive from you: we coted them +on the way; and hither are they coming to offer you service. + +Ham. +He that plays the king shall be welcome,--his majesty shall +have tribute of me; the adventurous knight shall use his foil and +target; the lover shall not sigh gratis; the humorous man shall +end his part in peace; the clown shall make those laugh whose +lungs are tickle o' the sere; and the lady shall say her mind +freely, or the blank verse shall halt for't. What players are +they? + +Ros. +Even those you were wont to take such delight in,--the +tragedians of the city. + +Ham. +How chances it they travel? their residence, both in +reputation and profit, was better both ways. + +Ros. +I think their inhibition comes by the means of the late +innovation. + +Ham. +Do they hold the same estimation they did when I was in the +city? Are they so followed? + +Ros. +No, indeed, are they not. + +Ham. +How comes it? do they grow rusty? + +Ros. +Nay, their endeavour keeps in the wonted pace: but there is, +sir, an aery of children, little eyases, that cry out on the top +of question, and are most tyrannically clapped for't: these are +now the fashion; and so berattle the common stages,--so they call +them,--that many wearing rapiers are afraid of goose-quills and +dare scarce come thither. + +Ham. +What, are they children? who maintains 'em? How are they +escoted? Will they pursue the quality no longer than they can +sing? will they not say afterwards, if they should grow +themselves to common players,--as it is most like, if their means +are no better,--their writers do them wrong to make them exclaim +against their own succession? + +Ros. +Faith, there has been much to do on both sides; and the nation +holds it no sin to tarre them to controversy: there was, for +awhile, no money bid for argument unless the poet and the player +went to cuffs in the question. + +Ham. +Is't possible? + +Guil. +O, there has been much throwing about of brains. + +Ham. +Do the boys carry it away? + +Ros. +Ay, that they do, my lord; Hercules and his load too. + +Ham. +It is not very strange; for my uncle is king of Denmark, and +those that would make mouths at him while my father lived, give +twenty, forty, fifty, a hundred ducats a-piece for his picture in +little. 'Sblood, there is something in this more than natural, if +philosophy could find it out. + +[Flourish of trumpets within.] + +Guil. +There are the players. + +Ham. +Gentlemen, you are welcome to Elsinore. Your hands, come: the +appurtenance of welcome is fashion and ceremony: let me comply +with you in this garb; lest my extent to the players, which I +tell you must show fairly outward, should more appear like +entertainment than yours. You are welcome: but my uncle-father +and aunt-mother are deceived. + +Guil. +In what, my dear lord? + +Ham. +I am but mad north-north-west: when the wind is southerly I +know a hawk from a handsaw. + +[Enter Polonius.] + +Pol. +Well be with you, gentlemen! + +Ham. +Hark you, Guildenstern;--and you too;--at each ear a hearer: that +great baby you see there is not yet out of his swaddling clouts. + +Ros. +Happily he's the second time come to them; for they say an old +man is twice a child. + +Ham. +I will prophesy he comes to tell me of the players; mark it.--You +say right, sir: o' Monday morning; 'twas so indeed. + +Pol. +My lord, I have news to tell you. + +Ham. +My lord, I have news to tell you. When Roscius was an actor in +Rome,-- + +Pol. +The actors are come hither, my lord. + +Ham. +Buzz, buzz! + +Pol. +Upon my honour,-- + +Ham. +Then came each actor on his ass,-- + +Pol. +The best actors in the world, either for tragedy, comedy, +history, pastoral, pastoral-comical, historical-pastoral, +tragical-historical, tragical-comical-historical-pastoral, scene +individable, or poem unlimited: Seneca cannot be too heavy nor +Plautus too light. For the law of writ and the liberty, these are +the only men. + +Ham. +O Jephthah, judge of Israel, what a treasure hadst thou! + +Pol. +What treasure had he, my lord? + +Ham. +Why-- + 'One fair daughter, and no more, + The which he loved passing well.' + + +Pol. +[Aside.] Still on my daughter. + +Ham. +Am I not i' the right, old Jephthah? + +Pol. +If you call me Jephthah, my lord, I have a daughter that I +love passing well. + +Ham. +Nay, that follows not. + +Pol. +What follows, then, my lord? + +Ham. +Why-- + 'As by lot, God wot,' +and then, you know, + 'It came to pass, as most like it was--' +The first row of the pious chanson will show you more; for look +where my abridgment comes. + +[Enter four or five Players.] + +You are welcome, masters; welcome, all:--I am glad to see thee +well.--welcome, good friends.--O, my old friend! Thy face is +valanc'd since I saw thee last; comest thou to beard me in +Denmark?--What, my young lady and mistress! By'r lady, your +ladyship is nearer to heaven than when I saw you last, by the +altitude of a chopine. Pray God, your voice, like a piece of +uncurrent gold, be not cracked within the ring.--Masters, you are +all welcome. We'll e'en to't like French falconers, fly at +anything we see: we'll have a speech straight: come, give us a +taste of your quality: come, a passionate speech. + +I Play. +What speech, my lord? + +Ham. +I heard thee speak me a speech once,--but it was never acted; +or if it was, not above once; for the play, I remember, pleased +not the million, 'twas caviare to the general; but it was,--as I +received it, and others, whose judgments in such matters cried in +the top of mine,--an excellent play, well digested in the scenes, +set down with as much modesty as cunning. I remember, one said +there were no sallets in the lines to make the matter savoury, +nor no matter in the phrase that might indite the author of +affectation; but called it an honest method, as wholesome as +sweet, and by very much more handsome than fine. One speech in it +I chiefly loved: 'twas AEneas' tale to Dido, and thereabout of it +especially where he speaks of Priam's slaughter: if it live in +your memory, begin at this line;--let me see, let me see:-- + +The rugged Pyrrhus, like th' Hyrcanian beast,-- + +it is not so:-- it begins with Pyrrhus:-- + + 'The rugged Pyrrhus,--he whose sable arms, + Black as his purpose, did the night resemble + When he lay couched in the ominous horse,-- + Hath now this dread and black complexion smear'd + With heraldry more dismal; head to foot + Now is he total gules; horridly trick'd + With blood of fathers, mothers, daughters, sons, + Bak'd and impasted with the parching streets, + That lend a tyrannous and a damned light + To their vile murders: roasted in wrath and fire, + And thus o'ersized with coagulate gore, + With eyes like carbuncles, the hellish Pyrrhus + Old grandsire Priam seeks.' + +So, proceed you. + +Pol. +'Fore God, my lord, well spoken, with good accent and good +discretion. + +I Play. + Anon he finds him, + Striking too short at Greeks: his antique sword, + Rebellious to his arm, lies where it falls, + Repugnant to command: unequal match'd, + Pyrrhus at Priam drives; in rage strikes wide; + But with the whiff and wind of his fell sword + The unnerved father falls. Then senseless Ilium, + Seeming to feel this blow, with flaming top + Stoops to his base; and with a hideous crash + Takes prisoner Pyrrhus' ear: for lo! his sword, + Which was declining on the milky head + Of reverend Priam, seem'd i' the air to stick: + So, as a painted tyrant, Pyrrhus stood; + And, like a neutral to his will and matter, + Did nothing. + But as we often see, against some storm, + A silence in the heavens, the rack stand still, + The bold winds speechless, and the orb below + As hush as death, anon the dreadful thunder + Doth rend the region; so, after Pyrrhus' pause, + A roused vengeance sets him new a-work; + And never did the Cyclops' hammers fall + On Mars's armour, forg'd for proof eterne, + With less remorse than Pyrrhus' bleeding sword + Now falls on Priam.-- + Out, out, thou strumpet, Fortune! All you gods, + In general synod, take away her power; + Break all the spokes and fellies from her wheel, + And bowl the round nave down the hill of heaven, + As low as to the fiends! + +Pol. +This is too long. + +Ham. +It shall to the barber's, with your beard.--Pr'ythee say on.-- +He's for a jig or a tale of bawdry, or he sleeps:--say on; come +to Hecuba. + +I Play. + But who, O who, had seen the mobled queen,-- + +Ham. +'The mobled queen'? + +Pol. +That's good! 'Mobled queen' is good. + +I Play. + Run barefoot up and down, threatening the flames + With bisson rheum; a clout upon that head + Where late the diadem stood, and for a robe, + About her lank and all o'erteemed loins, + A blanket, in the alarm of fear caught up;-- + Who this had seen, with tongue in venom steep'd, + 'Gainst Fortune's state would treason have pronounc'd: + But if the gods themselves did see her then, + When she saw Pyrrhus make malicious sport + In mincing with his sword her husband's limbs, + The instant burst of clamour that she made,-- + Unless things mortal move them not at all,-- + Would have made milch the burning eyes of heaven, + And passion in the gods. + +Pol. +Look, whether he has not turn'd his colour, and has tears in's +eyes.--Pray you, no more! + +Ham. +'Tis well. I'll have thee speak out the rest of this soon.-- +Good my lord, will you see the players well bestowed? Do you +hear? Let them be well used; for they are the abstracts and brief +chronicles of the time; after your death you were better have a +bad epitaph than their ill report while you live. + +Pol. +My lord, I will use them according to their desert. + +Ham. +Odd's bodikin, man, better: use every man after his +desert, and who should scape whipping? Use them after your own +honour and dignity: the less they deserve, the more merit is in +your bounty. Take them in. + +Pol. +Come, sirs. + +Ham. +Follow him, friends: we'll hear a play to-morrow. + +[Exeunt Polonius with all the Players but the First.] + +Dost thou hear me, old friend? Can you play 'The Murder of +Gonzago'? + +I Play. +Ay, my lord. + +Ham. +We'll ha't to-morrow night. You could, for a need, study a +speech of some dozen or sixteen lines which I would set down and +insert in't? could you not? + +I Play. +Ay, my lord. + +Ham. +Very well.--Follow that lord; and look you mock him not. + +[Exit First Player.] + +--My good friends [to Ros. and Guild.], I'll leave you till +night: you are welcome to Elsinore. + +Ros. +Good my lord! + +[Exeunt Rosencrantz and Guildenstern.] + +Ham. +Ay, so, God b' wi' ye! +Now I am alone. +O, what a rogue and peasant slave am I! +Is it not monstrous that this player here, +But in a fiction, in a dream of passion, +Could force his soul so to his own conceit +That from her working all his visage wan'd; +Tears in his eyes, distraction in's aspect, +A broken voice, and his whole function suiting +With forms to his conceit? And all for nothing! +For Hecuba? +What's Hecuba to him, or he to Hecuba, +That he should weep for her? What would he do, +Had he the motive and the cue for passion +That I have? He would drown the stage with tears +And cleave the general ear with horrid speech; +Make mad the guilty, and appal the free; +Confound the ignorant, and amaze, indeed, +The very faculties of eyes and ears. +Yet I, +A dull and muddy-mettled rascal, peak, +Like John-a-dreams, unpregnant of my cause, +And can say nothing; no, not for a king +Upon whose property and most dear life +A damn'd defeat was made. Am I a coward? +Who calls me villain? breaks my pate across? +Plucks off my beard and blows it in my face? +Tweaks me by the nose? gives me the lie i' the throat +As deep as to the lungs? who does me this, ha? +'Swounds, I should take it: for it cannot be +But I am pigeon-liver'd, and lack gall +To make oppression bitter; or ere this +I should have fatted all the region kites +With this slave's offal: bloody, bawdy villain! +Remorseless, treacherous, lecherous, kindless villain! +O, vengeance! +Why, what an ass am I! This is most brave, +That I, the son of a dear father murder'd, +Prompted to my revenge by heaven and hell, +Must, like a whore, unpack my heart with words +And fall a-cursing like a very drab, +A scullion! +Fie upon't! foh!--About, my brain! I have heard +That guilty creatures, sitting at a play, +Have by the very cunning of the scene +Been struck so to the soul that presently +They have proclaim'd their malefactions; +For murder, though it have no tongue, will speak +With most miraculous organ, I'll have these players +Play something like the murder of my father +Before mine uncle: I'll observe his looks; +I'll tent him to the quick: if he but blench, +I know my course. The spirit that I have seen +May be the devil: and the devil hath power +To assume a pleasing shape; yea, and perhaps +Out of my weakness and my melancholy,-- +As he is very potent with such spirits,-- +Abuses me to damn me: I'll have grounds +More relative than this.--the play's the thing +Wherein I'll catch the conscience of the king. + +[Exit.] + + + + +ACT III. + +Scene I. A room in the Castle. + +[Enter King, Queen, Polonius, Ophelia, Rosencrantz, and +Guildenstern.] + +King. +And can you, by no drift of circumstance, +Get from him why he puts on this confusion, +Grating so harshly all his days of quiet +With turbulent and dangerous lunacy? + +Ros. +He does confess he feels himself distracted, +But from what cause he will by no means speak. + +Guil. +Nor do we find him forward to be sounded, +But, with a crafty madness, keeps aloof +When we would bring him on to some confession +Of his true state. + +Queen. +Did he receive you well? + +Ros. +Most like a gentleman. + +Guil. +But with much forcing of his disposition. + +Ros. +Niggard of question; but, of our demands, +Most free in his reply. + +Queen. +Did you assay him +To any pastime? + +Ros. +Madam, it so fell out that certain players +We o'er-raught on the way: of these we told him, +And there did seem in him a kind of joy +To hear of it: they are about the court, +And, as I think, they have already order +This night to play before him. + +Pol. +'Tis most true; +And he beseech'd me to entreat your majesties +To hear and see the matter. + +King. +With all my heart; and it doth much content me +To hear him so inclin'd.-- +Good gentlemen, give him a further edge, +And drive his purpose on to these delights. + +Ros. +We shall, my lord. + +[Exeunt Rosencrantz and Guildenstern.] + +King. +Sweet Gertrude, leave us too; +For we have closely sent for Hamlet hither, +That he, as 'twere by accident, may here +Affront Ophelia: +Her father and myself,--lawful espials,-- +Will so bestow ourselves that, seeing, unseen, +We may of their encounter frankly judge; +And gather by him, as he is behav'd, +If't be the affliction of his love or no +That thus he suffers for. + +Queen. +I shall obey you:-- +And for your part, Ophelia, I do wish +That your good beauties be the happy cause +Of Hamlet's wildness: so shall I hope your virtues +Will bring him to his wonted way again, +To both your honours. + +Oph. +Madam, I wish it may. + +[Exit Queen.] + +Pol. +Ophelia, walk you here.--Gracious, so please you, +We will bestow ourselves.--[To Ophelia.] Read on this book; +That show of such an exercise may colour +Your loneliness.--We are oft to blame in this,-- +'Tis too much prov'd,--that with devotion's visage +And pious action we do sugar o'er +The Devil himself. + +King. +[Aside.] O, 'tis too true! +How smart a lash that speech doth give my conscience! +The harlot's cheek, beautied with plastering art, +Is not more ugly to the thing that helps it +Than is my deed to my most painted word: +O heavy burden! + +Pol. +I hear him coming: let's withdraw, my lord. + +[Exeunt King and Polonius.] + +[Enter Hamlet.] + +Ham. +To be, or not to be,--that is the question:-- +Whether 'tis nobler in the mind to suffer +The slings and arrows of outrageous fortune +Or to take arms against a sea of troubles, +And by opposing end them?--To die,--to sleep,-- +No more; and by a sleep to say we end +The heartache, and the thousand natural shocks +That flesh is heir to,--'tis a consummation +Devoutly to be wish'd. To die,--to sleep;-- +To sleep! perchance to dream:--ay, there's the rub; +For in that sleep of death what dreams may come, +When we have shuffled off this mortal coil, +Must give us pause: there's the respect +That makes calamity of so long life; +For who would bear the whips and scorns of time, +The oppressor's wrong, the proud man's contumely, +The pangs of despis'd love, the law's delay, +The insolence of office, and the spurns +That patient merit of the unworthy takes, +When he himself might his quietus make +With a bare bodkin? who would these fardels bear, +To grunt and sweat under a weary life, +But that the dread of something after death,-- +The undiscover'd country, from whose bourn +No traveller returns,--puzzles the will, +And makes us rather bear those ills we have +Than fly to others that we know not of? +Thus conscience does make cowards of us all; +And thus the native hue of resolution +Is sicklied o'er with the pale cast of thought; +And enterprises of great pith and moment, +With this regard, their currents turn awry, +And lose the name of action.--Soft you now! +The fair Ophelia!--Nymph, in thy orisons +Be all my sins remember'd. + +Oph. +Good my lord, +How does your honour for this many a day? + +Ham. +I humbly thank you; well, well, well. + +Oph. +My lord, I have remembrances of yours +That I have longed long to re-deliver. +I pray you, now receive them. + +Ham. +No, not I; +I never gave you aught. + +Oph. +My honour'd lord, you know right well you did; +And with them words of so sweet breath compos'd +As made the things more rich; their perfume lost, +Take these again; for to the noble mind +Rich gifts wax poor when givers prove unkind. +There, my lord. + +Ham. +Ha, ha! are you honest? + +Oph. +My lord? + +Ham. +Are you fair? + +Oph. +What means your lordship? + +Ham. +That if you be honest and fair, your honesty should admit no +discourse to your beauty. + +Oph. +Could beauty, my lord, have better commerce than with honesty? + +Ham. +Ay, truly; for the power of beauty will sooner transform +honesty from what it is to a bawd than the force of honesty can +translate beauty into his likeness: this was sometime a paradox, +but now the time gives it proof. I did love you once. + +Oph. +Indeed, my lord, you made me believe so. + +Ham. +You should not have believ'd me; for virtue cannot so +inoculate our old stock but we shall relish of it: I loved you +not. + +Oph. +I was the more deceived. + +Ham. +Get thee to a nunnery: why wouldst thou be a breeder of +sinners? I am myself indifferent honest; but yet I could accuse +me of such things that it were better my mother had not borne me: +I am very proud, revengeful, ambitious; with more offences at my +beck than I have thoughts to put them in, imagination to give +them shape, or time to act them in. What should such fellows as I +do crawling between earth and heaven? We are arrant knaves, all; +believe none of us. Go thy ways to a nunnery. Where's your +father? + +Oph. +At home, my lord. + +Ham. +Let the doors be shut upon him, that he may play the fool +nowhere but in's own house. Farewell. + +Oph. +O, help him, you sweet heavens! + +Ham. +If thou dost marry, I'll give thee this plague for thy dowry,-- +be thou as chaste as ice, as pure as snow, thou shalt not escape +calumny. Get thee to a nunnery, go: farewell. Or, if thou wilt +needs marry, marry a fool; for wise men know well enough what +monsters you make of them. To a nunnery, go; and quickly too. +Farewell. + +Oph. +O heavenly powers, restore him! + +Ham. +I have heard of your paintings too, well enough; God hath +given you one face, and you make yourselves another: you jig, you +amble, and you lisp, and nickname God's creatures, and make your +wantonness your ignorance. Go to, I'll no more on't; it hath made +me mad. I say, we will have no more marriages: those that are +married already, all but one, shall live; the rest shall keep as +they are. To a nunnery, go. + +[Exit.] + +Oph. +O, what a noble mind is here o'erthrown! +The courtier's, scholar's, soldier's, eye, tongue, sword, +The expectancy and rose of the fair state, +The glass of fashion and the mould of form, +The observ'd of all observers,--quite, quite down! +And I, of ladies most deject and wretched +That suck'd the honey of his music vows, +Now see that noble and most sovereign reason, +Like sweet bells jangled, out of tune and harsh; +That unmatch'd form and feature of blown youth +Blasted with ecstasy: O, woe is me, +To have seen what I have seen, see what I see! + +[Re-enter King and Polonius.] + +King. +Love! his affections do not that way tend; +Nor what he spake, though it lack'd form a little, +Was not like madness. There's something in his soul +O'er which his melancholy sits on brood; +And I do doubt the hatch and the disclose +Will be some danger: which for to prevent, +I have in quick determination +Thus set it down:--he shall with speed to England +For the demand of our neglected tribute: +Haply the seas, and countries different, +With variable objects, shall expel +This something-settled matter in his heart; +Whereon his brains still beating puts him thus +From fashion of himself. What think you on't? + +Pol. +It shall do well: but yet do I believe +The origin and commencement of his grief +Sprung from neglected love.--How now, Ophelia! +You need not tell us what Lord Hamlet said; +We heard it all.--My lord, do as you please; +But if you hold it fit, after the play, +Let his queen mother all alone entreat him +To show his grief: let her be round with him; +And I'll be plac'd, so please you, in the ear +Of all their conference. If she find him not, +To England send him; or confine him where +Your wisdom best shall think. + +King. +It shall be so: +Madness in great ones must not unwatch'd go. + +[Exeunt.] + + + +Scene II. A hall in the Castle. + +[Enter Hamlet and certain Players.] + +Ham. +Speak the speech, I pray you, as I pronounced it to you, +trippingly on the tongue: but if you mouth it, as many of your +players do, I had as lief the town crier spoke my lines. Nor do +not saw the air too much with your hand, thus, but use all +gently: for in the very torrent, tempest, and, as I may say, +whirlwind of passion, you must acquire and beget a +temperance that may give it smoothness. O, it offends me to the +soul, to hear a robustious periwig-pated fellow tear a passion to +tatters, to very rags, to split the ears of the groundlings, who, +for the most part, are capable of nothing but inexplicable dumb +shows and noise: I would have such a fellow whipped for o'erdoing +Termagant; it out-herods Herod: pray you avoid it. + +I Player. +I warrant your honour. + +Ham. +Be not too tame neither; but let your own discretion be your +tutor: suit the action to the word, the word to the action; with +this special observance, that you o'erstep not the modesty of +nature: for anything so overdone is from the purpose of playing, +whose end, both at the first and now, was and is, to hold, as +'twere, the mirror up to nature; to show virtue her own image, +scorn her own image, and the very age and body of the time his +form and pressure. Now, this overdone, or come tardy off, though +it make the unskilful laugh, cannot but make the judicious +grieve; the censure of the which one must in your allowance, +o'erweigh a whole theatre of others. O, there be players that I +have seen play,--and heard others praise, and that highly,--not +to speak it profanely, that, neither having the accent of +Christians, nor the gait of Christian, pagan, nor man, have so +strutted and bellowed that I have thought some of nature's +journeymen had made men, and not made them well, they imitated +humanity so abominably. + +I Player. +I hope we have reform'd that indifferently with us, sir. + +Ham. +O, reform it altogether. And let those that play your clowns +speak no more than is set down for them: for there be of them +that will themselves laugh, to set on some quantity of barren +spectators to laugh too, though in the meantime some necessary +question of the play be then to be considered: that's villanous +and shows a most pitiful ambition in the fool that uses it. Go +make you ready. + +[Exeunt Players.] + +[Enter Polonius, Rosencrantz, and Guildenstern.] + +How now, my lord! will the king hear this piece of work? + +Pol. +And the queen too, and that presently. + +Ham. +Bid the players make haste. + +[Exit Polonius.] + +Will you two help to hasten them? + +Ros. and Guil. +We will, my lord. + +[Exeunt Ros. and Guil.] + +Ham. +What, ho, Horatio! + +[Enter Horatio.] + +Hor. +Here, sweet lord, at your service. + +Ham. +Horatio, thou art e'en as just a man +As e'er my conversation cop'd withal. + +Hor. +O, my dear lord,-- + +Ham. +Nay, do not think I flatter; +For what advancement may I hope from thee, +That no revenue hast, but thy good spirits, +To feed and clothe thee? Why should the poor be flatter'd? +No, let the candied tongue lick absurd pomp; +And crook the pregnant hinges of the knee +Where thrift may follow fawning. Dost thou hear? +Since my dear soul was mistress of her choice, +And could of men distinguish, her election +Hath seal'd thee for herself: for thou hast been +As one, in suffering all, that suffers nothing; +A man that Fortune's buffets and rewards +Hast ta'en with equal thanks: and bles'd are those +Whose blood and judgment are so well commingled +That they are not a pipe for Fortune's finger +To sound what stop she please. Give me that man +That is not passion's slave, and I will wear him +In my heart's core, ay, in my heart of heart, +As I do thee.--Something too much of this.-- +There is a play to-night before the king; +One scene of it comes near the circumstance, +Which I have told thee, of my father's death: +I pr'ythee, when thou see'st that act a-foot, +Even with the very comment of thy soul +Observe mine uncle: if his occulted guilt +Do not itself unkennel in one speech, +It is a damned ghost that we have seen; +And my imaginations are as foul +As Vulcan's stithy. Give him heedful note; +For I mine eyes will rivet to his face; +And, after, we will both our judgments join +In censure of his seeming. + +Hor. +Well, my lord: +If he steal aught the whilst this play is playing, +And scape detecting, I will pay the theft. + +Ham. +They are coming to the play. I must be idle: +Get you a place. + +[Danish march. A flourish. Enter King, Queen, Polonius, Ophelia, +Rosencrantz, Guildenstern, and others.] + +King. +How fares our cousin Hamlet? + +Ham. +Excellent, i' faith; of the chameleon's dish: I eat the air, +promise-crammed: you cannot feed capons so. + +King. +I have nothing with this answer, Hamlet; these words are not +mine. + +Ham. +No, nor mine now. My lord, you play'd once i' the university, you +say? [To Polonius.] + +Pol. +That did I, my lord, and was accounted a good actor. + +Ham. +What did you enact? + +Pol. +I did enact Julius Caesar; I was kill'd i' the Capitol; Brutus +killed me. + +Ham. +It was a brute part of him to kill so capital a calf there.--Be +the players ready? + +Ros. +Ay, my lord; they stay upon your patience. + +Queen. +Come hither, my dear Hamlet, sit by me. + +Ham. +No, good mother, here's metal more attractive. + +Pol. +O, ho! do you mark that? [To the King.] + +Ham. +Lady, shall I lie in your lap? +[Lying down at Ophelia's feet.] + +Oph. +No, my lord. + +Ham. +I mean, my head upon your lap? + +Oph. +Ay, my lord. + +Ham. +Do you think I meant country matters? + +Oph. +I think nothing, my lord. + +Ham. +That's a fair thought to lie between maids' legs. + +Oph. +What is, my lord? + +Ham. +Nothing. + +Oph. +You are merry, my lord. + +Ham. +Who, I? + +Oph. +Ay, my lord. + +Ham. +O, your only jig-maker! What should a man do but be merry? +for look you how cheerfully my mother looks, and my father died +within 's two hours. + +Oph. +Nay, 'tis twice two months, my lord. + +Ham. +So long? Nay then, let the devil wear black, for I'll have a +suit of sables. O heavens! die two months ago, and not forgotten +yet? Then there's hope a great man's memory may outlive his life +half a year: but, by'r lady, he must build churches then; or else +shall he suffer not thinking on, with the hobby-horse, whose +epitaph is 'For, O, for, O, the hobby-horse is forgot!' + +[Trumpets sound. The dumb show enters.] + +[Enter a King and a Queen very lovingly; the Queen embracing +him and he her. She kneels, and makes show of protestation +unto him. He takes her up, and declines his head upon her +neck: lays him down upon a bank of flowers: she, seeing +him asleep, leaves him. Anon comes in a fellow, takes off his +crown, kisses it, pours poison in the king's ears, and exit. The +Queen returns, finds the King dead, and makes passionate action. +The Poisoner with some three or four Mutes, comes in again, +seeming to lament with her. The dead body is carried away. The +Poisoner wooes the Queen with gifts; she seems loth and unwilling +awhile, but in the end accepts his love.] + +[Exeunt.] + +Oph. +What means this, my lord? + +Ham. +Marry, this is miching mallecho; it means mischief. + +Oph. +Belike this show imports the argument of the play. + +[Enter Prologue.] + +Ham. +We shall know by this fellow: the players cannot keep counsel; +they'll tell all. + +Oph. +Will he tell us what this show meant? + +Ham. +Ay, or any show that you'll show him: be not you ashamed to +show, he'll not shame to tell you what it means. + +Oph. +You are naught, you are naught: I'll mark the play. + +Pro. + For us, and for our tragedy, + Here stooping to your clemency, + We beg your hearing patiently. + +Ham. +Is this a prologue, or the posy of a ring? + +Oph. +'Tis brief, my lord. + +Ham. +As woman's love. + +[Enter a King and a Queen.] + +P. King. +Full thirty times hath Phoebus' cart gone round +Neptune's salt wash and Tellus' orbed ground, +And thirty dozen moons with borrow'd sheen +About the world have times twelve thirties been, +Since love our hearts, and Hymen did our hands, +Unite commutual in most sacred bands. + +P. Queen. +So many journeys may the sun and moon +Make us again count o'er ere love be done! +But, woe is me, you are so sick of late, +So far from cheer and from your former state. +That I distrust you. Yet, though I distrust, +Discomfort you, my lord, it nothing must: +For women's fear and love holds quantity; +In neither aught, or in extremity. +Now, what my love is, proof hath made you know; +And as my love is siz'd, my fear is so: +Where love is great, the littlest doubts are fear; +Where little fears grow great, great love grows there. + +P. King. +Faith, I must leave thee, love, and shortly too; +My operant powers their functions leave to do: +And thou shalt live in this fair world behind, +Honour'd, belov'd, and haply one as kind +For husband shalt thou,-- + +P. Queen. +O, confound the rest! +Such love must needs be treason in my breast: +In second husband let me be accurst! +None wed the second but who kill'd the first. + +Ham. +[Aside.] Wormwood, wormwood! + +P. Queen. +The instances that second marriage move +Are base respects of thrift, but none of love. +A second time I kill my husband dead +When second husband kisses me in bed. + +P. King. +I do believe you think what now you speak; +But what we do determine oft we break. +Purpose is but the slave to memory; +Of violent birth, but poor validity: +Which now, like fruit unripe, sticks on the tree; +But fall unshaken when they mellow be. +Most necessary 'tis that we forget +To pay ourselves what to ourselves is debt: +What to ourselves in passion we propose, +The passion ending, doth the purpose lose. +The violence of either grief or joy +Their own enactures with themselves destroy: +Where joy most revels, grief doth most lament; +Grief joys, joy grieves, on slender accident. +This world is not for aye; nor 'tis not strange +That even our loves should with our fortunes change; +For 'tis a question left us yet to prove, +Whether love lead fortune, or else fortune love. +The great man down, you mark his favourite flies, +The poor advanc'd makes friends of enemies; +And hitherto doth love on fortune tend: +For who not needs shall never lack a friend; +And who in want a hollow friend doth try, +Directly seasons him his enemy. +But, orderly to end where I begun,-- +Our wills and fates do so contrary run +That our devices still are overthrown; +Our thoughts are ours, their ends none of our own: +So think thou wilt no second husband wed; +But die thy thoughts when thy first lord is dead. + +P. Queen. +Nor earth to me give food, nor heaven light! +Sport and repose lock from me day and night! +To desperation turn my trust and hope! +An anchor's cheer in prison be my scope! +Each opposite that blanks the face of joy +Meet what I would have well, and it destroy! +Both here and hence pursue me lasting strife, +If, once a widow, ever I be wife! + +Ham. +If she should break it now! [To Ophelia.] + +P. King. +'Tis deeply sworn. Sweet, leave me here awhile; +My spirits grow dull, and fain I would beguile +The tedious day with sleep. +[Sleeps.] + +P. Queen. +Sleep rock thy brain, +And never come mischance between us twain! + +[Exit.] + +Ham. +Madam, how like you this play? + +Queen. +The lady protests too much, methinks. + +Ham. +O, but she'll keep her word. + +King. +Have you heard the argument? Is there no offence in't? + +Ham. +No, no! They do but jest, poison in jest; no offence i' the +world. + +King. +What do you call the play? + +Ham. +The Mouse-trap. Marry, how? Tropically. This play is the +image of a murder done in Vienna: Gonzago is the duke's name; +his wife, Baptista: you shall see anon; 'tis a knavish piece of +work: but what o' that? your majesty, and we that have free +souls, it touches us not: let the gall'd jade wince; our withers +are unwrung. + +[Enter Lucianus.] + +This is one Lucianus, nephew to the King. + +Oph. +You are a good chorus, my lord. + +Ham. +I could interpret between you and your love, if I could see +the puppets dallying. + +Oph. +You are keen, my lord, you are keen. + +Ham. +It would cost you a groaning to take off my edge. + +Oph. +Still better, and worse. + +Ham. +So you must take your husbands.--Begin, murderer; pox, leave +thy damnable faces, and begin. Come:--'The croaking raven doth +bellow for revenge.' + +Luc. +Thoughts black, hands apt, drugs fit, and time agreeing; +Confederate season, else no creature seeing; +Thou mixture rank, of midnight weeds collected, +With Hecate's ban thrice blasted, thrice infected, +Thy natural magic and dire property +On wholesome life usurp immediately. + +[Pours the poison into the sleeper's ears.] + +Ham. +He poisons him i' the garden for's estate. His name's Gonzago: +The story is extant, and written in very choice Italian; you +shall see anon how the murderer gets the love of Gonzago's wife. + +Oph. +The King rises. + +Ham. +What, frighted with false fire! + +Queen. +How fares my lord? + +Pol. +Give o'er the play. + +King. +Give me some light:--away! + +All. +Lights, lights, lights! + +[Exeunt all but Hamlet and Horatio.] + +Ham. + Why, let the strucken deer go weep, + The hart ungalled play; + For some must watch, while some must sleep: + So runs the world away.-- +Would not this, sir, and a forest of feathers--if the rest of my +fortunes turn Turk with me,--with two Provincial roses on my +razed shoes, get me a fellowship in a cry of players, sir? + +Hor. +Half a share. + +Ham. + A whole one, I. + For thou dost know, O Damon dear, + This realm dismantled was + Of Jove himself; and now reigns here + A very, very--pajock. + +Hor. +You might have rhymed. + +Ham. +O good Horatio, I'll take the ghost's word for a thousand +pound! Didst perceive? + +Hor. +Very well, my lord. + +Ham. +Upon the talk of the poisoning?-- + +Hor. +I did very well note him. + +Ham. +Ah, ha!--Come, some music! Come, the recorders!-- + For if the king like not the comedy, + Why then, belike he likes it not, perdy. +Come, some music! + +[Enter Rosencrantz and Guildenstern.] + +Guil. +Good my lord, vouchsafe me a word with you. + +Ham. +Sir, a whole history. + +Guil. +The king, sir-- + +Ham. +Ay, sir, what of him? + +Guil. +Is, in his retirement, marvellous distempered. + +Ham. +With drink, sir? + +Guil. +No, my lord; rather with choler. + +Ham. +Your wisdom should show itself more richer to signify this to +the doctor; for me to put him to his purgation would perhaps +plunge him into far more choler. + +Guil. +Good my lord, put your discourse into some frame, and start +not so wildly from my affair. + +Ham. +I am tame, sir:--pronounce. + +Guil. +The queen, your mother, in most great affliction of spirit, +hath sent me to you. + +Ham. +You are welcome. + +Guil. +Nay, good my lord, this courtesy is not of the right breed. +If it shall please you to make me a wholesome answer, I will do +your mother's commandment: if not, your pardon and my return +shall be the end of my business. + +Ham. +Sir, I cannot. + +Guil. +What, my lord? + +Ham. +Make you a wholesome answer; my wit's diseased: but, sir, such +answer as I can make, you shall command; or rather, as you say, +my mother: therefore no more, but to the matter: my mother, you +say,-- + +Ros. +Then thus she says: your behaviour hath struck her into +amazement and admiration. + +Ham. +O wonderful son, that can so stonish a mother!--But is there no +sequel at the heels of this mother's admiration? + +Ros. +She desires to speak with you in her closet ere you go to bed. + +Ham. +We shall obey, were she ten times our mother. Have you any +further trade with us? + +Ros. +My lord, you once did love me. + +Ham. +And so I do still, by these pickers and stealers. + +Ros. +Good my lord, what is your cause of distemper? you do, surely, +bar the door upon your own liberty if you deny your griefs to +your friend. + +Ham. +Sir, I lack advancement. + +Ros. +How can that be, when you have the voice of the king himself +for your succession in Denmark? + +Ham. +Ay, sir, but 'While the grass grows'--the proverb is something +musty. + +[Re-enter the Players, with recorders.] + +O, the recorders:--let me see one.--To withdraw with you:--why do +you go about to recover the wind of me, as if you would drive me +into a toil? + +Guil. +O my lord, if my duty be too bold, my love is too unmannerly. + +Ham. +I do not well understand that. Will you play upon this pipe? + +Guil. +My lord, I cannot. + +Ham. +I pray you. + +Guil. +Believe me, I cannot. + +Ham. +I do beseech you. + +Guil. +I know, no touch of it, my lord. + +Ham. +'Tis as easy as lying: govern these ventages with your +finger and thumb, give it breath with your mouth, and it will +discourse most eloquent music. Look you, these are the stops. + +Guil. +But these cannot I command to any utterance of harmony; I +have not the skill. + +Ham. +Why, look you now, how unworthy a thing you make of me! You +would play upon me; you would seem to know my stops; you would +pluck out the heart of my mystery; you would sound me from my +lowest note to the top of my compass; and there is much music, +excellent voice, in this little organ, yet cannot you make it +speak. 'Sblood, do you think I am easier to be played on than a +pipe? Call me what instrument you will, though you can fret me, +you cannot play upon me. + +[Enter Polonius.] + +God bless you, sir! + +Pol. +My lord, the queen would speak with you, and presently. + +Ham. +Do you see yonder cloud that's almost in shape of a camel? + +Pol. +By the mass, and 'tis like a camel indeed. + +Ham. +Methinks it is like a weasel. + +Pol. +It is backed like a weasel. + +Ham. +Or like a whale. + +Pol. +Very like a whale. + +Ham. +Then will I come to my mother by and by.--They fool me to the +top of my bent.--I will come by and by. + +Pol. +I will say so. + +[Exit.] + +Ham. +By-and-by is easily said. + +[Exit Polonius.] + +--Leave me, friends. + +[Exeunt Ros, Guil., Hor., and Players.] + +'Tis now the very witching time of night, +When churchyards yawn, and hell itself breathes out +Contagion to this world: now could I drink hot blood, +And do such bitter business as the day +Would quake to look on. Soft! now to my mother.-- +O heart, lose not thy nature; let not ever +The soul of Nero enter this firm bosom: +Let me be cruel, not unnatural; +I will speak daggers to her, but use none; +My tongue and soul in this be hypocrites,-- +How in my words somever she be shent, +To give them seals never, my soul, consent! + +[Exit.] + + + +Scene III. A room in the Castle. + +[Enter King, Rosencrantz, and Guildenstern.] + +King. +I like him not; nor stands it safe with us +To let his madness range. Therefore prepare you; +I your commission will forthwith dispatch, +And he to England shall along with you: +The terms of our estate may not endure +Hazard so near us as doth hourly grow +Out of his lunacies. + +Guil. +We will ourselves provide: +Most holy and religious fear it is +To keep those many many bodies safe +That live and feed upon your majesty. + +Ros. +The single and peculiar life is bound, +With all the strength and armour of the mind, +To keep itself from 'noyance; but much more +That spirit upon whose weal depend and rest +The lives of many. The cease of majesty +Dies not alone; but like a gulf doth draw +What's near it with it: it is a massy wheel, +Fix'd on the summit of the highest mount, +To whose huge spokes ten thousand lesser things +Are mortis'd and adjoin'd; which, when it falls, +Each small annexment, petty consequence, +Attends the boisterous ruin. Never alone +Did the king sigh, but with a general groan. + +King. +Arm you, I pray you, to this speedy voyage; +For we will fetters put upon this fear, +Which now goes too free-footed. + +Ros and Guil. +We will haste us. + +[Exeunt Ros. and Guil.] + +[Enter Polonius.] + +Pol. +My lord, he's going to his mother's closet: +Behind the arras I'll convey myself +To hear the process; I'll warrant she'll tax him home: +And, as you said, and wisely was it said, +'Tis meet that some more audience than a mother, +Since nature makes them partial, should o'erhear +The speech, of vantage. Fare you well, my liege: +I'll call upon you ere you go to bed, +And tell you what I know. + +King. +Thanks, dear my lord. + +[Exit Polonius.] + +O, my offence is rank, it smells to heaven; +It hath the primal eldest curse upon't,-- +A brother's murder!--Pray can I not, +Though inclination be as sharp as will: +My stronger guilt defeats my strong intent; +And, like a man to double business bound, +I stand in pause where I shall first begin, +And both neglect. What if this cursed hand +Were thicker than itself with brother's blood,-- +Is there not rain enough in the sweet heavens +To wash it white as snow? Whereto serves mercy +But to confront the visage of offence? +And what's in prayer but this twofold force,-- +To be forestalled ere we come to fall, +Or pardon'd being down? Then I'll look up; +My fault is past. But, O, what form of prayer +Can serve my turn? Forgive me my foul murder!-- +That cannot be; since I am still possess'd +Of those effects for which I did the murder,-- +My crown, mine own ambition, and my queen. +May one be pardon'd and retain the offence? +In the corrupted currents of this world +Offence's gilded hand may shove by justice; +And oft 'tis seen the wicked prize itself +Buys out the law; but 'tis not so above; +There is no shuffling;--there the action lies +In his true nature; and we ourselves compell'd, +Even to the teeth and forehead of our faults, +To give in evidence. What then? what rests? +Try what repentance can: what can it not? +Yet what can it when one cannot repent? +O wretched state! O bosom black as death! +O limed soul, that, struggling to be free, +Art more engag'd! Help, angels! Make assay: +Bow, stubborn knees; and, heart, with strings of steel, +Be soft as sinews of the new-born babe! +All may be well. + +[Retires and kneels.] + +[Enter Hamlet.] + +Ham. +Now might I do it pat, now he is praying; +And now I'll do't;--and so he goes to heaven; +And so am I reveng'd.--that would be scann'd: +A villain kills my father; and for that, +I, his sole son, do this same villain send +To heaven. +O, this is hire and salary, not revenge. +He took my father grossly, full of bread; +With all his crimes broad blown, as flush as May; +And how his audit stands, who knows save heaven? +But in our circumstance and course of thought, +'Tis heavy with him: and am I, then, reveng'd, +To take him in the purging of his soul, +When he is fit and season'd for his passage? +No. +Up, sword, and know thou a more horrid hent: +When he is drunk asleep; or in his rage; +Or in the incestuous pleasure of his bed; +At gaming, swearing; or about some act +That has no relish of salvation in't;-- +Then trip him, that his heels may kick at heaven; +And that his soul may be as damn'd and black +As hell, whereto it goes. My mother stays: +This physic but prolongs thy sickly days. + +[Exit.] + +[The King rises and advances.] + +King. +My words fly up, my thoughts remain below: +Words without thoughts never to heaven go. + +[Exit.] + + + +Scene IV. Another room in the castle. + +[Enter Queen and Polonius.] + +Pol. +He will come straight. Look you lay home to him: +Tell him his pranks have been too broad to bear with, +And that your grace hath screen'd and stood between +Much heat and him. I'll silence me e'en here. +Pray you, be round with him. + +Ham. +[Within.] Mother, mother, mother! + +Queen. +I'll warrant you: +Fear me not:--withdraw; I hear him coming. + +[Polonius goes behind the arras.] + +[Enter Hamlet.] + +Ham. +Now, mother, what's the matter? + +Queen. +Hamlet, thou hast thy father much offended. + +Ham. +Mother, you have my father much offended. + +Queen. +Come, come, you answer with an idle tongue. + +Ham. +Go, go, you question with a wicked tongue. + +Queen. +Why, how now, Hamlet! + +Ham. +What's the matter now? + +Queen. +Have you forgot me? + +Ham. +No, by the rood, not so: +You are the Queen, your husband's brother's wife, +And,--would it were not so!--you are my mother. + +Queen. +Nay, then, I'll set those to you that can speak. + +Ham. +Come, come, and sit you down; you shall not budge; +You go not till I set you up a glass +Where you may see the inmost part of you. + +Queen. +What wilt thou do? thou wilt not murder me?-- +Help, help, ho! + +Pol. +[Behind.] What, ho! help, help, help! + +Ham. +How now? a rat? [Draws.] +Dead for a ducat, dead! + +[Makes a pass through the arras.] + +Pol. +[Behind.] O, I am slain! + +[Falls and dies.] + +Queen. +O me, what hast thou done? + +Ham. +Nay, I know not: is it the king? + +[Draws forth Polonius.] + +Queen. +O, what a rash and bloody deed is this! + +Ham. +A bloody deed!--almost as bad, good mother, +As kill a king and marry with his brother. + +Queen. +As kill a king! + +Ham. +Ay, lady, 'twas my word.-- +Thou wretched, rash, intruding fool, farewell! +[To Polonius.] +I took thee for thy better: take thy fortune; +Thou find'st to be too busy is some danger.-- +Leave wringing of your hands: peace! sit you down, +And let me wring your heart: for so I shall, +If it be made of penetrable stuff; +If damned custom have not braz'd it so +That it is proof and bulwark against sense. + +Queen. +What have I done, that thou dar'st wag thy tongue +In noise so rude against me? + +Ham. +Such an act +That blurs the grace and blush of modesty; +Calls virtue hypocrite; takes off the rose +From the fair forehead of an innocent love, +And sets a blister there; makes marriage-vows +As false as dicers' oaths: O, such a deed +As from the body of contraction plucks +The very soul, and sweet religion makes +A rhapsody of words: heaven's face doth glow; +Yea, this solidity and compound mass, +With tristful visage, as against the doom, +Is thought-sick at the act. + +Queen. +Ah me, what act, +That roars so loud, and thunders in the index? + +Ham. +Look here upon this picture, and on this,-- +The counterfeit presentment of two brothers. +See what a grace was seated on this brow; +Hyperion's curls; the front of Jove himself; +An eye like Mars, to threaten and command; +A station like the herald Mercury +New lighted on a heaven-kissing hill: +A combination and a form, indeed, +Where every god did seem to set his seal, +To give the world assurance of a man; +This was your husband.--Look you now what follows: +Here is your husband, like a milldew'd ear +Blasting his wholesome brother. Have you eyes? +Could you on this fair mountain leave to feed, +And batten on this moor? Ha! have you eyes? +You cannot call it love; for at your age +The hey-day in the blood is tame, it's humble, +And waits upon the judgment: and what judgment +Would step from this to this? Sense, sure, you have, +Else could you not have motion: but sure that sense +Is apoplex'd; for madness would not err; +Nor sense to ecstacy was ne'er so thrall'd +But it reserv'd some quantity of choice +To serve in such a difference. What devil was't +That thus hath cozen'd you at hoodman-blind? +Eyes without feeling, feeling without sight, +Ears without hands or eyes, smelling sans all, +Or but a sickly part of one true sense +Could not so mope. +O shame! where is thy blush? Rebellious hell, +If thou canst mutine in a matron's bones, +To flaming youth let virtue be as wax, +And melt in her own fire: proclaim no shame +When the compulsive ardour gives the charge, +Since frost itself as actively doth burn, +And reason panders will. + +Queen. +O Hamlet, speak no more: +Thou turn'st mine eyes into my very soul; +And there I see such black and grained spots +As will not leave their tinct. + +Ham. +Nay, but to live +In the rank sweat of an enseamed bed, +Stew'd in corruption, honeying and making love +Over the nasty sty,-- + +Queen. +O, speak to me no more; +These words like daggers enter in mine ears; +No more, sweet Hamlet. + +Ham. +A murderer and a villain; +A slave that is not twentieth part the tithe +Of your precedent lord; a vice of kings; +A cutpurse of the empire and the rule, +That from a shelf the precious diadem stole +And put it in his pocket! + +Queen. +No more. + +Ham. +A king of shreds and patches!-- + +[Enter Ghost.] + +Save me and hover o'er me with your wings, +You heavenly guards!--What would your gracious figure? + +Queen. +Alas, he's mad! + +Ham. +Do you not come your tardy son to chide, +That, laps'd in time and passion, lets go by +The important acting of your dread command? +O, say! + +Ghost. +Do not forget. This visitation +Is but to whet thy almost blunted purpose. +But, look, amazement on thy mother sits: +O, step between her and her fighting soul,-- +Conceit in weakest bodies strongest works,-- +Speak to her, Hamlet. + +Ham. +How is it with you, lady? + +Queen. +Alas, how is't with you, +That you do bend your eye on vacancy, +And with the incorporal air do hold discourse? +Forth at your eyes your spirits wildly peep; +And, as the sleeping soldiers in the alarm, +Your bedded hairs, like life in excrements, +Start up and stand an end. O gentle son, +Upon the heat and flame of thy distemper +Sprinkle cool patience! Whereon do you look? + +Ham. +On him, on him! Look you how pale he glares! +His form and cause conjoin'd, preaching to stones, +Would make them capable.--Do not look upon me; +Lest with this piteous action you convert +My stern effects: then what I have to do +Will want true colour; tears perchance for blood. + +Queen. +To whom do you speak this? + +Ham. +Do you see nothing there? + +Queen. +Nothing at all; yet all that is I see. + +Ham. +Nor did you nothing hear? + +Queen. +No, nothing but ourselves. + +Ham. +Why, look you there! look how it steals away! +My father, in his habit as he liv'd! +Look, where he goes, even now out at the portal! + +[Exit Ghost.] + +Queen. +This is the very coinage of your brain: +This bodiless creation ecstasy +Is very cunning in. + +Ham. +Ecstasy! +My pulse, as yours, doth temperately keep time, +And makes as healthful music: it is not madness +That I have utter'd: bring me to the test, +And I the matter will re-word; which madness +Would gambol from. Mother, for love of grace, +Lay not that flattering unction to your soul +That not your trespass, but my madness speaks: +It will but skin and film the ulcerous place, +Whilst rank corruption, mining all within, +Infects unseen. Confess yourself to heaven; +Repent what's past; avoid what is to come; +And do not spread the compost on the weeds, +To make them ranker. Forgive me this my virtue; +For in the fatness of these pursy times +Virtue itself of vice must pardon beg, +Yea, curb and woo for leave to do him good. + +Queen. +O Hamlet, thou hast cleft my heart in twain. + +Ham. +O, throw away the worser part of it, +And live the purer with the other half. +Good night: but go not to mine uncle's bed; +Assume a virtue, if you have it not. +That monster custom, who all sense doth eat, +Of habits evil, is angel yet in this,-- +That to the use of actions fair and good +He likewise gives a frock or livery +That aptly is put on. Refrain to-night; +And that shall lend a kind of easiness +To the next abstinence: the next more easy; +For use almost can change the stamp of nature, +And either curb the devil, or throw him out +With wondrous potency. Once more, good-night: +And when you are desirous to be bles'd, +I'll blessing beg of you.--For this same lord +[Pointing to Polonius.] +I do repent; but heaven hath pleas'd it so, +To punish me with this, and this with me, +That I must be their scourge and minister. +I will bestow him, and will answer well +The death I gave him. So again, good-night.-- +I must be cruel, only to be kind: +Thus bad begins, and worse remains behind.-- +One word more, good lady. + +Queen. +What shall I do? + +Ham. +Not this, by no means, that I bid you do: +Let the bloat king tempt you again to bed; +Pinch wanton on your cheek; call you his mouse; +And let him, for a pair of reechy kisses, +Or paddling in your neck with his damn'd fingers, +Make you to ravel all this matter out, +That I essentially am not in madness, +But mad in craft. 'Twere good you let him know; +For who that's but a queen, fair, sober, wise, +Would from a paddock, from a bat, a gib, +Such dear concernings hide? who would do so? +No, in despite of sense and secrecy, +Unpeg the basket on the house's top, +Let the birds fly, and, like the famous ape, +To try conclusions, in the basket creep +And break your own neck down. + +Queen. +Be thou assur'd, if words be made of breath, +And breath of life, I have no life to breathe +What thou hast said to me. + +Ham. +I must to England; you know that? + +Queen. +Alack, +I had forgot: 'tis so concluded on. + +Ham. +There's letters seal'd: and my two schoolfellows,-- +Whom I will trust as I will adders fang'd,-- +They bear the mandate; they must sweep my way +And marshal me to knavery. Let it work; +For 'tis the sport to have the enginer +Hoist with his own petard: and 't shall go hard +But I will delve one yard below their mines +And blow them at the moon: O, 'tis most sweet, +When in one line two crafts directly meet.-- +This man shall set me packing: +I'll lug the guts into the neighbour room.-- +Mother, good-night.--Indeed, this counsellor +Is now most still, most secret, and most grave, +Who was in life a foolish peating knave. +Come, sir, to draw toward an end with you:-- +Good night, mother. + +[Exeunt severally; Hamlet, dragging out Polonius.] + + + +ACT IV. + +Scene I. A room in the Castle. + +[Enter King, Queen, Rosencrantz and Guildenstern.] + +King. +There's matter in these sighs. These profound heaves +You must translate: 'tis fit we understand them. +Where is your son? + +Queen. +Bestow this place on us a little while. + +[To Rosencrantz and Guildenstern, who go out.] + +Ah, my good lord, what have I seen to-night! + +King. +What, Gertrude? How does Hamlet? + +Queen. +Mad as the sea and wind, when both contend +Which is the mightier: in his lawless fit +Behind the arras hearing something stir, +Whips out his rapier, cries 'A rat, a rat!' +And in this brainish apprehension, kills +The unseen good old man. + +King. +O heavy deed! +It had been so with us, had we been there: +His liberty is full of threats to all; +To you yourself, to us, to every one. +Alas, how shall this bloody deed be answer'd? +It will be laid to us, whose providence +Should have kept short, restrain'd, and out of haunt +This mad young man. But so much was our love +We would not understand what was most fit; +But, like the owner of a foul disease, +To keep it from divulging, let it feed +Even on the pith of life. Where is he gone? + +Queen. +To draw apart the body he hath kill'd: +O'er whom his very madness, like some ore +Among a mineral of metals base, +Shows itself pure: he weeps for what is done. + +King. +O Gertrude, come away! +The sun no sooner shall the mountains touch +But we will ship him hence: and this vile deed +We must with all our majesty and skill +Both countenance and excuse.--Ho, Guildenstern! + +[Re-enter Rosencrantz and Guildenstern.] + +Friends both, go join you with some further aid: +Hamlet in madness hath Polonius slain, +And from his mother's closet hath he dragg'd him: +Go seek him out; speak fair, and bring the body +Into the chapel. I pray you, haste in this. + +[Exeunt Rosencrantz and Guildenstern.] + +Come, Gertrude, we'll call up our wisest friends; +And let them know both what we mean to do +And what's untimely done: so haply slander,-- +Whose whisper o'er the world's diameter, +As level as the cannon to his blank, +Transports his poison'd shot,--may miss our name, +And hit the woundless air.--O, come away! +My soul is full of discord and dismay. + +[Exeunt.] + +Scene II. Another room in the Castle. + +[Enter Hamlet.] + +Ham. +Safely stowed. + +Ros. and Guil. +[Within.] Hamlet! Lord Hamlet! + +Ham. +What noise? who calls on Hamlet? O, here they come. + +[Enter Rosencrantz and Guildenstern.] + +Ros. +What have you done, my lord, with the dead body? + +Ham. +Compounded it with dust, whereto 'tis kin. + +Ros. +Tell us where 'tis, that we may take it thence, +And bear it to the chapel. + +Ham. +Do not believe it. + +Ros. +Believe what? + +Ham. +That I can keep your counsel, and not mine own. Besides, to be +demanded of a sponge!--what replication should be made by the son +of a king? + +Ros. +Take you me for a sponge, my lord? + +Ham. +Ay, sir; that soaks up the King's countenance, his rewards, +his authorities. But such officers do the king best service in +the end: he keeps them, like an ape, in the corner of his jaw; +first mouthed, to be last swallowed: when he needs what you have +gleaned, it is but squeezing you, and, sponge, you shall be dry +again. + +Ros. +I understand you not, my lord. + +Ham. +I am glad of it: a knavish speech sleeps in a foolish ear. + +Ros. +My lord, you must tell us where the body is and go with us to +the king. + +Ham. +The body is with the king, but the king is not with the body. +The king is a thing,-- + +Guil. +A thing, my lord! + +Ham. +Of nothing: bring me to him. Hide fox, and all after. + +[Exeunt.] + + + +Scene III. Another room in the Castle. + +[Enter King,attended.] + +King. +I have sent to seek him and to find the body. +How dangerous is it that this man goes loose! +Yet must not we put the strong law on him: +He's lov'd of the distracted multitude, +Who like not in their judgment, but their eyes; +And where 'tis so, the offender's scourge is weigh'd, +But never the offence. To bear all smooth and even, +This sudden sending him away must seem +Deliberate pause: diseases desperate grown +By desperate appliance are reliev'd, +Or not at all. + +[Enter Rosencrantz.] + +How now! what hath befall'n? + +Ros. +Where the dead body is bestow'd, my lord, +We cannot get from him. + +King. +But where is he? + +Ros. +Without, my lord; guarded, to know your pleasure. + +King. +Bring him before us. + +Ros. +Ho, Guildenstern! bring in my lord. + +[Enter Hamlet and Guildenstern.] + +King. +Now, Hamlet, where's Polonius? + +Ham. +At supper. + +King. +At supper! where? + +Ham. +Not where he eats, but where he is eaten: a certain +convocation of politic worms are e'en at him. Your worm is your +only emperor for diet: we fat all creatures else to fat us, and +we fat ourselves for maggots: your fat king and your lean beggar +is but variable service,--two dishes, but to one table: that's +the end. + +King. +Alas, alas! + +Ham. +A man may fish with the worm that hath eat of a king, and eat +of the fish that hath fed of that worm. + +King. +What dost thou mean by this? + +Ham. +Nothing but to show you how a king may go a progress through +the guts of a beggar. + +King. +Where is Polonius? + +Ham. +In heaven: send thither to see: if your messenger find him not +there, seek him i' the other place yourself. But, indeed, if you +find him not within this month, you shall nose him as you go up +the stairs into the lobby. + +King. +Go seek him there. [To some Attendants.] + +Ham. +He will stay till you come. + +[Exeunt Attendants.] + +King. +Hamlet, this deed, for thine especial safety,-- +Which we do tender, as we dearly grieve +For that which thou hast done,--must send thee hence +With fiery quickness: therefore prepare thyself; +The bark is ready, and the wind at help, +The associates tend, and everything is bent +For England. + +Ham. +For England! + +King. +Ay, Hamlet. + +Ham. +Good. + +King. +So is it, if thou knew'st our purposes. + +Ham. +I see a cherub that sees them.--But, come; for England!-- +Farewell, dear mother. + +King. +Thy loving father, Hamlet. + +Ham. +My mother: father and mother is man and wife; man and wife is +one flesh; and so, my mother.--Come, for England! + +[Exit.] + +King. +Follow him at foot; tempt him with speed aboard; +Delay it not; I'll have him hence to-night: +Away! for everything is seal'd and done +That else leans on the affair: pray you, make haste. + +[Exeunt Rosencrantz and Guildenstern.] + +And, England, if my love thou hold'st at aught,-- +As my great power thereof may give thee sense, +Since yet thy cicatrice looks raw and red +After the Danish sword, and thy free awe +Pays homage to us,--thou mayst not coldly set +Our sovereign process; which imports at full, +By letters conjuring to that effect, +The present death of Hamlet. Do it, England; +For like the hectic in my blood he rages, +And thou must cure me: till I know 'tis done, +Howe'er my haps, my joys were ne'er begun. + +[Exit.] + + + +Scene IV. A plain in Denmark. + +[Enter Fortinbras, and Forces marching.] + +For. +Go, Captain, from me greet the Danish king: +Tell him that, by his license, Fortinbras +Craves the conveyance of a promis'd march +Over his kingdom. You know the rendezvous. +If that his majesty would aught with us, +We shall express our duty in his eye; +And let him know so. + +Capt. +I will do't, my lord. + +For. +Go softly on. + +[Exeunt all For. and Forces.] + +[Enter Hamlet, Rosencrantz, Guildenstern, &c.] + +Ham. +Good sir, whose powers are these? + +Capt. +They are of Norway, sir. + +Ham. +How purpos'd, sir, I pray you? + +Capt. +Against some part of Poland. + +Ham. +Who commands them, sir? + +Capt. +The nephew to old Norway, Fortinbras. + +Ham. +Goes it against the main of Poland, sir, +Or for some frontier? + +Capt. +Truly to speak, and with no addition, +We go to gain a little patch of ground +That hath in it no profit but the name. +To pay five ducats, five, I would not farm it; +Nor will it yield to Norway or the Pole +A ranker rate, should it be sold in fee. + +Ham. +Why, then the Polack never will defend it. + +Capt. +Yes, it is already garrison'd. + +Ham. +Two thousand souls and twenty thousand ducats +Will not debate the question of this straw: +This is the imposthume of much wealth and peace, +That inward breaks, and shows no cause without +Why the man dies.--I humbly thank you, sir. + +Capt. +God b' wi' you, sir. + +[Exit.] + +Ros. +Will't please you go, my lord? + +Ham. +I'll be with you straight. Go a little before. + +[Exeunt all but Hamlet.] + +How all occasions do inform against me +And spur my dull revenge! What is a man, +If his chief good and market of his time +Be but to sleep and feed? a beast, no more. +Sure he that made us with such large discourse, +Looking before and after, gave us not +That capability and godlike reason +To fust in us unus'd. Now, whether it be +Bestial oblivion, or some craven scruple +Of thinking too precisely on the event,-- +A thought which, quarter'd, hath but one part wisdom +And ever three parts coward,--I do not know +Why yet I live to say 'This thing's to do;' +Sith I have cause, and will, and strength, and means +To do't. Examples, gross as earth, exhort me: +Witness this army, of such mass and charge, +Led by a delicate and tender prince; +Whose spirit, with divine ambition puff'd, +Makes mouths at the invisible event; +Exposing what is mortal and unsure +To all that fortune, death, and danger dare, +Even for an egg-shell. Rightly to be great +Is not to stir without great argument, +But greatly to find quarrel in a straw +When honour's at the stake. How stand I, then, +That have a father kill'd, a mother stain'd, +Excitements of my reason and my blood, +And let all sleep? while, to my shame, I see +The imminent death of twenty thousand men +That, for a fantasy and trick of fame, +Go to their graves like beds; fight for a plot +Whereon the numbers cannot try the cause, +Which is not tomb enough and continent +To hide the slain?--O, from this time forth, +My thoughts be bloody, or be nothing worth! + +[Exit.] + + + +Scene V. Elsinore. A room in the Castle. + +[Enter Queen and Horatio.] + +Queen. +I will not speak with her. + +Gent. +She is importunate; indeed distract: +Her mood will needs be pitied. + +Queen. +What would she have? + +Gent. +She speaks much of her father; says she hears +There's tricks i' the world, and hems, and beats her heart; +Spurns enviously at straws; speaks things in doubt, +That carry but half sense: her speech is nothing, +Yet the unshaped use of it doth move +The hearers to collection; they aim at it, +And botch the words up fit to their own thoughts; +Which, as her winks, and nods, and gestures yield them, +Indeed would make one think there might be thought, +Though nothing sure, yet much unhappily. +'Twere good she were spoken with; for she may strew +Dangerous conjectures in ill-breeding minds. + +Queen. +Let her come in. + +[Exit Horatio.] + +To my sick soul, as sin's true nature is, +Each toy seems Prologue to some great amiss: +So full of artless jealousy is guilt, +It spills itself in fearing to be spilt. + +[Re-enter Horatio with Ophelia.] + +Oph. +Where is the beauteous majesty of Denmark? + +Queen. +How now, Ophelia? + +Oph. [Sings.] + How should I your true love know + From another one? + By his cockle bat and' staff + And his sandal shoon. + +Queen. +Alas, sweet lady, what imports this song? + +Oph. +Say you? nay, pray you, mark. +[Sings.] + He is dead and gone, lady, + He is dead and gone; + At his head a grass green turf, + At his heels a stone. + +Queen. +Nay, but Ophelia-- + +Oph. +Pray you, mark. +[Sings.] + White his shroud as the mountain snow, + +[Enter King.] + +Queen. +Alas, look here, my lord! + +Oph. +[Sings.] + Larded all with sweet flowers; + Which bewept to the grave did go + With true-love showers. + +King. +How do you, pretty lady? + +Oph. +Well, God dild you! They say the owl was a baker's daughter. +Lord, we know what we are, but know not what we may be. God be at +your table! + +King. +Conceit upon her father. + +Oph. +Pray you, let's have no words of this; but when they ask you what +it means, say you this: +[Sings.] + To-morrow is Saint Valentine's day + All in the morning bedtime, + And I a maid at your window, + To be your Valentine. + + Then up he rose and donn'd his clothes, + And dupp'd the chamber door, + Let in the maid, that out a maid + Never departed more. + +King. +Pretty Ophelia! + +Oph. +Indeed, la, without an oath, I'll make an end on't: +[Sings.] + By Gis and by Saint Charity, + Alack, and fie for shame! + Young men will do't if they come to't; + By cock, they are to blame. + + Quoth she, before you tumbled me, + You promis'd me to wed. + So would I ha' done, by yonder sun, + An thou hadst not come to my bed. + +King. +How long hath she been thus? + +Oph. +I hope all will be well. We must be patient: but I cannot +choose but weep, to think they would lay him i' the cold ground. +My brother shall know of it: and so I thank you for your good +counsel.--Come, my coach!--Good night, ladies; good night, sweet +ladies; good night, good night. + +[Exit.] + +King. +Follow her close; give her good watch, I pray you. + +[Exit Horatio.] + +O, this is the poison of deep grief; it springs +All from her father's death. O Gertrude, Gertrude, +When sorrows come, they come not single spies, +But in battalions! First, her father slain: +Next, your son gone; and he most violent author +Of his own just remove: the people muddied, +Thick and and unwholesome in their thoughts and whispers +For good Polonius' death; and we have done but greenly +In hugger-mugger to inter him: poor Ophelia +Divided from herself and her fair judgment, +Without the which we are pictures or mere beasts: +Last, and as much containing as all these, +Her brother is in secret come from France; +Feeds on his wonder, keeps himself in clouds, +And wants not buzzers to infect his ear +With pestilent speeches of his father's death; +Wherein necessity, of matter beggar'd, +Will nothing stick our person to arraign +In ear and ear. O my dear Gertrude, this, +Like to a murdering piece, in many places +Give, me superfluous death. + +[A noise within.] + +Queen. +Alack, what noise is this? + +King. +Where are my Switzers? let them guard the door. + +[Enter a Gentleman.] + +What is the matter? + +Gent. +Save yourself, my lord: +The ocean, overpeering of his list, +Eats not the flats with more impetuous haste +Than young Laertes, in a riotous head, +O'erbears your offices. The rabble call him lord; +And, as the world were now but to begin, +Antiquity forgot, custom not known, +The ratifiers and props of every word, +They cry 'Choose we! Laertes shall be king!' +Caps, hands, and tongues applaud it to the clouds, +'Laertes shall be king! Laertes king!' + +Queen. +How cheerfully on the false trail they cry! +O, this is counter, you false Danish dogs! + +[A noise within.] + +King. +The doors are broke. + +[Enter Laertes, armed; Danes following.] + +Laer. +Where is this king?--Sirs, stand you all without. + +Danes. +No, let's come in. + +Laer. +I pray you, give me leave. + +Danes. +We will, we will. + +[They retire without the door.] + +Laer. +I thank you:--keep the door.--O thou vile king, +Give me my father! + +Queen. +Calmly, good Laertes. + +Laer. +That drop of blood that's calm proclaims me bastard; +Cries cuckold to my father; brands the harlot +Even here, between the chaste unsmirched brow +Of my true mother. + +King. +What is the cause, Laertes, +That thy rebellion looks so giant-like?-- +Let him go, Gertrude; do not fear our person: +There's such divinity doth hedge a king, +That treason can but peep to what it would, +Acts little of his will.--Tell me, Laertes, +Why thou art thus incens'd.--Let him go, Gertrude:-- +Speak, man. + +Laer. +Where is my father? + +King. +Dead. + +Queen. +But not by him. + +King. +Let him demand his fill. + +Laer. +How came he dead? I'll not be juggled with: +To hell, allegiance! vows, to the blackest devil! +Conscience and grace, to the profoundest pit! +I dare damnation:--to this point I stand,-- +That both the worlds, I give to negligence, +Let come what comes; only I'll be reveng'd +Most throughly for my father. + +King. +Who shall stay you? + +Laer. +My will, not all the world: +And for my means, I'll husband them so well, +They shall go far with little. + +King. +Good Laertes, +If you desire to know the certainty +Of your dear father's death, is't writ in your revenge +That, sweepstake, you will draw both friend and foe, +Winner and loser? + +Laer. +None but his enemies. + +King. +Will you know them then? + +Laer. +To his good friends thus wide I'll ope my arms; +And, like the kind life-rendering pelican, +Repast them with my blood. + +King. +Why, now you speak +Like a good child and a true gentleman. +That I am guiltless of your father's death, +And am most sensibly in grief for it, +It shall as level to your judgment pierce +As day does to your eye. + +Danes. +[Within] Let her come in. + +Laer. +How now! What noise is that? + +[Re-enter Ophelia, fantastically dressed with straws and +flowers.] + +O heat, dry up my brains! tears seven times salt, +Burn out the sense and virtue of mine eye!-- +By heaven, thy madness shall be paid by weight, +Till our scale turn the beam. O rose of May! +Dear maid, kind sister, sweet Ophelia!-- +O heavens! is't possible a young maid's wits +Should be as mortal as an old man's life? +Nature is fine in love; and where 'tis fine, +It sends some precious instance of itself +After the thing it loves. + +Oph. +[Sings.] + They bore him barefac'd on the bier + Hey no nonny, nonny, hey nonny + And on his grave rain'd many a tear.-- + +Fare you well, my dove! + +Laer. +Hadst thou thy wits, and didst persuade revenge, +It could not move thus. + +Oph. +You must sing 'Down a-down, an you call him a-down-a.' O, +how the wheel becomes it! It is the false steward, that stole his +master's daughter. + +Laer. +This nothing's more than matter. + +Oph. +There's rosemary, that's for remembrance; pray, love, +remember: and there is pansies, that's for thoughts. + +Laer. +A document in madness,--thoughts and remembrance fitted. + +Oph. +There's fennel for you, and columbines:--there's rue for you; +and here's some for me:--we may call it herb of grace o' +Sundays:--O, you must wear your rue with a difference.--There's a +daisy:--I would give you some violets, but they wither'd all when +my father died:--they say he made a good end,-- +[Sings.] + For bonny sweet Robin is all my joy,-- + +Laer. +Thought and affliction, passion, hell itself, +She turns to favour and to prettiness. + +Oph. +[Sings.] + And will he not come again? + And will he not come again? + No, no, he is dead, + Go to thy death-bed, + He never will come again. + + His beard was as white as snow, + All flaxen was his poll: + He is gone, he is gone, + And we cast away moan: + God ha' mercy on his soul! + +And of all Christian souls, I pray God.--God b' wi' ye. + +[Exit.] + +Laer. +Do you see this, O God? + +King. +Laertes, I must commune with your grief, +Or you deny me right. Go but apart, +Make choice of whom your wisest friends you will, +And they shall hear and judge 'twixt you and me. +If by direct or by collateral hand +They find us touch'd, we will our kingdom give, +Our crown, our life, and all that we call ours, +To you in satisfaction; but if not, +Be you content to lend your patience to us, +And we shall jointly labour with your soul +To give it due content. + +Laer. +Let this be so; +His means of death, his obscure burial,-- +No trophy, sword, nor hatchment o'er his bones, +No noble rite nor formal ostentation,-- +Cry to be heard, as 'twere from heaven to earth, +That I must call't in question. + +King. +So you shall; +And where the offence is let the great axe fall. +I pray you go with me. + +[Exeunt.] + + + +Scene VI. Another room in the Castle. + +[Enter Horatio and a Servant.] + +Hor. +What are they that would speak with me? + +Servant. +Sailors, sir: they say they have letters for you. + +Hor. +Let them come in. + +[Exit Servant.] + +I do not know from what part of the world +I should be greeted, if not from Lord Hamlet. + +[Enter Sailors.] + +I Sailor. +God bless you, sir. + +Hor. +Let him bless thee too. + +Sailor. +He shall, sir, an't please him. There's a letter for you, +sir,--it comes from the ambassador that was bound for England; if +your name be Horatio, as I am let to know it is. + +Hor. +[Reads.] 'Horatio, when thou shalt have overlooked +this, give these fellows some means to the king: they have +letters for him. Ere we were two days old at sea, a pirate of +very warlike appointment gave us chase. Finding ourselves too +slow of sail, we put on a compelled valour, and in the grapple I +boarded them: on the instant they got clear of our ship; so I +alone became their prisoner. They have dealt with me like thieves +of mercy: but they knew what they did; I am to do a good turn for +them. Let the king have the letters I have sent; and repair thou +to me with as much haste as thou wouldst fly death. I have words +to speak in thine ear will make thee dumb; yet are they much too +light for the bore of the matter. These good fellows will bring +thee where I am. Rosencrantz and Guildenstern hold their course +for England: of them I have much to tell thee. Farewell. +He that thou knowest thine, HAMLET.' + +Come, I will give you way for these your letters; +And do't the speedier, that you may direct me +To him from whom you brought them. + +[Exeunt.] + + + +Scene VII. Another room in the Castle. + +[Enter King and Laertes.] + +King. +Now must your conscience my acquittance seal, +And you must put me in your heart for friend, +Sith you have heard, and with a knowing ear, +That he which hath your noble father slain +Pursu'd my life. + +Laer. +It well appears:--but tell me +Why you proceeded not against these feats, +So crimeful and so capital in nature, +As by your safety, wisdom, all things else, +You mainly were stirr'd up. + +King. +O, for two special reasons; +Which may to you, perhaps, seem much unsinew'd, +But yet to me they are strong. The queen his mother +Lives almost by his looks; and for myself,-- +My virtue or my plague, be it either which,-- +She's so conjunctive to my life and soul, +That, as the star moves not but in his sphere, +I could not but by her. The other motive, +Why to a public count I might not go, +Is the great love the general gender bear him; +Who, dipping all his faults in their affection, +Would, like the spring that turneth wood to stone, +Convert his gyves to graces; so that my arrows, +Too slightly timber'd for so loud a wind, +Would have reverted to my bow again, +And not where I had aim'd them. + +Laer. +And so have I a noble father lost; +A sister driven into desperate terms,-- +Whose worth, if praises may go back again, +Stood challenger on mount of all the age +For her perfections:--but my revenge will come. + +King. +Break not your sleeps for that:--you must not think +That we are made of stuff so flat and dull +That we can let our beard be shook with danger, +And think it pastime. You shortly shall hear more: +I lov'd your father, and we love ourself; +And that, I hope, will teach you to imagine,-- + +[Enter a Messenger.] + +How now! What news? + +Mess. +Letters, my lord, from Hamlet: +This to your majesty; this to the queen. + +King. +From Hamlet! Who brought them? + +Mess. +Sailors, my lord, they say; I saw them not: +They were given me by Claudio:--he receiv'd them +Of him that brought them. + +King. +Laertes, you shall hear them. +Leave us. + +[Exit Messenger.] + +[Reads]'High and mighty,--You shall know I am set naked on your +kingdom. To-morrow shall I beg leave to see your kingly eyes: +when I shall, first asking your pardon thereunto, recount the +occasions of my sudden and more strange return. HAMLET.' + +What should this mean? Are all the rest come back? +Or is it some abuse, and no such thing? + +Laer. +Know you the hand? + +King. +'Tis Hamlet's character:--'Naked!'-- +And in a postscript here, he says 'alone.' +Can you advise me? + +Laer. +I am lost in it, my lord. But let him come; +It warms the very sickness in my heart +That I shall live and tell him to his teeth, +'Thus didest thou.' + +King. +If it be so, Laertes,-- +As how should it be so? how otherwise?-- +Will you be rul'd by me? + +Laer. +Ay, my lord; +So you will not o'errule me to a peace. + +King. +To thine own peace. If he be now return'd-- +As checking at his voyage, and that he means +No more to undertake it,--I will work him +To exploit, now ripe in my device, +Under the which he shall not choose but fall: +And for his death no wind shall breathe; +But even his mother shall uncharge the practice +And call it accident. + +Laer. +My lord, I will be rul'd; +The rather if you could devise it so +That I might be the organ. + +King. +It falls right. +You have been talk'd of since your travel much, +And that in Hamlet's hearing, for a quality +Wherein they say you shine: your sum of parts +Did not together pluck such envy from him +As did that one; and that, in my regard, +Of the unworthiest siege. + +Laer. +What part is that, my lord? + +King. +A very riband in the cap of youth, +Yet needful too; for youth no less becomes +The light and careless livery that it wears +Than settled age his sables and his weeds, +Importing health and graveness.--Two months since, +Here was a gentleman of Normandy,-- +I've seen myself, and serv'd against, the French, +And they can well on horseback: but this gallant +Had witchcraft in't: he grew unto his seat; +And to such wondrous doing brought his horse, +As had he been incorps'd and demi-natur'd +With the brave beast: so far he topp'd my thought +That I, in forgery of shapes and tricks, +Come short of what he did. + +Laer. +A Norman was't? + +King. +A Norman. + +Laer. +Upon my life, Lamond. + +King. +The very same. + +Laer. +I know him well: he is the brooch indeed +And gem of all the nation. + +King. +He made confession of you; +And gave you such a masterly report +For art and exercise in your defence, +And for your rapier most especially, +That he cried out, 'twould be a sight indeed +If one could match you: the scrimers of their nation +He swore, had neither motion, guard, nor eye, +If you oppos'd them. Sir, this report of his +Did Hamlet so envenom with his envy +That he could nothing do but wish and beg +Your sudden coming o'er, to play with him. +Now, out of this,-- + +Laer. +What out of this, my lord? + +King. +Laertes, was your father dear to you? +Or are you like the painting of a sorrow, +A face without a heart? + +Laer. +Why ask you this? + +King. +Not that I think you did not love your father; +But that I know love is begun by time, +And that I see, in passages of proof, +Time qualifies the spark and fire of it. +There lives within the very flame of love +A kind of wick or snuff that will abate it; +And nothing is at a like goodness still; +For goodness, growing to a plurisy, +Dies in his own too much: that we would do, +We should do when we would; for this 'would' changes, +And hath abatements and delays as many +As there are tongues, are hands, are accidents; +And then this 'should' is like a spendthrift sigh, +That hurts by easing. But to the quick o' the ulcer:-- +Hamlet comes back: what would you undertake +To show yourself your father's son in deed +More than in words? + +Laer. +To cut his throat i' the church. + +King. +No place, indeed, should murder sanctuarize; +Revenge should have no bounds. But, good Laertes, +Will you do this, keep close within your chamber. +Hamlet return'd shall know you are come home: +We'll put on those shall praise your excellence +And set a double varnish on the fame +The Frenchman gave you; bring you in fine together +And wager on your heads: he, being remiss, +Most generous, and free from all contriving, +Will not peruse the foils; so that with ease, +Or with a little shuffling, you may choose +A sword unbated, and, in a pass of practice, +Requite him for your father. + +Laer. +I will do't: +And for that purpose I'll anoint my sword. +I bought an unction of a mountebank, +So mortal that, but dip a knife in it, +Where it draws blood no cataplasm so rare, +Collected from all simples that have virtue +Under the moon, can save the thing from death +This is but scratch'd withal: I'll touch my point +With this contagion, that, if I gall him slightly, +It may be death. + +King. +Let's further think of this; +Weigh what convenience both of time and means +May fit us to our shape: if this should fail, +And that our drift look through our bad performance. +'Twere better not assay'd: therefore this project +Should have a back or second, that might hold +If this did blast in proof. Soft! let me see:-- +We'll make a solemn wager on your cunnings,-- +I ha't: +When in your motion you are hot and dry,-- +As make your bouts more violent to that end,-- +And that he calls for drink, I'll have prepar'd him +A chalice for the nonce; whereon but sipping, +If he by chance escape your venom'd stuck, +Our purpose may hold there. + +[Enter Queen.] + +How now, sweet queen! + +Queen. +One woe doth tread upon another's heel, +So fast they follow:--your sister's drown'd, Laertes. + +Laer. +Drown'd! O, where? + +Queen. +There is a willow grows aslant a brook, +That shows his hoar leaves in the glassy stream; +There with fantastic garlands did she come +Of crowflowers, nettles, daisies, and long purples, +That liberal shepherds give a grosser name, +But our cold maids do dead men's fingers call them. +There, on the pendant boughs her coronet weeds +Clamb'ring to hang, an envious sliver broke; +When down her weedy trophies and herself +Fell in the weeping brook. Her clothes spread wide; +And, mermaid-like, awhile they bore her up; +Which time she chaunted snatches of old tunes; +As one incapable of her own distress, +Or like a creature native and indu'd +Unto that element: but long it could not be +Till that her garments, heavy with their drink, +Pull'd the poor wretch from her melodious lay +To muddy death. + +Laer. +Alas, then she is drown'd? + +Queen. +Drown'd, drown'd. + +Laer. +Too much of water hast thou, poor Ophelia, +And therefore I forbid my tears: but yet +It is our trick; nature her custom holds, +Let shame say what it will: when these are gone, +The woman will be out.--Adieu, my lord: +I have a speech of fire, that fain would blaze, +But that this folly douts it. + +[Exit.] + +King. +Let's follow, Gertrude; +How much I had to do to calm his rage! +Now fear I this will give it start again; +Therefore let's follow. + +[Exeunt.] + + + +ACT V. + +Scene I. A churchyard. + +[Enter two Clowns, with spades, &c.] + +1 Clown. +Is she to be buried in Christian burial when she wilfully +seeks her own salvation? + +2 Clown. +I tell thee she is; and therefore make her grave straight: the +crowner hath sat on her, and finds it Christian burial. + +1 Clown. +How can that be, unless she drowned herself in her own defence? + +2 Clown. +Why, 'tis found so. + +1 Clown. +It must be se offendendo; it cannot be else. For here lies +the point: if I drown myself wittingly, it argues an act: and an +act hath three branches; it is to act, to do, and to perform: +argal, she drowned herself wittingly. + +2 Clown. +Nay, but hear you, goodman delver,-- + +1 Clown. +Give me leave. Here lies the water; good: here stands the +man; good: if the man go to this water and drown himself, it is, +will he, nill he, he goes,--mark you that: but if the water come +to him and drown him, he drowns not himself; argal, he that is +not guilty of his own death shortens not his own life. + +2 Clown. +But is this law? + +1 Clown. +Ay, marry, is't--crowner's quest law. + +2 Clown. +Will you ha' the truth on't? If this had not been a +gentlewoman, she should have been buried out o' Christian burial. + +1 Clown. +Why, there thou say'st: and the more pity that great folk +should have countenance in this world to drown or hang themselves +more than their even Christian.--Come, my spade. There is no +ancient gentlemen but gardeners, ditchers, and grave-makers: they +hold up Adam's profession. + +2 Clown. +Was he a gentleman? + +1 Clown. +He was the first that ever bore arms. + +2 Clown. +Why, he had none. + +1 Clown. +What, art a heathen? How dost thou understand the Scripture? +The Scripture says Adam digg'd: could he dig without arms? I'll +put another question to thee: if thou answerest me not to the +purpose, confess thyself,-- + +2 Clown. +Go to. + +1 Clown. +What is he that builds stronger than either the mason, the +shipwright, or the carpenter? + +2 Clown. +The gallows-maker; for that frame outlives a thousand tenants. + +1 Clown. +I like thy wit well, in good faith: the gallows does well; +but how does it well? it does well to those that do ill: now, +thou dost ill to say the gallows is built stronger than the +church; argal, the gallows may do well to thee. To't again, come. + +2 Clown. +Who builds stronger than a mason, a shipwright, or a carpenter? + +1 Clown. +Ay, tell me that, and unyoke. + +2 Clown. +Marry, now I can tell. + +1 Clown. +To't. + +2 Clown. +Mass, I cannot tell. + +[Enter Hamlet and Horatio, at a distance.] + +1 Clown. +Cudgel thy brains no more about it, for your dull ass will +not mend his pace with beating; and when you are asked this +question next, say 'a grave-maker;' the houses he makes last +till doomsday. Go, get thee to Yaughan; fetch me a stoup of +liquor. + +[Exit Second Clown.] + +[Digs and sings.] + + In youth when I did love, did love, + Methought it was very sweet; + To contract, O, the time for, ah, my behove, + O, methought there was nothing meet. + +Ham. +Has this fellow no feeling of his business, that he sings at +grave-making? + +Hor. +Custom hath made it in him a property of easiness. + +Ham. +'Tis e'en so: the hand of little employment hath the daintier +sense. + +1 Clown. +[Sings.] + But age, with his stealing steps, + Hath claw'd me in his clutch, + And hath shipp'd me into the land, + As if I had never been such. + +[Throws up a skull.] + +Ham. +That skull had a tongue in it, and could sing once: how the +knave jowls it to the ground,as if 'twere Cain's jawbone, that +did the first murder! This might be the pate of a politician, +which this ass now o'erreaches; one that would circumvent God, +might it not? + +Hor. +It might, my lord. + +Ham. +Or of a courtier, which could say 'Good morrow, sweet lord! +How dost thou, good lord?' This might be my lord such-a-one, that +praised my lord such-a-one's horse when he meant to beg +it,--might it not? + +Hor. +Ay, my lord. + +Ham. +Why, e'en so: and now my Lady Worm's; chapless, and knocked +about the mazard with a sexton's spade: here's fine revolution, +an we had the trick to see't. Did these bones cost no more the +breeding but to play at loggets with 'em? mine ache to think +on't. + +1 Clown. +[Sings.] + A pickaxe and a spade, a spade, + For and a shrouding sheet; + O, a pit of clay for to be made + For such a guest is meet. + +[Throws up another skull]. + +Ham. +There's another: why may not that be the skull of a lawyer? +Where be his quiddits now, his quillets, his cases, his tenures, +and his tricks? why does he suffer this rude knave now to knock +him about the sconce with a dirty shovel, and will not tell him +of his action of battery? Hum! This fellow might be in's time a +great buyer of land, with his statutes, his recognizances, his +fines, his double vouchers, his recoveries: is this the fine of +his fines, and the recovery of his recoveries, to have his fine +pate full of fine dirt? will his vouchers vouch him no more of +his purchases, and double ones too, than the length and breadth +of a pair of indentures? The very conveyances of his lands will +scarcely lie in this box; and must the inheritor himself have no +more, ha? + +Hor. +Not a jot more, my lord. + +Ham. +Is not parchment made of sheep-skins? + +Hor. +Ay, my lord, And of calf-skins too. + +Ham. +They are sheep and calves which seek out assurance in that. I +will speak to this fellow.--Whose grave's this, sir? + +1 Clown. +Mine, sir. +[Sings.] + O, a pit of clay for to be made + For such a guest is meet. + +Ham. +I think it be thine indeed, for thou liest in't. + +1 Clown. +You lie out on't, sir, and therefore 'tis not yours: for my part, +I do not lie in't, yet it is mine. + +Ham. +Thou dost lie in't, to be in't and say it is thine: 'tis for +the dead, not for the quick; therefore thou liest. + +1 Clown. +'Tis a quick lie, sir; 't will away again from me to you. + +Ham. +What man dost thou dig it for? + +1 Clown. +For no man, sir. + +Ham. +What woman then? + +1 Clown. +For none neither. + +Ham. +Who is to be buried in't? + +1 Clown. +One that was a woman, sir; but, rest her soul, she's dead. + +Ham. +How absolute the knave is! We must speak by the card, or +equivocation will undo us. By the Lord, Horatio, these three +years I have taken note of it, the age is grown so picked that +the toe of the peasant comes so near the heel of the courtier he +galls his kibe.--How long hast thou been a grave-maker? + +1 Clown. +Of all the days i' the year, I came to't that day that our +last King Hamlet overcame Fortinbras. + +Ham. +How long is that since? + +1 Clown. +Cannot you tell that? every fool can tell that: it was the +very day that young Hamlet was born,--he that is mad, and sent +into England. + +Ham. +Ay, marry, why was be sent into England? + +1 Clown. +Why, because he was mad: he shall recover his wits there; +or, if he do not, it's no great matter there. + +Ham. +Why? + +1 Clown. +'Twill not he seen in him there; there the men are as mad as he. + +Ham. +How came he mad? + +1 Clown. +Very strangely, they say. + +Ham. +How strangely? + +1 Clown. +Faith, e'en with losing his wits. + +Ham. +Upon what ground? + +1 Clown. +Why, here in Denmark: I have been sexton here, man and boy, +thirty years. + +Ham. +How long will a man lie i' the earth ere he rot? + +1 Clown. +Faith, if he be not rotten before he die,--as we have many +pocky corses now-a-days that will scarce hold the laying in,--he +will last you some eight year or nine year: a tanner will last +you nine year. + +Ham. +Why he more than another? + +1 Clown. +Why, sir, his hide is so tann'd with his trade that he will +keep out water a great while; and your water is a sore decayer of +your whoreson dead body. Here's a skull now; this skull hath lain +in the earth three-and-twenty years. + +Ham. +Whose was it? + +1 Clown. +A whoreson, mad fellow's it was: whose do you think it was? + +Ham. +Nay, I know not. + +1 Clown. +A pestilence on him for a mad rogue! 'a pour'd a flagon of +Rhenish on my head once. This same skull, sir, was Yorick's +skull, the king's jester. + +Ham. +This? + +1 Clown. +E'en that. + +Ham. +Let me see. [Takes the skull.] Alas, poor Yorick!--I knew him, +Horatio; a fellow of infinite jest, of most excellent fancy: he +hath borne me on his back a thousand times; and now, how abhorred +in my imagination it is! my gorge rises at it. Here hung those +lips that I have kiss'd I know not how oft. Where be your gibes +now? your gambols? your songs? your flashes of merriment, that +were wont to set the table on a roar? Not one now, to mock your +own grinning? quite chap-fallen? Now, get you to my lady's +chamber, and tell her, let her paint an inch thick, to this +favour she must come; make her laugh at that.--Pr'ythee, Horatio, +tell me one thing. + +Hor. +What's that, my lord? + +Ham. +Dost thou think Alexander looked o' this fashion i' the earth? + +Hor. +E'en so. + +Ham. +And smelt so? Pah! + +[Throws down the skull.] + +Hor. +E'en so, my lord. + +Ham. +To what base uses we may return, Horatio! Why may not +imagination trace the noble dust of Alexander till he find it +stopping a bung-hole? + +Hor. +'Twere to consider too curiously to consider so. + +Ham. +No, faith, not a jot; but to follow him thither with modesty +enough, and likelihood to lead it: as thus: Alexander died, +Alexander was buried, Alexander returneth into dust; the dust is +earth; of earth we make loam; and why of that loam whereto he +was converted might they not stop a beer-barrel? + Imperious Caesar, dead and turn'd to clay, + Might stop a hole to keep the wind away. + O, that that earth which kept the world in awe + Should patch a wall to expel the winter's flaw! +But soft! but soft! aside!--Here comes the king. + +[Enter priests, &c, in procession; the corpse of Ophelia, +Laertes, and Mourners following; King, Queen, their Trains, &c.] + +The queen, the courtiers: who is that they follow? +And with such maimed rites? This doth betoken +The corse they follow did with desperate hand +Fordo it own life: 'twas of some estate. +Couch we awhile and mark. + +[Retiring with Horatio.] + +Laer. +What ceremony else? + +Ham. +That is Laertes, +A very noble youth: mark. + +Laer. +What ceremony else? + +1 Priest. +Her obsequies have been as far enlarg'd +As we have warranties: her death was doubtful; +And, but that great command o'ersways the order, +She should in ground unsanctified have lodg'd +Till the last trumpet; for charitable prayers, +Shards, flints, and pebbles should be thrown on her, +Yet here she is allowed her virgin rites, +Her maiden strewments, and the bringing home +Of bell and burial. + +Laer. +Must there no more be done? + +1 Priest. +No more be done; +We should profane the service of the dead +To sing a requiem and such rest to her +As to peace-parted souls. + +Laer. +Lay her i' the earth;-- +And from her fair and unpolluted flesh +May violets spring!--I tell thee, churlish priest, +A ministering angel shall my sister be +When thou liest howling. + +Ham. +What, the fair Ophelia? + +Queen. +Sweets to the sweet: farewell. +[Scattering flowers.] +I hop'd thou shouldst have been my Hamlet's wife; +I thought thy bride-bed to have deck'd, sweet maid, +And not have strew'd thy grave. + +Laer. +O, treble woe +Fall ten times treble on that cursed head +Whose wicked deed thy most ingenious sense +Depriv'd thee of!--Hold off the earth awhile, +Till I have caught her once more in mine arms: +[Leaps into the grave.] +Now pile your dust upon the quick and dead, +Till of this flat a mountain you have made, +To o'ertop old Pelion or the skyish head +Of blue Olympus. + +Ham. +[Advancing.] +What is he whose grief +Bears such an emphasis? whose phrase of sorrow +Conjures the wandering stars, and makes them stand +Like wonder-wounded hearers? this is I, +Hamlet the Dane. +[Leaps into the grave.] + +Laer. +The devil take thy soul! +[Grappling with him.] + +Ham. +Thou pray'st not well. +I pr'ythee, take thy fingers from my throat; +For, though I am not splenetive and rash, +Yet have I in me something dangerous, +Which let thy wiseness fear: away thy hand! + +King. +Pluck them asunder. + +Queen. +Hamlet! Hamlet! + +All. +Gentlemen!-- + +Hor. +Good my lord, be quiet. + +[The Attendants part them, and they come out of the grave.] + +Ham. +Why, I will fight with him upon this theme +Until my eyelids will no longer wag. + +Queen. +O my son, what theme? + +Ham. +I lov'd Ophelia; forty thousand brothers +Could not, with all their quantity of love, +Make up my sum.--What wilt thou do for her? + +King. +O, he is mad, Laertes. + +Queen. +For love of God, forbear him! + +Ham. +'Swounds, show me what thou'lt do: +Woul't weep? woul't fight? woul't fast? woul't tear thyself? +Woul't drink up eisel? eat a crocodile? +I'll do't.--Dost thou come here to whine? +To outface me with leaping in her grave? +Be buried quick with her, and so will I: +And, if thou prate of mountains, let them throw +Millions of acres on us, till our ground, +Singeing his pate against the burning zone, +Make Ossa like a wart! Nay, an thou'lt mouth, +I'll rant as well as thou. + +Queen. +This is mere madness: +And thus a while the fit will work on him; +Anon, as patient as the female dove, +When that her golden couplets are disclos'd, +His silence will sit drooping. + +Ham. +Hear you, sir; +What is the reason that you use me thus? +I lov'd you ever: but it is no matter; +Let Hercules himself do what he may, +The cat will mew, and dog will have his day. + +[Exit.] + +King. +I pray thee, good Horatio, wait upon him.-- + +[Exit Horatio.] +[To Laertes] +Strengthen your patience in our last night's speech; +We'll put the matter to the present push.-- +Good Gertrude, set some watch over your son.-- +This grave shall have a living monument: +An hour of quiet shortly shall we see; +Till then in patience our proceeding be. + +[Exeunt.] + + + +Scene II. A hall in the Castle. + +[Enter Hamlet and Horatio.] + +Ham. +So much for this, sir: now let me see the other; +You do remember all the circumstance? + +Hor. +Remember it, my lord! + +Ham. +Sir, in my heart there was a kind of fighting +That would not let me sleep: methought I lay +Worse than the mutinies in the bilboes. Rashly, +And prais'd be rashness for it,--let us know, +Our indiscretion sometime serves us well, +When our deep plots do fail; and that should teach us +There's a divinity that shapes our ends, +Rough-hew them how we will. + +Hor. +That is most certain. + +Ham. +Up from my cabin, +My sea-gown scarf'd about me, in the dark +Grop'd I to find out them: had my desire; +Finger'd their packet; and, in fine, withdrew +To mine own room again: making so bold, +My fears forgetting manners, to unseal +Their grand commission; where I found, Horatio, +O royal knavery! an exact command,-- +Larded with many several sorts of reasons, +Importing Denmark's health, and England's too, +With, ho! such bugs and goblins in my life,-- +That, on the supervise, no leisure bated, +No, not to stay the grinding of the axe, +My head should be struck off. + +Hor. +Is't possible? + +Ham. +Here's the commission: read it at more leisure. +But wilt thou bear me how I did proceed? + +Hor. +I beseech you. + +Ham. +Being thus benetted round with villanies,-- +Or I could make a prologue to my brains, +They had begun the play,--I sat me down; +Devis'd a new commission; wrote it fair: +I once did hold it, as our statists do, +A baseness to write fair, and labour'd much +How to forget that learning; but, sir, now +It did me yeoman's service. Wilt thou know +The effect of what I wrote? + +Hor. +Ay, good my lord. + +Ham. +An earnest conjuration from the king,-- +As England was his faithful tributary; +As love between them like the palm might flourish; +As peace should still her wheaten garland wear +And stand a comma 'tween their amities; +And many such-like as's of great charge,-- +That, on the view and know of these contents, +Without debatement further, more or less, +He should the bearers put to sudden death, +Not shriving-time allow'd. + +Hor. +How was this seal'd? + +Ham. +Why, even in that was heaven ordinant. +I had my father's signet in my purse, +Which was the model of that Danish seal: +Folded the writ up in the form of the other; +Subscrib'd it: gave't the impression; plac'd it safely, +The changeling never known. Now, the next day +Was our sea-fight; and what to this was sequent +Thou know'st already. + +Hor. +So Guildenstern and Rosencrantz go to't. + +Ham. +Why, man, they did make love to this employment; +They are not near my conscience; their defeat +Does by their own insinuation grow: +'Tis dangerous when the baser nature comes +Between the pass and fell incensed points +Of mighty opposites. + +Hor. +Why, what a king is this! + +Ham. +Does it not, thinks't thee, stand me now upon,-- +He that hath kill'd my king, and whor'd my mother; +Popp'd in between the election and my hopes; +Thrown out his angle for my proper life, +And with such cozenage--is't not perfect conscience +To quit him with this arm? and is't not to be damn'd +To let this canker of our nature come +In further evil? + +Hor. +It must be shortly known to him from England +What is the issue of the business there. + +Ham. +It will be short: the interim is mine; +And a man's life is no more than to say One. +But I am very sorry, good Horatio, +That to Laertes I forgot myself; +For by the image of my cause I see +The portraiture of his: I'll court his favours: +But, sure, the bravery of his grief did put me +Into a towering passion. + +Hor. +Peace; who comes here? + +[Enter Osric.] + +Osr. +Your lordship is right welcome back to Denmark. + +Ham. +I humbly thank you, sir. Dost know this water-fly? + +Hor. +No, my good lord. + +Ham. +Thy state is the more gracious; for 'tis a vice to know him. He +hath much land, and fertile: let a beast be lord of beasts, and +his crib shall stand at the king's mess; 'tis a chough; but, as I +say, spacious in the possession of dirt. + +Osr. +Sweet lord, if your lordship were at leisure, I should +impart a thing to you from his majesty. + +Ham. +I will receive it with all diligence of spirit. Put your +bonnet to his right use; 'tis for the head. + +Osr. +I thank your lordship, t'is very hot. + +Ham. +No, believe me, 'tis very cold; the wind is northerly. + +Osr. +It is indifferent cold, my lord, indeed. + +Ham. +Methinks it is very sultry and hot for my complexion. + +Osr. +Exceedingly, my lord; it is very sultry,--as 'twere--I cannot +tell how. But, my lord, his majesty bade me signify to you that +he has laid a great wager on your head. Sir, this is the +matter,-- + +Ham. +I beseech you, remember,-- +[Hamlet moves him to put on his hat.] + +Osr. +Nay, in good faith; for mine ease, in good faith. Sir, here +is newly come to court Laertes; believe me, an absolute +gentleman, full of most excellent differences, of very soft +society and great showing: indeed, to speak feelingly of him, he +is the card or calendar of gentry; for you shall find in him the +continent of what part a gentleman would see. + +Ham. +Sir, his definement suffers no perdition in you;--though, I +know, to divide him inventorially would dizzy the arithmetic of +memory, and yet but yaw neither, in respect of his quick sail. +But, in the verity of extolment, I take him to be a soul of great +article, and his infusion of such dearth and rareness as, to make +true diction of him, his semblable is his mirror, and who else +would trace him, his umbrage, nothing more. + +Osr. +Your lordship speaks most infallibly of him. + +Ham. +The concernancy, sir? why do we wrap the gentleman in our more +rawer breath? + +Osr. +Sir? + +Hor. +Is't not possible to understand in another tongue? You will do't, +sir, really. + +Ham. +What imports the nomination of this gentleman? + +Osr. +Of Laertes? + +Hor. +His purse is empty already; all's golden words are spent. + +Ham. +Of him, sir. + +Osr. +I know, you are not ignorant,-- + +Ham. +I would you did, sir; yet, in faith, if you did, it would not +much approve me.--Well, sir. + +Osr. +You are not ignorant of what excellence Laertes is,-- + +Ham. +I dare not confess that, lest I should compare with him in +excellence; but to know a man well were to know himself. + +Osr. +I mean, sir, for his weapon; but in the imputation laid on +him by them, in his meed he's unfellowed. + +Ham. +What's his weapon? + +Osr. +Rapier and dagger. + +Ham. +That's two of his weapons:--but well. + +Osr. +The king, sir, hath wager'd with him six Barbary horses: +against the which he has imponed, as I take it, six French +rapiers and poniards, with their assigns, as girdle, hangers, and +so: three of the carriages, in faith, are very dear to fancy, +very responsive to the hilts, most delicate carriages, and of +very liberal conceit. + +Ham. +What call you the carriages? + +Hor. +I knew you must be edified by the margent ere you had done. + +Osr. +The carriages, sir, are the hangers. + +Ham. +The phrase would be more german to the matter if we could +carry cannon by our sides. I would it might be hangers till then. +But, on: six Barbary horses against six French swords, their +assigns, and three liberal conceited carriages: that's the French +bet against the Danish: why is this all imponed, as you call it? + +Osr. +The king, sir, hath laid that, in a dozen passes between +your and him, he shall not exceed you three hits: he hath +laid on twelve for nine; and it would come to immediate trial +if your lordship would vouchsafe the answer. + +Ham. +How if I answer no? + +Osr. +I mean, my lord, the opposition of your person in trial. + +Ham. +Sir, I will walk here in the hall: if it please his majesty, +it is the breathing time of day with me: let the foils be +brought, the gentleman willing, and the king hold his purpose, +I will win for him if I can; if not, I will gain nothing but my +shame and the odd hits. + +Osr. +Shall I re-deliver you e'en so? + +Ham. +To this effect, sir; after what flourish your nature will. + +Osr. +I commend my duty to your lordship. + +Ham. +Yours, yours. + +[Exit Osric.] + +He does well to commend it himself; there are no tongues else +for's turn. + +Hor. +This lapwing runs away with the shell on his head. + +Ham. +He did comply with his dug before he suck'd it. Thus has he,--and +many more of the same bevy that I know the drossy age dotes on,-- +only got the tune of the time and outward habit of encounter; +a kind of yesty collection, which carries them through and +through the most fanned and winnowed opinions; and do but blow +them to their trial, the bubbles are out, + +[Enter a Lord.] + +Lord. +My lord, his majesty commended him to you by young Osric, +who brings back to him that you attend him in the hall: he sends +to know if your pleasure hold to play with Laertes, or that you +will take longer time. + +Ham. +I am constant to my purposes; they follow the king's pleasure: +if his fitness speaks, mine is ready; now or whensoever, provided +I be so able as now. + +Lord. +The King and Queen and all are coming down. + +Ham. +In happy time. + +Lord. +The queen desires you to use some gentle entertainment to +Laertes before you fall to play. + +Ham. +She well instructs me. + +[Exit Lord.] + +Hor. +You will lose this wager, my lord. + +Ham. +I do not think so; since he went into France I have been in +continual practice: I shall win at the odds. But thou wouldst not +think how ill all's here about my heart: but it is no matter. + +Hor. +Nay, good my lord,-- + +Ham. +It is but foolery; but it is such a kind of gain-giving as +would perhaps trouble a woman. + +Hor. +If your mind dislike anything, obey it: I will forestall their +repair hither, and say you are not fit. + +Ham. +Not a whit, we defy augury: there's a special providence in +the fall of a sparrow. If it be now, 'tis not to come; if it be +not to come, it will be now; if it be not now, yet it will come: +the readiness is all: since no man has aught of what he leaves, +what is't to leave betimes? + +[Enter King, Queen, Laertes, Lords, Osric, and Attendants with +foils &c.] + +King. +Come, Hamlet, come, and take this hand from me. + +[The King puts Laertes' hand into Hamlet's.] + +Ham. +Give me your pardon, sir: I have done you wrong: +But pardon't, as you are a gentleman. +This presence knows, and you must needs have heard, +How I am punish'd with sore distraction. +What I have done +That might your nature, honour, and exception +Roughly awake, I here proclaim was madness. +Was't Hamlet wrong'd Laertes? Never Hamlet: +If Hamlet from himself be ta'en away, +And when he's not himself does wrong Laertes, +Then Hamlet does it not, Hamlet denies it. +Who does it, then? His madness: if't be so, +Hamlet is of the faction that is wrong'd; +His madness is poor Hamlet's enemy. +Sir, in this audience, +Let my disclaiming from a purpos'd evil +Free me so far in your most generous thoughts +That I have shot my arrow o'er the house +And hurt my brother. + +Laer. +I am satisfied in nature, +Whose motive, in this case, should stir me most +To my revenge. But in my terms of honour +I stand aloof; and will no reconcilement +Till by some elder masters of known honour +I have a voice and precedent of peace +To keep my name ungor'd. But till that time +I do receive your offer'd love like love, +And will not wrong it. + +Ham. +I embrace it freely; +And will this brother's wager frankly play.-- +Give us the foils; come on. + +Laer. +Come, one for me. + +Ham. +I'll be your foil, Laertes; in mine ignorance +Your skill shall, like a star in the darkest night, +Stick fiery off indeed. + +Laer. +You mock me, sir. + +Ham. +No, by this hand. + +King. +Give them the foils, young Osric. Cousin Hamlet, +You know the wager? + +Ham. +Very well, my lord; +Your grace has laid the odds o' the weaker side. + +King. +I do not fear it; I have seen you both; +But since he's better'd, we have therefore odds. + +Laer. +This is too heavy, let me see another. + +Ham. +This likes me well. These foils have all a length? + +[They prepare to play.] + +Osr. +Ay, my good lord. + +King. +Set me the stoups of wine upon that table,-- +If Hamlet give the first or second hit, +Or quit in answer of the third exchange, +Let all the battlements their ordnance fire; +The king shall drink to Hamlet's better breath; +And in the cup an union shall he throw, +Richer than that which four successive kings +In Denmark's crown have worn. Give me the cups; +And let the kettle to the trumpet speak, +The trumpet to the cannoneer without, +The cannons to the heavens, the heavens to earth, +'Now the king drinks to Hamlet.'--Come, begin:-- +And you, the judges, bear a wary eye. + +Ham. +Come on, sir. + +Laer. +Come, my lord. + +[They play.] + +Ham. +One. + +Laer. +No. + +Ham. +Judgment! + +Osr. +A hit, a very palpable hit. + +Laer. +Well;--again. + +King. +Stay, give me drink.--Hamlet, this pearl is thine; +Here's to thy health.-- + +[Trumpets sound, and cannon shot off within.] + +Give him the cup. + +Ham. +I'll play this bout first; set it by awhile.-- +Come.--Another hit; what say you? + +[They play.] + +Laer. +A touch, a touch, I do confess. + +King. +Our son shall win. + +Queen. +He's fat, and scant of breath.-- +Here, Hamlet, take my napkin, rub thy brows: +The queen carouses to thy fortune, Hamlet. + +Ham. +Good madam! + +King. +Gertrude, do not drink. + +Queen. +I will, my lord; I pray you pardon me. + +King. +[Aside.] It is the poison'd cup; it is too late. + +Ham. +I dare not drink yet, madam; by-and-by. + +Queen. +Come, let me wipe thy face. + +Laer. +My lord, I'll hit him now. + +King. +I do not think't. + +Laer. +[Aside.] And yet 'tis almost 'gainst my conscience. + +Ham. +Come, for the third, Laertes: you but dally; +I pray you pass with your best violence: +I am afeard you make a wanton of me. + +Laer. +Say you so? come on. + +[They play.] + +Osr. +Nothing, neither way. + +Laer. +Have at you now! + +[Laertes wounds Hamlet; then, in scuffling, they +change rapiers, and Hamlet wounds Laertes.] + +King. +Part them; they are incens'd. + +Ham. +Nay, come again! + +[The Queen falls.] + +Osr. +Look to the queen there, ho! + +Hor. +They bleed on both sides.--How is it, my lord? + +Osr. +How is't, Laertes? + +Laer. +Why, as a woodcock to my own springe, Osric; +I am justly kill'd with mine own treachery. + +Ham. +How does the Queen? + +King. +She swoons to see them bleed. + +Queen. +No, no! the drink, the drink!--O my dear Hamlet!-- +The drink, the drink!--I am poison'd. + +[Dies.] + +Ham. +O villany!--Ho! let the door be lock'd: +Treachery! seek it out. + +[Laertes falls.] + +Laer. +It is here, Hamlet: Hamlet, thou art slain; +No medicine in the world can do thee good; +In thee there is not half an hour of life; +The treacherous instrument is in thy hand, +Unbated and envenom'd: the foul practice +Hath turn'd itself on me; lo, here I lie, +Never to rise again: thy mother's poison'd: +I can no more:--the king, the king's to blame. + +Ham. +The point envenom'd too!-- +Then, venom, to thy work. + +[Stabs the King.] + +Osric and Lords. +Treason! treason! + +King. +O, yet defend me, friends! I am but hurt. + +Ham. +Here, thou incestuous, murderous, damned Dane, +Drink off this potion.--Is thy union here? +Follow my mother. + +[King dies.] + +Laer. +He is justly serv'd; +It is a poison temper'd by himself.-- +Exchange forgiveness with me, noble Hamlet: +Mine and my father's death come not upon thee, +Nor thine on me! + +[Dies.] + +Ham. +Heaven make thee free of it! I follow thee.-- +I am dead, Horatio.--Wretched queen, adieu!-- +You that look pale and tremble at this chance, +That are but mutes or audience to this act, +Had I but time,--as this fell sergeant, death, +Is strict in his arrest,--O, I could tell you,-- +But let it be.--Horatio, I am dead; +Thou liv'st; report me and my cause aright +To the unsatisfied. + +Hor. +Never believe it: +I am more an antique Roman than a Dane.-- +Here's yet some liquor left. + +Ham. +As thou'rt a man, +Give me the cup; let go; by heaven, I'll have't.-- +O good Horatio, what a wounded name, +Things standing thus unknown, shall live behind me! +If thou didst ever hold me in thy heart, +Absent thee from felicity awhile, +And in this harsh world draw thy breath in pain, +To tell my story.-- + +[March afar off, and shot within.] + +What warlike noise is this? + +Osr. +Young Fortinbras, with conquest come from Poland, +To the ambassadors of England gives +This warlike volley. + +Ham. +O, I die, Horatio; +The potent poison quite o'er-crows my spirit: +I cannot live to hear the news from England; +But I do prophesy the election lights +On Fortinbras: he has my dying voice; +So tell him, with the occurrents, more and less, +Which have solicited.--the rest is silence. + +[Dies.] + +Hor. +Now cracks a noble heart.--Good night, sweet prince, +And flights of angels sing thee to thy rest! +Why does the drum come hither? + +[March within.] + +[Enter Fortinbras, the English Ambassadors, and others.] + +Fort. +Where is this sight? + +Hor. +What is it you will see? +If aught of woe or wonder, cease your search. + +Fort. +This quarry cries on havoc.--O proud death, +What feast is toward in thine eternal cell, +That thou so many princes at a shot +So bloodily hast struck? + +1 Ambassador. +The sight is dismal; +And our affairs from England come too late: +The ears are senseless that should give us hearing, +To tell him his commandment is fulfill'd +That Rosencrantz and Guildenstern are dead: +Where should we have our thanks? + +Hor. +Not from his mouth, +Had it the ability of life to thank you: +He never gave commandment for their death. +But since, so jump upon this bloody question, +You from the Polack wars, and you from England, +Are here arriv'd, give order that these bodies +High on a stage be placed to the view; +And let me speak to the yet unknowing world +How these things came about: so shall you hear +Of carnal, bloody and unnatural acts; +Of accidental judgments, casual slaughters; +Of deaths put on by cunning and forc'd cause; +And, in this upshot, purposes mistook +Fall'n on the inventors' heads: all this can I +Truly deliver. + +Fort. +Let us haste to hear it, +And call the noblest to the audience. +For me, with sorrow I embrace my fortune: +I have some rights of memory in this kingdom, +Which now, to claim my vantage doth invite me. + +Hor. +Of that I shall have also cause to speak, +And from his mouth whose voice will draw on more: +But let this same be presently perform'd, +Even while men's minds are wild: lest more mischance +On plots and errors happen. + +Fort. +Let four captains +Bear Hamlet like a soldier to the stage; +For he was likely, had he been put on, +To have prov'd most royally: and, for his passage, +The soldiers' music and the rites of war +Speak loudly for him.-- +Take up the bodies.--Such a sight as this +Becomes the field, but here shows much amiss. +Go, bid the soldiers shoot. + +[A dead march.] + +[Exeunt, bearing off the dead bodies; after the which a peal of +ordnance is shot off.] + + + + + +The End of Project Gutenberg Etext of Hamlet by Shakespeare +PG has multiple editions of William Shakespeare's Complete Works + diff --git a/hotels.txt b/hotels.txt new file mode 100644 index 0000000..b69466b --- /dev/null +++ b/hotels.txt @@ -0,0 +1,505 @@ +Hotel name;Nr. rooms;Pool;Gym;Tennis court;Spa;Casino;Traveler type;Period of stay;Score +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Friends;Dec-Feb;5 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Business;Dec-Feb;3 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Mar-May;5 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Friends;Mar-May;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Solo;Mar-May;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Couples;Mar-May;3 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Couples;Mar-May;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Mar-May;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Friends;Mar-May;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Mar-May;3 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Jun-Aug;2 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Friends;Jun-Aug;3 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Friends;Jun-Aug;2 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Friends;Jun-Aug;3 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Friends;Jun-Aug;3 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Jun-Aug;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Sep-Nov;1 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Sep-Nov;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Couples;Sep-Nov;3 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Couples;Sep-Nov;2 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Couples;Sep-Nov;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Couples;Sep-Nov;1 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Families;Dec-Feb;4 +Circus Circus Hotel & Casino Las Vegas;3773;NO;YES;NO;NO;YES;Couples;Dec-Feb;2 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Business;Dec-Feb;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Business;Dec-Feb;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Solo;Mar-May;5 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Mar-May;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Solo;Mar-May;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Friends;Mar-May;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Jun-Aug;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Families;Jun-Aug;2 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Business;Sep-Nov;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Sep-Nov;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Families;Sep-Nov;3 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Friends;Sep-Nov;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Families;Sep-Nov;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Friends;Sep-Nov;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Excalibur Hotel & Casino;3981;YES;YES;NO;YES;YES;Solo;Dec-Feb;3 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Dec-Feb;3 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Solo;Dec-Feb;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Dec-Feb;2 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Mar-May;3 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Business;Mar-May;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Business;Mar-May;2 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Mar-May;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Mar-May;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Families;Jun-Aug;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Jun-Aug;3 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Solo;Jun-Aug;2 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Families;Jun-Aug;3 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Friends;Sep-Nov;3 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Sep-Nov;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Families;Sep-Nov;3 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Sep-Nov;2 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Sep-Nov;4 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Business;Sep-Nov;1 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Business;Dec-Feb;2 +Monte Carlo Resort&Casino;3003;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Business;Dec-Feb;3 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Dec-Feb;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Friends;Dec-Feb;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Solo;Dec-Feb;5 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Mar-May;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Friends;Mar-May;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Friends;Mar-May;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Families;Mar-May;3 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Families;Mar-May;3 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Friends;Mar-May;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Families;Jun-Aug;3 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Jun-Aug;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Solo;Jun-Aug;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Jun-Aug;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Jun-Aug;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Sep-Nov;3 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Business;Sep-Nov;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Families;Sep-Nov;5 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Sep-Nov;3 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Sep-Nov;5 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Families;Sep-Nov;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Friends;Dec-Feb;4 +Treasure Island- TI Hotel & Casino;2884;YES;YES;YES;YES;YES;Couples;Dec-Feb;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Families;Dec-Feb;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Friends;Dec-Feb;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Dec-Feb;3 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Business;Dec-Feb;3 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Business;Mar-May;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Mar-May;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Mar-May;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Business;Mar-May;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Mar-May;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Friends;Mar-May;3 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Business;Jun-Aug;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Friends;Jun-Aug;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Solo;Jun-Aug;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Jun-Aug;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Friends;Jun-Aug;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Sep-Nov;1 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Sep-Nov;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Friends;Sep-Nov;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Friends;Sep-Nov;2 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Solo;Sep-Nov;4 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Friends;Sep-Nov;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Couples;Dec-Feb;5 +Tropicana Las Vegas - A Double Tree by Hilton Hotel;1467;YES;YES;YES;YES;YES;Families;Dec-Feb;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Friends;Dec-Feb;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Dec-Feb;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Dec-Feb;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Mar-May;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Mar-May;3 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Mar-May;4 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Mar-May;1 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Mar-May;4 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +Caesars Palace;3348;YES;YES;NO;YES;YES;Solo;Jun-Aug;1 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Jun-Aug;3 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Business;Sep-Nov;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Sep-Nov;3 +Caesars Palace;3348;YES;YES;NO;YES;YES;Families;Dec-Feb;4 +Caesars Palace;3348;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Friends;Dec-Feb;4 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Friends;Dec-Feb;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Friends;Dec-Feb;4 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Mar-May;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Mar-May;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Friends;Mar-May;4 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Business;Mar-May;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Families;Mar-May;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Business;Mar-May;2 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Jun-Aug;2 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Friends;Jun-Aug;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Business;Jun-Aug;1 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Business;Sep-Nov;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Business;Sep-Nov;5 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Couples;Dec-Feb;2 +The Cosmopolitan Las Vegas;2959;YES;YES;NO;YES;YES;Families;Dec-Feb;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Dec-Feb;3 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Dec-Feb;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Mar-May;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Mar-May;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Mar-May;4 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Mar-May;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Mar-May;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Business;Mar-May;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Jun-Aug;3 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Friends;Jun-Aug;4 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Business;Jun-Aug;4 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Friends;Sep-Nov;3 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Sep-Nov;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Sep-Nov;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Sep-Nov;3 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +The Palazzo Resort Hotel Casino;3025;YES;YES;NO;YES;YES;Families;Dec-Feb;4 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Dec-Feb;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Families;Dec-Feb;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Dec-Feb;4 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Dec-Feb;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Friends;Mar-May;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Business;Mar-May;4 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Business;Mar-May;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Mar-May;4 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Solo;Mar-May;3 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Mar-May;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Solo;Jun-Aug;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Business;Sep-Nov;2 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Friends;Sep-Nov;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Sep-Nov;4 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Sep-Nov;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Business;Sep-Nov;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Sep-Nov;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Dec-Feb;5 +Wynn Las Vegas;2700;YES;YES;YES;YES;YES;Couples;Dec-Feb;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Solo;Dec-Feb;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Business;Dec-Feb;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Business;Dec-Feb;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Dec-Feb;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Mar-May;3 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Mar-May;4 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Mar-May;4 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Mar-May;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Business;Jun-Aug;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Jun-Aug;4 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Sep-Nov;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Sep-Nov;1 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Sep-Nov;2 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Families;Sep-Nov;4 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Business;Dec-Feb;4 +Trump International Hotel Las Vegas;1282;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +The Cromwell;188;YES;NO;NO;NO;YES;Business;Dec-Feb;3 +The Cromwell;188;YES;NO;NO;NO;YES;Business;Dec-Feb;4 +The Cromwell;188;YES;NO;NO;NO;YES;Families;Dec-Feb;5 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Dec-Feb;5 +The Cromwell;188;YES;NO;NO;NO;YES;Solo;Mar-May;2 +The Cromwell;188;YES;NO;NO;NO;YES;Friends;Mar-May;5 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Mar-May;5 +The Cromwell;188;YES;NO;NO;NO;YES;Families;Mar-May;2 +The Cromwell;188;YES;NO;NO;NO;YES;Friends;Mar-May;5 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Mar-May;5 +The Cromwell;188;YES;NO;NO;NO;YES;Friends;Jun-Aug;5 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Jun-Aug;5 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Jun-Aug;5 +The Cromwell;188;YES;NO;NO;NO;YES;Friends;Jun-Aug;1 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Jun-Aug;5 +The Cromwell;188;YES;NO;NO;NO;YES;Families;Jun-Aug;4 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Sep-Nov;5 +The Cromwell;188;YES;NO;NO;NO;YES;Business;Sep-Nov;4 +The Cromwell;188;YES;NO;NO;NO;YES;Families;Sep-Nov;3 +The Cromwell;188;YES;NO;NO;NO;YES;Friends;Sep-Nov;5 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Sep-Nov;3 +The Cromwell;188;YES;NO;NO;NO;YES;Business;Sep-Nov;4 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Dec-Feb;4 +The Cromwell;188;YES;NO;NO;NO;YES;Couples;Dec-Feb;4 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Business;Dec-Feb;1 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Business;Dec-Feb;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Friends;Mar-May;4 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Families;Mar-May;3 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Friends;Mar-May;4 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Business;Mar-May;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Friends;Mar-May;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Business;Jun-Aug;4 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Friends;Jun-Aug;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Business;Sep-Nov;4 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Friends;Dec-Feb;5 +Encore at wynn Las Vegas;2034;YES;YES;NO;YES;YES;Business;Dec-Feb;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Dec-Feb;2 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Business;Dec-Feb;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Mar-May;4 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Business;Mar-May;4 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Mar-May;4 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Mar-May;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Mar-May;1 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Friends;Jun-Aug;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Solo;Jun-Aug;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Jun-Aug;4 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Sep-Nov;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Solo;Sep-Nov;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Sep-Nov;2 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Business;Sep-Nov;4 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Sep-Nov;3 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Families;Sep-Nov;4 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Hilton Grand Vacations on the Boulevard;1228;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Business;Dec-Feb;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Business;Dec-Feb;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Families;Dec-Feb;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Business;Dec-Feb;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Friends;Mar-May;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Business;Mar-May;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Mar-May;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Mar-May;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Mar-May;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Business;Mar-May;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Families;Jun-Aug;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Families;Jun-Aug;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Jun-Aug;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Jun-Aug;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Families;Jun-Aug;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Families;Jun-Aug;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Friends;Sep-Nov;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Friends;Sep-Nov;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Business;Sep-Nov;3 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Families;Sep-Nov;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Sep-Nov;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Sep-Nov;4 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Couples;Dec-Feb;5 +Marriott's Grand Chateau;732;YES;YES;NO;NO;YES;Families;Dec-Feb;4 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Dec-Feb;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Friends;Dec-Feb;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Business;Dec-Feb;3 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Business;Dec-Feb;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Friends;Mar-May;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Mar-May;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Mar-May;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Mar-May;4 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Families;Mar-May;2 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Business;Mar-May;3 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Friends;Jun-Aug;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Jun-Aug;3 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Jun-Aug;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Business;Jun-Aug;4 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Business;Jun-Aug;3 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Jun-Aug;4 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Sep-Nov;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Sep-Nov;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Sep-Nov;3 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Business;Sep-Nov;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Couples;Sep-Nov;4 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Business;Sep-Nov;3 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Families;Dec-Feb;5 +Tuscany Las Vegas Suites & Casino;716;YES;YES;YES;YES;YES;Friends;Dec-Feb;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Business;Dec-Feb;3 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Dec-Feb;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Dec-Feb;2 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Dec-Feb;2 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Friends;Mar-May;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Mar-May;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Mar-May;3 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Mar-May;3 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Friends;Mar-May;3 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Mar-May;3 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Jun-Aug;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Jun-Aug;4 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Jun-Aug;3 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Jun-Aug;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Jun-Aug;4 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Jun-Aug;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Friends;Sep-Nov;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Business;Sep-Nov;4 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Sep-Nov;4 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Sep-Nov;4 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Business;Sep-Nov;4 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Business;Sep-Nov;5 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Couples;Dec-Feb;4 +Hilton Grand Vacations at the Flamingo;315;YES;YES;NO;NO;NO;Families;Dec-Feb;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Friends;Dec-Feb;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Dec-Feb;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Dec-Feb;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Dec-Feb;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Friends;Mar-May;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Mar-May;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Mar-May;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Mar-May;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Mar-May;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Business;Mar-May;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Jun-Aug;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Jun-Aug;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Jun-Aug;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Friends;Jun-Aug;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Jun-Aug;3 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Jun-Aug;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Friends;Sep-Nov;5 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Business;Sep-Nov;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Sep-Nov;3 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Couples;Sep-Nov;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Sep-Nov;3 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Sep-Nov;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Families;Dec-Feb;4 +Wyndham Grand Desert;787;YES;YES;YES;NO;NO;Friends;Dec-Feb;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Business;Dec-Feb;4 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Solo;Dec-Feb;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Families;Dec-Feb;4 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Mar-May;3 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Mar-May;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Mar-May;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Mar-May;4 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Families;Mar-May;4 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Mar-May;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Business;Jun-Aug;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Sep-Nov;4 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Families;Dec-Feb;5 +The Venetian Las Vegas Hotel;4027;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Solo;Dec-Feb;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Families;Dec-Feb;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Business;Dec-Feb;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Business;Mar-May;2 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Business;Mar-May;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Families;Mar-May;2 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Friends;Mar-May;3 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Business;Jun-Aug;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Families;Jun-Aug;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Solo;Jun-Aug;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Business;Sep-Nov;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Couples;Sep-Nov;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Friends;Sep-Nov;5 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Business;Dec-Feb;4 +Bellagio Las Vegas;3933;YES;YES;NO;YES;YES;Families;Dec-Feb;2 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Dec-Feb;2 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Friends;Dec-Feb;4 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Mar-May;2 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Mar-May;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Business;Mar-May;4 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Friends;Mar-May;3 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Friends;Mar-May;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Mar-May;3 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Jun-Aug;3 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Families;Jun-Aug;4 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Families;Jun-Aug;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Sep-Nov;4 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Sep-Nov;2 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Sep-Nov;4 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Couples;Dec-Feb;5 +Paris Las Vegas;2916;YES;YES;NO;YES;YES;Friends;Dec-Feb;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Dec-Feb;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Families;Dec-Feb;3 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Solo;Dec-Feb;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Dec-Feb;3 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Business;Mar-May;5 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Friends;Mar-May;5 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Business;Mar-May;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Solo;Mar-May;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Friends;Mar-May;3 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Mar-May;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Solo;Jun-Aug;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Business;Jun-Aug;3 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Families;Jun-Aug;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Jun-Aug;5 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Families;Jun-Aug;3 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Jun-Aug;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Solo;Sep-Nov;5 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Sep-Nov;3 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Sep-Nov;5 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Couples;Sep-Nov;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Friends;Sep-Nov;4 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Families;Dec-Feb;2 +The Westin las Vegas Hotel Casino & Spa;826;YES;YES;NO;YES;YES;Families;Dec-Feb;4 diff --git a/igazi.txt b/igazi.txt new file mode 100644 index 0000000..1f8c7fe --- /dev/null +++ b/igazi.txt @@ -0,0 +1,35 @@ +az +igazi +programozó +a +szimbólum +manipulációt +fortranban +csinálja +az +igazi +programozó +a +szövegkezelést +fortranban +csinálja +az +igazi +programozó +a +gépidőelszámolást +már +ha +megcsinálja +egyáltalán +fortranban +csinálja +az +igazi +programozó +a +mesterséges +intelligencia +programokat +fortranban +csinálja diff --git a/investments.txt b/investments.txt new file mode 100644 index 0000000..f5ac4af --- /dev/null +++ b/investments.txt @@ -0,0 +1,1435 @@ +company|numEmps|category|city|state|fundedDate|raisedAmt|raisedCurrency|round +LifeLock||web|Tempe|AZ|1-May-07|6850000|USD|b +LifeLock||web|Tempe|AZ|1-Oct-06|6000000|USD|a +LifeLock||web|Tempe|AZ|1-Jan-08|25000000|USD|c +MyCityFaces|7.0|web|Scottsdale|AZ|1-Jan-08|50000|USD|seed +Flypaper||web|Phoenix|AZ|1-Feb-08|3000000|USD|a +Infusionsoft|105.0|software|Gilbert|AZ|1-Oct-07|9000000|USD|a +gAuto|4.0|web|Scottsdale|AZ|1-Jan-08|250000|USD|seed +ChosenList.com|5.0|web|Scottsdale|AZ|1-Oct-06|140000|USD|seed +ChosenList.com|5.0|web|Scottsdale|AZ|25-Jan-08|233750|USD|angel +Digg|60.0|web|San Francisco|CA|1-Dec-06|8500000|USD|b +Digg|60.0|web|San Francisco|CA|1-Oct-05|2800000|USD|a +Facebook|450.0|web|Palo Alto|CA|1-Sep-04|500000|USD|angel +Facebook|450.0|web|Palo Alto|CA|1-May-05|12700000|USD|a +Facebook|450.0|web|Palo Alto|CA|1-Apr-06|27500000|USD|b +Facebook|450.0|web|Palo Alto|CA|1-Oct-07|300000000|USD|c +Facebook|450.0|web|Palo Alto|CA|1-Mar-08|40000000|USD|c +Facebook|450.0|web|Palo Alto|CA|15-Jan-08|15000000|USD|c +Facebook|450.0|web|Palo Alto|CA|1-May-08|100000000|USD|debt_round +Photobucket|60.0|web|Palo Alto|CA|1-May-06|10500000|USD|b +Photobucket|60.0|web|Palo Alto|CA|1-Mar-05|3000000|USD|a +Omnidrive||web|Palo Alto|CA|1-Dec-06|800000|USD|angel +Geni|18.0|web|West Hollywood|CA|1-Jan-07|1500000|USD|a +Geni|18.0|web|West Hollywood|CA|1-Mar-07|10000000|USD|b +Twitter|17.0|web|San Francisco|CA|1-Jul-07|5400000|USD|b +Twitter|17.0|web|San Francisco|CA|1-May-08|15000000|USD|c +StumbleUpon||web|San Francisco|CA|1-Dec-05|1500000|USD|seed +Gizmoz||web|Menlo Park|CA|1-May-07|6300000|USD|a +Gizmoz||web|Menlo Park|CA|16-Mar-08|6500000|USD|b +Scribd|14.0|web|San Francisco|CA|1-Jun-06|12000|USD|seed +Scribd|14.0|web|San Francisco|CA|1-Jan-07|40000|USD|angel +Scribd|14.0|web|San Francisco|CA|1-Jun-07|3710000|USD|a +Slacker||web|San Diego|CA|1-Jun-07|40000000|USD|b +Slacker||web|San Diego|CA|1-Jun-07|13500000|USD|a +Lala||web|Palo Alto|CA|1-May-07|9000000|USD|a +Plaxo|50.0|web|Mountain View|CA|1-Nov-02|3800000|USD|a +Plaxo|50.0|web|Mountain View|CA|1-Jul-03|8500000|USD|b +Plaxo|50.0|web|Mountain View|CA|1-Apr-04|7000000|USD|c +Plaxo|50.0|web|Mountain View|CA|1-Feb-07|9000000|USD|d +Powerset|60.0|web|San Francisco|CA|1-Jun-07|12500000|USD|a +Technorati|25.0|web|San Francisco|CA|1-Jun-06|10520000|USD|c +Technorati|25.0|web|San Francisco|CA|1-Sep-04|6500000|USD|b +Technorati|25.0|web|San Francisco|CA|13-Jun-08|7500000|USD|d +Technorati|25.0|web|San Francisco|CA|10-May-07|1000000|USD|c +Mahalo|40.0|web|Santa Monica|CA|1-Jan-06|5000000|USD|a +Mahalo|40.0|web|Santa Monica|CA|1-Jan-07|16000000|USD|b +Kyte|40.0|web|San Francisco|CA|1-Jul-07|2250000|USD|a +Kyte|40.0|web|San Francisco|CA|1-Dec-07|15000000|USD|b +Kyte|40.0|web|San Francisco|CA|10-Mar-08|6100000|USD|b +Veoh||web|San Diego|CA|1-Apr-06|12500000|USD|b +Veoh||web|San Diego|CA|1-Aug-07|25000000|USD|c +Veoh||web|San Diego|CA|1-Jul-05|2250000|USD|a +Veoh||web|San Diego|CA|3-Jun-08|30000000|USD|d +Jingle Networks||web|Menlo Park|CA|1-Oct-06|30000000|USD|c +Jingle Networks||web|Menlo Park|CA|1-Dec-05|5000000|USD|a +Jingle Networks||web|Menlo Park|CA|1-Apr-06|26000000|USD|b +Jingle Networks||web|Menlo Park|CA|1-Oct-05|400000|USD|angel +Jingle Networks||web|Menlo Park|CA|1-Jan-08|13000000|USD|c +Ning|41.0|web|Palo Alto|CA|1-Jul-07|44000000|USD|c +Ning|41.0|web|Palo Alto|CA|1-Apr-08|60000000|USD|d +JotSpot||web|Palo Alto|CA|1-Aug-04|5200000|USD|a +Mercora||web|Sunnyvale|CA|1-Jan-05|5000000|USD|a +Wesabe||web|San Francisco|CA|1-Feb-07|700000|USD|seed +Wesabe||web|San Francisco|CA|1-Jun-07|4000000|USD|a +Jangl|22.0|web|Pleasanton|CA|1-Jul-06|7000000|USD|b +Hyphen 8|4.0|web|San Francisco|CA|1-Oct-07|100000|USD|angel +Prosper||web|San Francisco|CA|1-Jun-07|20000000|USD|c +Prosper||web|San Francisco|CA|1-Apr-05|7500000|USD|a +Prosper||web|San Francisco|CA|1-Feb-06|12500000|USD|b +Google|20000.0|web|Mountain View|CA|1-Jun-99|25000000|USD|a +Jajah|80.0|web|Mountain View|CA|1-May-07|20000000|USD|c +Jajah|80.0|web|Mountain View|CA|1-Mar-06|3000000|USD|a +Jajah|80.0|web|Mountain View|CA|1-Apr-06|5000000|USD|b +YouTube||web|San Bruno|CA|1-Nov-05|3500000|USD|a +YouTube||web|San Bruno|CA|1-Apr-06|8000000|USD|b +Ustream||web|Mountain View|CA|1-Dec-07|2000000|USD|angel +Ustream||web|Mountain View|CA|10-Apr-08|11100000|USD|a +GizmoProject||web|San Diego|CA|1-Feb-06|6000000|USD|a +Adap.tv|15.0|web|San Mateo|CA|1-Jul-07|10000000|USD|a +Topix||web|Palo Alto|CA|1-Nov-06|15000000|USD|b +Revision3||web|San Francisco|CA|1-Sep-06|1000000|USD|a +Revision3||web|San Francisco|CA|1-Jun-07|8000000|USD|b +Aggregate Knowledge||web|San Mateo|CA|1-Jun-06|5000000|USD|a +Aggregate Knowledge||web|San Mateo|CA|1-Apr-07|20000000|USD|b +Sugar Inc||web|San Francisco|CA|1-Oct-06|5000000|USD|a +Sugar Inc||web|San Francisco|CA|1-Jun-07|10000000|USD|b +Zing||web|Mountain View|CA|1-Jan-07|13000000|USD|a +CriticalMetrics|4.0|web||CA|1-Jan-07|100000|USD|angel +Spock|30.0|web|Redwood City|CA|1-Dec-06|7000000|USD|a +Wize||web||CA|1-Jan-07|4000000|USD|a +SodaHead||web||CA|1-Jan-07|4250000|USD|a +SodaHead||web||CA|25-Jun-08|8400000|USD|b +CastTV|0.0|web|San Francisco|CA|1-Apr-07|3100000|USD|a +BuzzNet||web|Hollywood|CA|1-May-07|6000000|USD|a +BuzzNet||web|Hollywood|CA|7-Apr-08|25000000|USD|b +Funny Or Die||web|Palo Alto|CA|1-Dec-07|15000000|USD|b +Sphere|11.0|web|San Francisco|CA|1-May-06|3000000|USD|b +Sphere|11.0|web|San Francisco|CA|1-Apr-05|500000|USD|a +MeeVee||web|Burlingame|CA|1-Feb-06|6500000|USD|b +MeeVee||web|Burlingame|CA|1-Aug-06|8000000|USD|c +MeeVee||web|Burlingame|CA|1-Feb-05|7000000|USD|a +MeeVee||web|Burlingame|CA|1-Sep-07|3500000|USD|d +Mashery|0.0|web|San Francisco|CA|26-Jun-08|2000000|USD|c +Yelp||web|San Francisco|CA|1-Oct-06|10000000|USD|c +Yelp||web|San Francisco|CA|1-Oct-05|5000000|USD|b +Yelp||web|San Francisco|CA|1-Jul-04|1000000|USD|a +Yelp||web|San Francisco|CA|26-Feb-08|15000000|USD|d +Spotplex|3.0|web|Santa Clara|CA|1-Jan-07|450000|USD|angel +Coghead|21.0|web|Redwood City|CA|1-Mar-06|3200000|USD|a +Coghead|21.0|web|Redwood City|CA|1-Mar-07|8000000|USD|b +Zooomr||web|San Francisco|CA|1-Feb-06|50000|USD|angel +SideStep|75.0|web|Santa Clara|CA|1-Feb-07|15000000|USD|c +SideStep|75.0|web|Santa Clara|CA|1-Jan-04|8000000|USD|b +SideStep|75.0|web|Santa Clara|CA|1-Dec-99|2200000|USD|a +SideStep|75.0|web|Santa Clara|CA|1-Oct-00|6800000|USD|a +RockYou||web|San Mateo|CA|1-Jan-07|1500000|USD|a +RockYou||web|San Mateo|CA|1-Mar-07|15000000|USD|b +RockYou||web|San Mateo|CA|9-Jun-08|35000000|USD|c +RockYou||web|San Mateo|CA|27-May-08|1000000|USD|unattributed +Pageflakes|20.0|web|San Francisco|CA|1-May-06|1300000|USD|a +Swivel||web|San Francisco|CA|1-Sep-06|1000000|USD|a +Swivel||web|San Francisco|CA|1-Apr-07|1000000|USD|a +Slide|64.0|web|San Francisco|CA|1-Jul-05|8000000|USD|b +Slide|64.0|web|San Francisco|CA|1-Jan-08|50000000|USD|d +Bebo||web|San Francisco|CA|1-May-06|15000000|USD|a +freebase||web|San Francisco|CA|1-Mar-06|15000000|USD|a +freebase||web|San Francisco|CA|1-Jan-08|42500000|USD|b +Metaweb Technologies||web|San Francisco|CA|15-Jan-08|42000000|USD|b +Glam Media||web|Brisbane|CA|1-Jul-04|1100000|USD|a +Glam Media||web|Brisbane|CA|1-Jul-05|10000000|USD|b +Glam Media||web|Brisbane|CA|1-Dec-06|18500000|USD|c +Glam Media||web|Brisbane|CA|1-Feb-08|65000000|USD|d +Glam Media||web|Brisbane|CA|1-Feb-08|20000000|USD|d +TheFind||web|Mountain View|CA|1-Feb-05|7000000|USD|a +TheFind||web|Mountain View|CA|1-Oct-06|4000000|USD|b +TheFind||web|Mountain View|CA|1-Jul-07|15000000|USD|c +Zazzle||web|Redwood City|CA|1-Jul-05|16000000|USD|a +Zazzle||web|Redwood City|CA|1-Oct-07|30000000|USD|b +Dogster||web|San Francisco|CA|1-Sep-06|1000000|USD|angel +Pandora|80.0|web|Oakland|CA|1-Jan-04|7800000|USD|b +Pandora|80.0|web|Oakland|CA|1-Oct-05|12000000|USD|c +Pandora|80.0|web|Oakland|CA|2-Mar-00|1500000|USD|a +Cafepress|300.0|web|Foster City|CA|1-Mar-00|1200000|USD|a +Cafepress|300.0|web|Foster City|CA|1-May-01|300000|USD|a +Cafepress|300.0|web|Foster City|CA|1-Feb-05|14000000|USD|b +pbwiki|15.0|web||CA|11-Sep-06|350000|USD|a +pbwiki|15.0|web||CA|1-Feb-07|2100000|USD|b +AdBrite||web|San Francisco|CA|1-Sep-04|4000000|USD|a +AdBrite||web|San Francisco|CA|1-Feb-06|8000000|USD|b +AdBrite||web|San Francisco|CA|1-Nov-07|23000000|USD|c +Loomia||web|San Francisco|CA|1-Jun-05|1000000|USD|seed +Loomia||web|San Francisco|CA|1-Apr-08|5000000|USD|a +Meebo|40.0|web|Mountain View|CA|1-Dec-05|3500000|USD|a +Meebo|40.0|web|Mountain View|CA|1-Jan-07|9000000|USD|b +Meebo|40.0|web|Mountain View|CA|30-Apr-08|25000000|USD|c +Eventbrite|13.0|web|San Francisco|CA|1-Nov-06|100000|USD|angel +LinkedIn||web|Mountain View|CA|1-Nov-03|4700000|USD|a +LinkedIn||web|Mountain View|CA|1-Oct-04|10000000|USD|b +LinkedIn||web|Mountain View|CA|1-Jan-07|12800000|USD|c +LinkedIn||web|Mountain View|CA|17-Jun-08|53000000|USD|d +FlickIM||web|Berkeley|CA|1-Mar-07|1600000|USD|a +Terabitz|12.0|web|Palo Alto|CA|1-Feb-07|10000000|USD|a +Healthline||web|San Francisco|CA|1-Jan-06|14000000|USD|a +Healthline||web|San Francisco|CA|1-Jul-07|21000000|USD|b +Box.net|19.0|web|Palo Alto|CA|1-Oct-06|1500000|USD|a +Box.net|19.0|web|Palo Alto|CA|23-Jan-08|6000000|USD|b +Conduit||web|Redwood Shores|CA|1-Jul-06|1800000|USD|a +Conduit||web|Redwood Shores|CA|1-Jan-08|8000000|USD|b +Edgeio||web|Palo Alto|CA|1-Jul-07|5000000|USD|a +Spot Runner||web|Los Angeles|CA|1-Jan-06|10000000|USD|a +Spot Runner||web|Los Angeles|CA|1-Oct-06|40000000|USD|b +Spot Runner||web|Los Angeles|CA|7-May-08|51000000|USD|c +Kaboodle||web|Santa Clara|CA|1-Mar-05|1500000|USD|a +Kaboodle||web|Santa Clara|CA|1-Mar-06|2000000|USD|b +Kaboodle||web|Santa Clara|CA|1-Mar-07|1500000|USD|c +Giga Omni Media|18.0|web|San Francisco|CA|1-Jun-06|325000|USD|a +Visible Path||web|Foster City|CA|1-Mar-06|17000000|USD|b +Visible Path||web|Foster City|CA|1-Mar-06|7700000|USD|a +Wink||web|Mountain View|CA|1-Jan-05|6200000|USD|a +seesmic||web|San Francisco|CA|1-Nov-07|6000000|USD|a +seesmic||web|San Francisco|CA|20-Jun-08|6000000|USD|b +Zvents||web|San Mateo|CA|7-Nov-06|7000000|USD|a +Zvents||web|San Mateo|CA|5-Oct-05|200000|USD|seed +Eventful|35.0|web|San Diego|CA|1-Sep-06|7500000|USD|b +Eventful|35.0|web|San Diego|CA|1-Mar-05|2100000|USD|a +Oodle||web|San Mateo|CA|1-May-06|5000000|USD|a +Oodle||web|San Mateo|CA|1-Jul-07|11000000|USD|b +oDesk||web|Menlo Park|CA|1-Apr-06|6000000|USD|a +oDesk||web|Menlo Park|CA|1-Sep-06|8000000|USD|b +oDesk||web|Menlo Park|CA|1-Jun-08|15000000|USD|c +SimplyHired||web|Mountain View|CA|1-Mar-06|13500000|USD|b +SimplyHired||web|Mountain View|CA|5-Aug-05|3000000|USD|a +ooma|47.0|web|Palo Alto|CA|1-Jan-05|8000000|USD|a +ooma|47.0|web|Palo Alto|CA|1-Dec-06|18000000|USD|b +GoingOn|3.0|web|Woodside|CA|1-Aug-05|1000000|USD|seed +Flixster|17.0|web|San Francisco|CA|1-Feb-07|2000000|USD|a +Flixster|17.0|web|San Francisco|CA|4-Apr-08|5000000|USD|b +Piczo||web|San Francisco|CA|1-Jan-07|11000000|USD|c +Socialtext||web|Palo Alto|CA|1-Jun-04|300000|USD|angel +Socialtext||web|Palo Alto|CA|1-Jun-05|3100000|USD|b +Socialtext||web|Palo Alto|CA|1-Nov-07|9500000|USD|c +PowerReview||web|Millbrae|CA|1-Dec-05|6250000|USD|a +PowerReview||web|Millbrae|CA|1-Sep-07|15000000|USD|b +hi5|100.0|web|San Francisco|CA|1-Jul-07|20000000|USD|a +hi5|100.0|web|San Francisco|CA|1-Dec-07|15000000|USD|debt_round +Tagged||web|San Francisco|CA|1-Sep-05|1500000|USD|angel +Tagged||web|San Francisco|CA|1-Dec-05|7000000|USD|a +Tagged||web|San Francisco|CA|1-Jul-07|15000000|USD|b +Jaxtr||web|Menlo Park|CA|1-Jul-07|1500000|USD|angel +Jaxtr||web|Menlo Park|CA|1-Aug-07|10000000|USD|a +Jaxtr||web|Menlo Park|CA|23-Jun-08|10000000|USD|b +Me||web|San Jose|CA|1-May-07|1500000|USD|seed +introNetworks|9.0|web|Santa Barbara|CA|1-May-07|2700000|USD|a +Leverage Software|21.0|web|San Francisco|CA|14-May-05|6000000|USD|a +Lithium Technologies|42.0|web|Emeryville|CA|17-Apr-07|9000000|USD|a +Lithium Technologies|42.0|web|Emeryville|CA|1-Jun-08|12000000|USD|b +Genius||web|San Mateo|CA|1-Mar-06|5100000|USD|a +Genius||web|San Mateo|CA|1-Jan-07|10000000|USD|b +Genius||web|San Mateo|CA|5-Feb-08|19000000|USD|c +Respectance||web|San Francisco|CA|1-Jun-07|250000|USD|seed +Respectance||web|San Francisco|CA|1-Jul-07|1500000|USD|a +Curse||web|San Francisco|CA|1-Jul-07|5000000|USD|a +LicketyShip||web|San Francisco|CA|1-Dec-07|1500000|USD|angel +Grockit|8.0|web|San Francisco|CA|1-Jun-07|2300000|USD|a +Grockit|8.0|web|San Francisco|CA|30-May-08|8000000|USD|b +PeerMe||web|Mountain View|CA|1-Jan-05|5000000|USD|a +Kiptronic|20.0|web|San Francisco|CA|1-Dec-06|4000000|USD|a +Kiptronic|20.0|web|San Francisco|CA|1-Nov-05|300000|USD|angel +Kiptronic|20.0|web|San Francisco|CA|5-Jun-08|3000000|USD|b +Vuze||web|Palo Alto|CA|1-Dec-06|12000000|USD|b +Vuze||web|Palo Alto|CA|1-Dec-07|20000000|USD|c +Phonezoo||web|Sunnyvale|CA|1-Jun-06|560000|USD|a +Phonezoo||web|Sunnyvale|CA|1-Feb-07|1500000|USD|a +Droplet Technology||web|Menlo Park|CA|1-Oct-06|3500000|USD|a +PodTech||web|Palo Alto|CA|1-Mar-06|5500000|USD|a +PodTech||web|Palo Alto|CA|1-Jun-07|2000000|USD|a +Crackle||web|Mill Valley|CA|1-Dec-05|1750000|USD|a +Reddit||web|San Francisco|CA|1-Jun-05|100000|USD|seed +Wikia||web|San Mateo|CA|1-Mar-06|4000000|USD|a +Wikia||web|San Mateo|CA|1-Dec-06|10000000|USD|b +Retrevo||web|Sunnyvale|CA|1-Dec-06|3200000|USD|a +Retrevo||web|Sunnyvale|CA|1-Feb-06|700000|USD|seed +Retrevo||web|Sunnyvale|CA|20-Mar-08|8000000|USD|b +Buxfer|2.0|web|Mountain View|CA|1-Jan-07|15000|USD|seed +Buxfer|2.0|web|Mountain View|CA|1-Apr-07|300000|USD|angel +YouSendIt|0.0|web|Campbell|CA|24-Apr-07|10000000|USD|b +YouSendIt|0.0|web|Campbell|CA|1-Aug-05|10000000|USD|a +YouSendIt|0.0|web|Campbell|CA|15-Jul-08|14000000|USD|c +Tangler||web|Mountain View|CA|1-Jul-06|1500000|USD|angel +obopay||web|Redwood City|CA|1-Feb-06|10000000|USD|a +obopay||web|Redwood City|CA|1-Sep-06|7000000|USD|b +obopay||web|Redwood City|CA|1-Jul-07|29000000|USD|c +obopay||web|Redwood City|CA|21-Apr-08|20000000|USD|d +PayPal||web|San Jose|CA|1-Apr-00|100000000|USD|c +PayPal||web|San Jose|CA|1-Feb-01|90000000|USD|d +PayPal||web|San Jose|CA|1-Jul-99|4000000|USD|b +TalkPlus||web|San Mateo|CA|1-Oct-06|5500000|USD|a +Vudu|50.0|hardware|Santa Clara|CA|1-Jun-05|21000000|USD|a +Insider Pages||web|Redwood City|CA|1-Mar-06|8500000|USD|a +Snapfish||web|San Francisco|CA|1-Nov-99|7500000|USD|a +Snapfish||web|San Francisco|CA|1-May-00|36000000|USD|b +Affinity Circles|22.0|web|Mountain View|CA|1-May-06|4100000|USD|c +Affinity Circles|22.0|web|Mountain View|CA|1-Jun-05|1000000|USD|b +Affinity Circles|22.0|web|Mountain View|CA|1-Dec-04|440000|USD|a +IMVU||web|Palo Alto|CA|1-Feb-06|1000000|USD|angel +Nirvanix||web|San Diego|CA|19-Dec-07|18000000|USD|a +Habit Industries|4.0|web|Palo Alto|CA|1-Jun-07|15000|USD|seed +Gaia||web|San Jose|CA|1-Jun-06|8930000|USD|a +Gaia||web|San Jose|CA|1-Mar-07|12000000|USD|b +Gaia||web|San Jose|CA|14-Jul-08|11000000|USD|c +GreatCall||web|Del Mar|CA|1-Aug-07|36600000|USD|a +Revver||web|Los Angeles|CA|1-Nov-05|4000000|USD|a +Revver||web|Los Angeles|CA|1-Apr-06|8700000|USD|b +Metacafe||web|Palo Alto|CA|1-Jul-06|15000000|USD|b +Metacafe||web|Palo Alto|CA|1-Aug-07|30000000|USD|c +Flock|40.0|web|Redwood City|CA|1-Nov-05|3300000|USD|b +Flock|40.0|web|Redwood City|CA|1-Jun-06|10000000|USD|c +Flock|40.0|web|Redwood City|CA|21-May-08|15000000|USD|d +VMIX Media|42.0|web|San Diego|CA|1-Mar-06|5000000|USD|a +VMIX Media|42.0|web|San Diego|CA|1-Oct-07|16500000|USD|b +Kontera||web|San Francisco|CA|1-Aug-07|10300000|USD|b +Kontera||web|San Francisco|CA|1-Jul-06|7000000|USD|a +Tokbox||web|San Francisco|CA|1-Oct-07|4000000|USD|a +Tokbox||web|San Francisco|CA|6-Aug-08|10000000|USD|b +Six Apart|150.0|web|San Francisco|CA|1-Oct-04|10000000|USD|b +Six Apart|150.0|web|San Francisco|CA|1-Mar-06|12000000|USD|c +Six Apart|150.0|web|San Francisco|CA|23-Apr-03|600000|USD|a +Weebly||web|San Francisco|CA|1-May-07|650000|USD|seed +Synthasite|26.0|web|San Francisco|CA|1-Nov-07|5000000|USD|a +BitTorrent|29.0|web|San Francisco|CA|1-Sep-05|8750000|USD|a +BitTorrent|29.0|web|San Francisco|CA|1-Dec-06|25000000|USD|b +Kongregate|16.0|web|San Francisco|CA|1-Mar-07|1000000|USD|a +Kongregate|16.0|web|San Francisco|CA|1-Aug-07|5000000|USD|b +Kongregate|16.0|web|San Francisco|CA|1-Apr-08|3000000|USD|b +DanceJam|0.0|web|San Francisco|CA|1-May-07|1000000|USD|angel +DanceJam|0.0|web|San Francisco|CA|1-Feb-08|3500000|USD|a +Fathom Online||web|San Francisco|CA|1-Jul-04|6000000|USD|a +Zivity|16.0|web|San Francisco|CA|1-Aug-07|1000000|USD|seed +Zivity|16.0|web|San Francisco|CA|1-Mar-08|7000000|USD|b +BlueLithium|135.0|web|San Jose|CA|1-Feb-05|11500000|USD|a +eXpresso||web|Menlo Park|CA|1-Oct-07|2000000|USD|a +Doostang||web|Palo Alto|CA|1-Sep-07|3500000|USD|a +Docstoc||web|Beverly Hills|CA|1-Nov-07|750000|USD|a +Docstoc||web|Beverly Hills|CA|28-Apr-08|3250000|USD|b +Mevio||web|San Francisco|CA|1-Jul-05|8900000|USD|a +Mevio||web|San Francisco|CA|1-Sep-06|15000000|USD|b +Mevio||web|San Francisco|CA|9-Jul-08|15000000|USD|c +PureVideo Networks||web|Los Angeles|CA|1-Dec-05|5600000|USD|a +PureVideo Networks||web|Los Angeles|CA|1-Sep-07|2850000|USD|b +FilmLoop||web|Menlo Park|CA|1-Feb-05|5600000|USD|a +BitPass||web|Mountain View|CA|1-Jul-03|1500000|USD|a +BitPass||web|Mountain View|CA|1-Sep-04|11800000|USD|b +Art.com|500.0|web|Emeryville|CA|1-Feb-05|30000000|USD|a +Atom Shockwave||web|San Francisco|CA|1-Mar-01|22900000|USD|a +CinemaNow||web|Marina Del Rey|CA|1-Jul-04|11000000|USD|a +Digital Chocolate||web|San Mateo|CA|1-Dec-03|8400000|USD|a +Digital Chocolate||web|San Mateo|CA|1-Dec-03|13000000|USD|b +eHarmony||web|Pasadena|CA|1-Jun-00|3000000|USD|a +eHarmony||web|Pasadena|CA|1-Nov-04|110000000|USD|b +Friendster|465.0|web|San Francisco|CA|1-Dec-02|2400000|USD|a +Friendster|465.0|web|San Francisco|CA|1-Oct-03|13000000|USD|b +Friendster|465.0|web|San Francisco|CA|1-Aug-06|10000000|USD|c +Friendster|465.0|web|San Francisco|CA|5-Aug-08|20000000|USD|d +Greystripe||web|San Francisco|CA|1-May-07|8900000|USD|b +Sling Media||web|Foster City|CA|1-Nov-04|10500000|USD|a +Sling Media||web|Foster City|CA|1-Jul-05|4000000|USD|a +Trulia||web|San Francisco|CA|1-Dec-05|5700000|USD|b +Trulia||web|San Francisco|CA|1-May-07|10000000|USD|c +Trulia||web|San Francisco|CA|1-Sep-05|2100000|USD|a +Trulia||web|San Francisco|CA|10-Jul-08|15000000|USD|d +Lending Club||web|Sunnyvale|CA|1-May-07|2000000|USD|angel +Lending Club||web|Sunnyvale|CA|1-Aug-07|10260000|USD|a +tubemogul|15.0|web|Emeryville|CA|7-Feb-08|1500000|USD|a +Gemini||web|San Mateo|CA|1-Mar-07|20000000|USD|a +Gemini||web|San Mateo|CA|1-May-07|5000000|USD|b +Multiverse||web|Mountain View|CA|1-May-07|4175000|USD|a +Multiverse||web|Mountain View|CA|17-Apr-07|850000|USD|angel +LimeLife||mobile|Menlo Park|CA|28-Mar-06|10000000|USD|b +LimeLife||mobile|Menlo Park|CA|1-Aug-05|5000000|USD|a +LimeLife||mobile|Menlo Park|CA|24-May-07|3900000|USD|b +OpenTable||web|San Francisco|CA|1-May-99|2000000|USD|a +OpenTable||web|San Francisco|CA|1-Jan-00|10000000|USD|b +OpenTable||web|San Francisco|CA|1-Oct-00|36000000|USD|c +RooftopComedy|20.0|web|San Francisco|CA|1-May-07|2500000|USD|a +Federated Media||web|Sausalito|CA|1-Aug-07|4500000|USD|b +Federated Media||web|Sausalito|CA|1-Apr-08|50000000|USD|c +Delivery Agent||web|San Francisco|CA|1-May-07|18500000|USD|c +Delivery Agent||web|San Francisco|CA|17-May-06|11000000|USD|b +Delivery Agent||web|San Francisco|CA|29-Mar-05|5500000|USD|a +Reunion|100.0|web|Los Angeles|CA|1-Apr-07|25000000|USD|a +Mixercast||web|San Mateo|CA|1-May-05|2600000|USD|a +Mixercast||web|San Mateo|CA|1-Jan-08|6000000|USD|b +mTraks||web|San Diego|CA|1-May-07|550000|USD|angel +Xora||web|Mountain View|CA|1-May-01|7000000|USD|a +Xora||web|Mountain View|CA|1-Feb-03|4000000|USD|b +Xora||web|Mountain View|CA|1-Jun-07|4000000|USD|debt_round +Ooyala||web|Mountain View|CA|1-Jan-08|8500000|USD|b +SayNow|14.0|web|Palo Alto|CA|1-Sep-07|7500000|USD|a +Crunchyroll||web|San Francsico|CA|1-Feb-08|4050000|USD|a +CircleUp|19.0|web|Newport Beach|CA|1-Jun-07|3000000|USD|a +PixSense||web|Santa Clara|CA|1-Dec-06|5400000|USD|a +PixSense||web|Santa Clara|CA|1-Jun-07|2000000|USD|b +Danal||web|San Jose|CA|1-Jun-07|9500000|USD|a +hulu||web|Los Angeles|CA|1-Aug-07|100000000|USD|a +OurStory||web|Mountain View|CA|1-Jan-06|6300000|USD|a +Specificmedia||web|Ir vine|CA|1-Jun-06|10000000|USD|a +Specificmedia||web|Ir vine|CA|1-Nov-07|100000000|USD|b +AdMob||web|San Mateo|CA|1-Mar-07|15000000|USD|b +MySQL||web|Cupertino|CA|1-Feb-06|18500000|USD|c +MySQL||web|Cupertino|CA|1-Jun-03|19500000|USD|b +Attributor|0.0|web|Redwood City|CA|28-Jan-06|2000000|USD|a +Attributor|0.0|web|Redwood City|CA|2-Apr-08|12000000|USD|c +Attributor|0.0|web|Redwood City|CA|18-Dec-06|8000000|USD|b +Social Media|15.0|web|Palo Alto|CA|1-Sep-07|500000|USD|a +Social Media|15.0|web|Palo Alto|CA|1-Oct-07|3500000|USD|b +Demand Media||web|Santa Monica|CA|1-May-06|120000000|USD|a +Demand Media||web|Santa Monica|CA|1-Sep-06|100000000|USD|b +Demand Media||web|Santa Monica|CA|1-Sep-07|100000000|USD|c +Demand Media||web|Santa Monica|CA|24-Mar-08|35000000|USD|d +TripIt|8.0|web|San Francisco|CA|1-Apr-07|1000000|USD|seed +PubMatic|35.0|web|Palo Alto|CA|1-Jan-08|7000000|USD|a +Mint|22.0|web|Mountain View|CA|1-Oct-07|4700000|USD|a +Mint|22.0|web|Mountain View|CA|1-Oct-06|325000|USD|seed +Mint|22.0|web|Mountain View|CA|5-Mar-08|12000000|USD|b +app2you|4.0|web|La Jolla|CA|20-Nov-07|255000|USD|angel +app2you|4.0|web|La Jolla|CA|1-Oct-06|177000|USD|angel +YourStreet|6.0|web|San Francisco|CA|1-Oct-06|250000|USD|angel +Tagworld||web|Santa Monica|CA|1-Mar-06|7500000|USD|a +Tagworld||web|Santa Monica|CA|1-Dec-06|40000000|USD|b +RotoHog||web|Inglewood|CA|1-Aug-07|6000000|USD|a +ThisNext|0.0|web|Santa Monica|CA|1-Jan-08|5000000|USD|b +ThisNext|0.0|web|Santa Monica|CA|1-Jan-06|2500000|USD|a +ChessPark||web|West Palm Beach|CA|1-Jul-07|1000000|USD|angel +Break||web|Beverly Hills|CA|1-Jul-07|21400000|USD|a +MuseStorm||web|Sunnyvale|CA|1-Jul-07|1000000|USD|a +Media Machines||web|San Francisco|CA|1-Aug-07|9400000|USD|a +Ciihui||web|Burlingame|CA|1-May-07|10000000|USD|a +Ciihui||web|Burlingame|CA|1-Jan-08|13500000|USD|b +Aliph||web|San Francisco|CA|1-Jul-07|5000000|USD|a +mEgo|15.0|web|Los Angeles|CA|1-May-06|1100000|USD|angel +mEgo|15.0|web|Los Angeles|CA|1-Jul-07|2000000|USD|angel +Realius|3.0|web|Berkeley|CA|1-May-07|500000|USD|angel +Xobni|0.0|software|San Francisco|CA|1-Jun-06|12000|USD|seed +Xobni|0.0|software|San Francisco|CA|1-Nov-06|80000|USD|angel +Xobni|0.0|software|San Francisco|CA|1-Mar-07|4260000|USD|a +Spoke|0.0|web|San Mateo|CA|18-Nov-03|11700000|USD|c +Spoke|0.0|web|San Mateo|CA|24-Apr-03|9200000|USD|b +FixYa|30.0|web|San Mateo|CA|1-Jan-07|2000000|USD|a +FixYa|30.0|web|San Mateo|CA|18-Mar-08|6000000|USD|b +Mozilla|150.0|web|Mountain View|CA|15-Jul-03|2000000|USD|unattributed +BrightQube|0.0|web|Carlsbad|CA|1-May-07|200000|USD|angel +BuzzDash|0.0|web|Marina del Rey|CA|1-Sep-06|1200000|USD|angel +Urban Mapping|9.0|web|San Francisco|CA|1-May-06|400000|USD|seed +Consorte Media|0.0|web|San Francisco|CA|1-Dec-07|7000000|USD|b +ffwd||web|San Francisco|CA|1-Aug-07|1700000|USD|a +Get Satisfaction||web|San Francisco|CA|1-Sep-07|1300000|USD|a +RingCentral||web|Redwood City|CA|1-Sep-07|12000000|USD|a +RingCentral||web|Redwood City|CA|1-Feb-08|12000000|USD|b +3Jam||web|Menlo Park|CA|1-Jul-07|4000000|USD|a +PlaySpan||web|Santa Clara|CA|1-Sep-07|6500000|USD|a +Grouply|6.0|web|Redwood City|CA|1-Jun-07|935000|USD|angel +Grouply|6.0|web|Redwood City|CA|1-Jan-08|365000|USD|angel +Grouply|6.0|web|Redwood City|CA|14-Jan-08|1300000|USD|a +Graspr||web|Sunnyvale|CA|10-Jul-08|2500000|USD|a +Zannel||web|San Francisco|CA|2-Jun-08|10000000|USD|b +deca.tv||web|Santa Monica|CA|1-Sep-07|5000000|USD|a +Zimbra||web|San Mateo|CA|1-Apr-06|14500000|USD|c +FriendFeed||web|Mountain View|CA|26-Feb-08|5000000|USD|a +Rupture|15.0|web|San Francisco|CA|1-Jul-07|3000000|USD|angel +JibJab||web|Santa Monica|CA|1-Oct-07|3000000|USD|b +Rubicon Project||web|Los Angeles|CA|1-Oct-07|4000000|USD|a +Rubicon Project||web|Los Angeles|CA|1-Oct-07|2000000|USD|debt_round +Rubicon Project||web|Los Angeles|CA|28-Jan-08|15000000|USD|b +SnapLayout||web|San Francisco|CA|1-May-07|650000|USD|a +Confabb||web||CA|1-Aug-07|200000|USD|angel +UpTake||web|Palo Alto|CA|18-Dec-07|4000000|USD|a +23andMe|30.0|web|Mountain View|CA|1-May-07|9000000|USD|a +YuMe||web|Redwood City|CA|1-Oct-07|9000000|USD|b +Mochi Media||web|San Francisco|CA|12-Mar-08|4000000|USD|a +Mochi Media||web|San Francisco|CA|18-Jun-08|10000000|USD|b +Blurb||web|San Francisco|CA|1-Oct-06|12000000|USD|b +WeatherBill||web|San Francisco|CA|1-Oct-07|12600000|USD|a +Automattic|20.0|web|San Francisco|CA|1-Jul-05|1100000|USD|a +Automattic|20.0|web|San Francisco|CA|1-Jan-08|29500000|USD|b +Radar Networks||web|San Francisco|CA|1-Apr-06|5000000|USD|a +Radar Networks||web|San Francisco|CA|1-Feb-08|13000000|USD|b +Veodia|15.0|web|San Mateo|CA|12-May-08|8300000|USD|a +EchoSign||web|Palo Alto|CA|1-Oct-07|6000000|USD|a +Rollbase|0.0|web|Mountain View|CA|1-Aug-07|400000|USD|angel +Predictify|6.0|web|Redwood City|CA|25-Mar-08|4300000|USD|a +TrialPay|50.0|web|San Francisco|CA|1-Feb-08|12700000|USD|b +Socializr||web|San Francisco|CA|1-Sep-07|1500000|USD|a +Eurekster|0.0|web||CA|1-Dec-04|1350000|USD|a +Eurekster|0.0|web||CA|13-Mar-07|5500000|USD|b +Gydget||web|San Francisco|CA|1-Aug-06|1000000|USD|a +PicksPal||web|Mountain View|CA|1-Oct-07|3000000|USD|c +Gigya||web|Palo Alto|CA|1-Feb-07|3000000|USD|a +Gigya||web|Palo Alto|CA|9-Mar-08|9500000|USD|b +Songbird||web|San Francisco|CA|1-Dec-06|8000000|USD|seed +Guardian Analytics||web|Los Altos|CA|1-Oct-07|4500000|USD|b +Fora.TV||web|San Francisco|CA|1-Oct-07|4000000|USD|a +Disqus|3.0|web|San Francisco|CA|18-Mar-08|500000|USD|a +SezWho|9.0|web|Los Altos|CA|1-Oct-07|1000000|USD|a +YieldBuild||web|San Francisco|CA|3-Mar-08|6000000|USD|b +Akimbo||web|San Mateo|CA|1-Jun-06|15500000|USD|c +Akimbo||web|San Mateo|CA|1-Jul-04|12000000|USD|b +Akimbo||web|San Mateo|CA|1-Jun-03|4200000|USD|seed +Akimbo||web|San Mateo|CA|29-Feb-08|8000000|USD|d +Laszlo Systems|60.0|software|San Mateo|CA|6-Mar-08|14600000|USD|c +Laszlo Systems|60.0|software|San Mateo|CA|15-Apr-05|6250000|USD|b +BrightRoll||web|San Francisco|CA|1-Oct-07|5000000|USD|b +MerchantCircle|10.0|web|Los Altos|CA|1-Sep-07|10000000|USD|b +Minekey||web|Sunnyvale|CA|1-Aug-07|3000000|USD|a +Booking Angel||web|Hollywood|CA|1-Aug-07|100000|USD|angel +Loopt||web|Mountain View|CA|1-Jun-05|6000|USD|seed +Loopt||web|Mountain View|CA|23-Jul-07|8250000|USD|b +Fix8||web|Sherman Oaks|CA|1-Oct-07|3000000|USD|a +Fix8||web|Sherman Oaks|CA|3-Apr-08|2000000|USD|b +MyBuys||web|Redwood Shores|CA|21-Feb-07|2800000|USD|a +MyBuys||web|Redwood Shores|CA|8-Oct-07|10000000|USD|b +BlackArrow|35.0|web|San Mateo|CA|1-Oct-07|12000000|USD|b +BlackArrow|35.0|web|San Mateo|CA|1-Nov-06|14750000|USD|a +Peerflix||web|Palo Alto|CA|1-Oct-05|8000000|USD|b +Peerflix||web|Palo Alto|CA|1-Mar-05|2000000|USD|a +fatdoor||web|Palo Alto|CA|1-Nov-07|5500000|USD|a +fatdoor||web|Palo Alto|CA|1-Feb-07|1000000|USD|angel +fatdoor||web|Palo Alto|CA|1-May-07|500000|USD|debt_round +Verimatrix|100.0|web|San Diego|CA|1-Jun-06|8000000|USD|b +Verimatrix|100.0|web|San Diego|CA|1-Oct-07|5000000|USD|c +Billeo||web|Santa Clara|CA|1-Nov-07|7000000|USD|b +Billeo||web|Santa Clara|CA|1-Apr-06|4000000|USD|a +Caring.com||web|San Mateo|CA|1-Sep-07|6000000|USD|a +Ask.com|475.0|web|Oakland|CA|1-Mar-99|25000000|USD|a +Project Playlist||web|Palo Alto|CA|1-Sep-07|3000000|USD|a +Blowtorch||web|Sausalito|CA|1-Nov-07|50000000|USD|a +GameLayers||web|San Francisco|CA|1-Oct-07|500000|USD|seed +MoGreet||web|Venice|CA|1-Aug-07|1200000|USD|a +MoGreet||web|Venice|CA|20-Jun-08|2500000|USD|b +YourTrumanShow||web|San Francisco|CA|1-Dec-06|1300000|USD|angel +Apprema||web|Sunnyvale|CA|1-Nov-07|800000|USD|debt_round +TrustedID|100.0|web|Redwood City|CA|1-Jan-07|5000000|USD|a +TrustedID|100.0|web|Redwood City|CA|18-Oct-07|10000000|USD|b +Seeqpod|25.0|web|Emeryville|CA|1-Apr-08|7000000|USD|angel +Quantenna||web|Sunnyvale|CA|1-Nov-07|12700000|USD|b +Qwaq||web|Palo Alto|CA|1-Nov-07|7000000|USD|b +uber|24.0|web|Beverly Hills|CA|26-May-08|7600000|USD|b +CashView||web|Palo Alto|CA|1-Sep-07|6500000|USD|b +CrossLoop|8.0|web|Monterey|CA|1-Dec-07|3000000|USD|a +Dapper|20.0|web|San Francisco|CA|1-Dec-07|3000000|USD|a +Anchor Intelligence||web|Mountain View|CA|1-Jan-07|2000000|USD|a +Anchor Intelligence||web|Mountain View|CA|1-Sep-07|4000000|USD|b +EdgeCast|30.0|web|Los Angeles|CA|1-Dec-07|6000000|USD|b +EdgeCast|30.0|web|Los Angeles|CA|1-Jun-07|4000000|USD|a +Kosmix||web|Mountain View|CA|1-Dec-07|10000000|USD|c +GoodReads||web|Santa Monica|CA|1-Nov-07|750000|USD|angel +Ribbit|28.0|web|Mountain View|CA|1-Dec-07|10000000|USD|b +Ribbit|28.0|web|Mountain View|CA|1-Oct-06|3000000|USD|a +Jobvite||web|San Francisco|CA|1-Dec-07|7200000|USD|a +Juice Wireless||web|Los Angeles|CA|1-Apr-05|500000|USD|a +Juice Wireless||web|Los Angeles|CA|1-Jan-06|1500000|USD|a +Juice Wireless||web|Los Angeles|CA|1-Jul-06|4000000|USD|a +Juice Wireless||web|Los Angeles|CA|1-Mar-07|3300000|USD|b +Juice Wireless||web|Los Angeles|CA|1-Dec-07|6000000|USD|c +Qik|22.0|web|Foster City|CA|9-Apr-08|3000000|USD|b +PlayFirst||web|San Francisco|CA|1-Dec-07|16500000|USD|c +PlayFirst||web|San Francisco|CA|1-Jan-06|5000000|USD|b +Mobissimo|15.0|web|San Francisco|CA|1-Apr-04|1000000|USD|seed +Chumby|20.0|hardware|San Diego|CA|1-Dec-06|5000000|USD|a +Chumby|20.0|hardware|San Diego|CA|31-Mar-08|12500000|USD|b +UGOBE||web|Emeryville|CA|1-Oct-06|8000000|USD|b +Ausra|4.0|web|Palo Alto|CA|1-Sep-07|40000000|USD|a +Causes||web|Berkeley|CA|1-Jan-07|2350000|USD|a +Causes||web|Berkeley|CA|1-Mar-08|5000000|USD|b +Nanosolar||web|San Jose|CA|1-May-05|20000000|USD|b +Nanosolar||web|San Jose|CA|1-Jun-06|75000000|USD|c +Shozu||web|San Francisco|CA|1-May-05|12000000|USD|b +Shozu||web|San Francisco|CA|29-Jan-08|12000000|USD|c +Tesla Motors|270.0|hardware|San Carlos|CA|1-May-06|40000000|USD|c +Tesla Motors|270.0|hardware|San Carlos|CA|1-May-07|45000000|USD|d +Tesla Motors|270.0|hardware|San Carlos|CA|1-Apr-04|7500000|USD|a +Tesla Motors|270.0|hardware|San Carlos|CA|1-Feb-05|13000000|USD|b +Tesla Motors|270.0|hardware|San Carlos|CA|8-Feb-08|40000000|USD|e +Bunchball||web|Redwood City|CA|1-Oct-06|2000000|USD|a +Bunchball||web|Redwood City|CA|13-Apr-08|4000000|USD|b +Pinger||web|San Jose|CA|1-Dec-06|8000000|USD|b +Hooja||web|Palo Alto|CA|1-Dec-07|1250000|USD|seed +TravelMuse|11.0|web|Los Altos|CA|1-May-07|3000000|USD|a +Cooking.com||web|Santa Monica|CA|1-Jan-08|7000000|USD|debt_round +Cooking.com||web|Santa Monica|CA|1-May-00|35000000|USD|e +Cooking.com||web|Santa Monica|CA|1-Apr-99|16000000|USD|b +Cooking.com||web|Santa Monica|CA|1-Oct-99|30000000|USD|c +Meraki||web|Mountain View|CA|1-Feb-07|5000000|USD|a +Meraki||web|Mountain View|CA|1-Jan-08|20000000|USD|b +SugarCRM||web|Cupertino|CA|1-Jan-08|14500000|USD|d +SugarCRM||web|Cupertino|CA|1-Oct-05|18770000|USD|c +SugarCRM||web|Cupertino|CA|1-Aug-04|2000000|USD|a +SugarCRM||web|Cupertino|CA|1-Feb-05|5750000|USD|b +Pudding Media|11.0|software|San Jose|CA|1-Jan-08|8000000|USD|a +4HomeMedia|10.0|web|Sunnyvale|CA|1-Jan-07|2850000|USD|a +Pageonce||web|Palo Alto|CA|1-Jan-08|1500000|USD|a +bluepulse|0.0|web|San Mateo|CA|1-Apr-07|6000000|USD|a +Mogad|2.0|web|San Francisco|CA|1-Aug-07|500000|USD|a +DeviceVM||web|San Jose|CA|1-Aug-06|10000000|USD|a +DeviceVM||web|San Jose|CA|1-Oct-07|10000000|USD|b +Outspark||web|San Francisco|CA|11-Apr-07|4000000|USD|a +Outspark||web|San Francisco|CA|1-Jan-08|11000000|USD|b +Engine Yard|60.0|web|San Francisco|CA|1-Jan-08|3500000|USD|a +Engine Yard|60.0|web|San Francisco|CA|13-Jul-08|15000000|USD|b +PLYmedia||web|Palo Alto|CA|1-Oct-06|2500000|USD|a +PLYmedia||web|Palo Alto|CA|1-Jul-08|6000000|USD|b +fabrik|175.0|web|San Mateo|CA|1-Sep-05|4100000|USD|a +fabrik|175.0|web|San Mateo|CA|1-Jun-06|8000000|USD|b +fabrik|175.0|web|San Mateo|CA|1-Feb-07|14300000|USD|c +fabrik|175.0|web|San Mateo|CA|1-May-07|24900000|USD|d +Widgetbox||web|San Francisco|CA|1-Jun-06|1500000|USD|angel +Widgetbox||web|San Francisco|CA|1-Jan-08|8000000|USD|b +Widgetbox||web|San Francisco|CA|1-Jun-07|5000000|USD|a +RazorGator||web|Los Angeles|CA|1-Mar-05|26000000|USD|a +RazorGator||web|Los Angeles|CA|1-Mar-06|22800000|USD|b +OverSee|150.0|web|Los Angeles|CA|1-Jan-07|60000000|USD|debt_round +OverSee|150.0|web|Los Angeles|CA|1-Jan-08|150000000|USD|a +Zynga|90.0|other|San Francisco|CA|1-Jan-08|10000000|USD|a +Zynga|90.0|other|San Francisco|CA|22-Jul-08|29000000|USD|b +Smaato||web|San Mateo|CA|1-Jan-08|3500000|USD|a +Credit Karma|4.0|web|San Francisco|CA|1-May-07|750000|USD|angel +Greenplum||web|San Mateo|CA|1-Jan-08|27000000|USD|c +Greenplum||web|San Mateo|CA|1-Feb-07|15000000|USD|b +Greenplum||web|San Mateo|CA|1-Mar-06|15000000|USD|a +Greenplum||web|San Mateo|CA|1-Feb-07|4000000|USD|debt_round +Amobee||web|Redwood City|CA|1-Nov-06|5000000|USD|a +Amobee||web|Redwood City|CA|1-Jan-07|15000000|USD|b +WebMynd||web|San Francisco|CA|1-Jul-08|250000|USD|angel +Current Media||web|San Francisco|CA|29-Jul-05|15000000|USD|a +Heroku|3.0|web|San Francisco|CA|1-Jan-08|20000|USD|seed +Heroku|3.0|web|San Francisco|CA|8-May-08|3000000|USD|a +Lookery|9.0|web|San Francisco|CA|7-Feb-08|900000|USD|seed +Mill River Labs|5.0|web|Mountain View|CA|1-Jan-08|900000|USD|angel +Grouptivity|10.0|web|San Mateo|CA|1-May-06|2000000|USD|angel +Aductions|5.0|web|San Jose|CA|5-Jul-07|100000|USD|seed +VentureBeat||web||CA|11-Feb-08|320000|USD|seed +Collarity|30.0|web|Palo Alto|CA|1-Feb-08|7800000|USD|b +RocketOn||web|South San Francisco|CA|1-Feb-08|5800000|USD|b +What They Like|10.0|web|San Francisco|CA|29-Aug-07|990000|USD|a +GumGum|5.0|web|Los Angeles|CA|1-Dec-07|225000|USD|seed +GumGum|5.0|web|Los Angeles|CA|21-Jul-08|1000000|USD|a +Snap Technologies|32.0|web|Pasadena|CA|1-Jul-05|10000000|USD|a +TwoFish||web|Redwood City|CA|1-Jun-07|5000000|USD|a +Three Rings|30.0|web|San Francisco|CA|3-Mar-08|3500000|USD|a +Smalltown|8.0|web|San Mateo|CA|1-Nov-05|4000000|USD|a +Sparkplay Media||web|Mill Valley|CA|1-Feb-08|4250000|USD|a +MOG||web|Berkeley|CA|1-Mar-07|1800000|USD|angel +MOG||web|Berkeley|CA|29-Apr-08|2800000|USD|a +Social Gaming Network||web|Palo Alto|CA|13-May-08|15000000|USD|a +Danger||software|Palo Alto|CA|1-Oct-01|36000000|USD|b +Danger||software|Palo Alto|CA|1-Feb-03|35000000|USD|d +Danger||software|Palo Alto|CA|1-Jul-04|37000000|USD|d +Coverity||software|San Francisco|CA|1-Feb-08|22000000|USD|a +GenieTown|8.0|web|Palo Alto|CA|1-Oct-07|2000000|USD|a +Redux|11.0|web|Berkeley|CA|1-Mar-07|1650000|USD|seed +Redux|11.0|web|Berkeley|CA|7-Apr-08|6500000|USD|a +Evernote||software|Sunnyvale|CA|1-Mar-06|6000000|USD|angel +Evernote||software|Sunnyvale|CA|1-Sep-07|3000000|USD|angel +Numobiq||mobile|Pleasanton|CA|8-Feb-08|4500000|USD|a +GoldSpot Media||mobile|Sunnyvale|CA|23-Jan-08|3000000|USD|a +Mobixell||mobile|Cupertino|CA|8-Jul-08|6000000|USD|a +Ad Infuse||mobile|San Francisco|CA|23-Jan-08|12000000|USD|b +Ad Infuse||mobile|San Francisco|CA|1-Jun-06|5000000|USD|a +SendMe||mobile|San Francisco|CA|1-Dec-06|6000000|USD|b +SendMe||mobile|San Francisco|CA|18-Mar-08|15000000|USD|c +Tiny Pictures|15.0|mobile|San Francisco|CA|1-Aug-07|4000000|USD|a +Tiny Pictures|15.0|mobile|San Francisco|CA|1-Feb-08|7200000|USD|b +flurry||mobile|San Francisco|CA|8-Mar-07|3500000|USD|a +Teneros||software|Mountain View|CA|1-Jul-04|7000000|USD|a +Teneros||software|Mountain View|CA|1-Mar-05|17500000|USD|b +Teneros||software|Mountain View|CA|1-Apr-06|20000000|USD|c +Teneros||software|Mountain View|CA|1-Jan-08|40000000|USD|d +PhotoCrank|3.0|web|Palo Alto|CA|1-Apr-07|250000|USD|seed +Yodlee||web|Redwood City|CA|4-Jun-08|35000000|USD|unattributed +SlideRocket|5.0|web|San Francisco|CA|31-Dec-07|2000000|USD|a +Surf Canyon|3.0|software|Oakland|CA|31-Jul-07|250000|USD|seed +Surf Canyon|3.0|software|Oakland|CA|8-May-08|600000|USD|seed +Central Desktop||web|Pasadena|CA|16-Apr-08|7000000|USD|a +OpenDNS|15.0|web|San Francisco|CA|1-Jun-06|2000000|USD|a +Coveo||web|Palo Alto|CA|6-Mar-08|2500000|USD|a +Vizu||web|San Francisco|CA|20-Feb-06|1000000|USD|a +Vizu||web|San Francisco|CA|31-Jan-07|2900000|USD|b +Taltopia||web|Los Angeles|CA|8-Mar-08|800000|USD|angel +Kapow Technologies||web|Palo Alto|CA|6-Mar-08|11600000|USD|c +ProgrammerMeetDesigner.com|4.0|web|Los Angeles|CA|12-Dec-07|500000|USD|seed +LiveOps||web|Santa Clara|CA|1-Apr-04|22000000|USD|b +LiveOps||web|Santa Clara|CA|13-Feb-07|28000000|USD|c +Clickpass||web|San Francisco|CA|1-Jun-07|20000|USD|seed +SearchMe|52.0|web|Mountain View|CA|1-Jul-05|400000|USD|a +SearchMe|52.0|web|Mountain View|CA|1-Jan-06|3600000|USD|b +SearchMe|52.0|web|Mountain View|CA|1-Jun-07|12000000|USD|c +SearchMe|52.0|web|Mountain View|CA|1-Oct-07|15000000|USD|d +SearchMe|52.0|web|Mountain View|CA|1-May-08|12600000|USD|e +AccountNow||web|San Ramon|CA|29-Jun-07|12750000|USD|c +DailyStrength|14.0|web|Los Angeles|CA|18-May-07|4000000|USD|a +PopularMedia||web|San Francisco|CA|1-Mar-07|4250000|USD|unattributed +PopularMedia||web|San Francisco|CA|28-Jul-08|8000000|USD|c +Clarizen|5.0|web|San Mateo|CA|1-May-08|9000000|USD|b +SellPoint||web|San Ramon|CA|27-Feb-08|7000000|USD|a +LiveDeal||web|Santa Clara|CA|26-Oct-05|4900000|USD|a +NeoEdge Networks||web|Mountain View|CA|8-Jun-07|3000000|USD|b +Zuora|30.0|web|Redwood City|CA|13-Mar-08|6500000|USD|a +Jivox||web|San Mateo|CA|10-Mar-08|2700000|USD|seed +Jivox||web|San Mateo|CA|16-Jun-08|10700000|USD|a +kwiry|3.0|mobile|San Francisco|CA|20-Mar-07|1000000|USD|a +SupplyFrame|25.0|web|Pasadena|CA|21-Jun-07|7000000|USD|b +InMage Systems||software|Santa Clara|CA|10-Jul-07|10000000|USD|b +Authenticlick|20.0|web|Los Angeles|CA|1-Feb-06|5000000|USD|a +Interneer|6.0|web|Agoura Hills|CA|6-Jun-07|2000000|USD|angel +Interneer|6.0|web|Agoura Hills|CA|11-Mar-07|1200000|USD|a +Handipoints||web|Oakland|CA|2-May-07|250000|USD|seed +Handipoints||web|Oakland|CA|2-May-08|550000|USD|angel +Adconion Media Group|150.0|web|Santa Monica|CA|24-Feb-08|80000000|USD|c +SlideShare|10.0|web|San Francisco|CA|7-May-08|3000000|USD|a +Intent|6.0|web|Santa Monica|CA|1-Feb-08|250000|USD|angel +Wikimedia Foundation||web|San Francisco|CA|25-Mar-08|3000000|USD|unattributed +Clearwell Systems|75.0|software|Mountain View|CA|22-Aug-07|17000000|USD|c +Become||web|Mountain View|CA|25-Mar-08|17500000|USD|c +Become||web|Mountain View|CA|17-Jul-08|8000000|USD|d +Bubble Motion||mobile|Mountain View|CA|26-Mar-08|14000000|USD|b +Bubble Motion||mobile|Mountain View|CA|11-Sep-06|10000000|USD|a +Perfect Market||web|Pasadena|CA|9-Jul-08|15600000|USD|a +Glassdoor|12.0|web|Sausalito|CA|27-Mar-08|3000000|USD|b +Support Space||web|Redwood City|CA|24-Oct-06|4250000|USD|a +Xoopit||web|San Francisco|CA|1-Dec-06|1500000|USD|angel +Xoopit||web|San Francisco|CA|2-Apr-08|5000000|USD|a +Reality Digital||software|San Francisco|CA|1-Nov-05|2000000|USD|a +Reality Digital||software|San Francisco|CA|31-Mar-08|6300000|USD|b +Cloud9 Analytics||web|San Mateo|CA|25-Jul-07|5000000|USD|a +Netcipia|3.0|web|Palo Alto|CA|30-Aug-07|200000|USD|angel +iControl||web|Palo Alto|CA|2-Apr-08|15500000|USD|b +iControl||web|Palo Alto|CA|26-Apr-06|5000000|USD|a +Frengo||web|San Mateo|CA|1-Dec-06|2300000|USD|a +Frengo||web|San Mateo|CA|3-May-07|5700000|USD|b +mBlox||mobile|Sunnyvale|CA|23-Feb-06|25000000|USD|d +mBlox||mobile|Sunnyvale|CA|9-Mar-05|7500000|USD|c +mBlox||mobile|Sunnyvale|CA|9-Jul-04|10000000|USD|b +mBlox||mobile|Sunnyvale|CA|28-Jan-08|22000000|USD|e +eSolar|10.0|hardware|Pasadena|CA|17-Jan-08|10000000|USD|a +eSolar|10.0|hardware|Pasadena|CA|21-Apr-08|130000000|USD|b +Marin Software||software|San Francisco|CA|5-Oct-06|2000000|USD|a +Marin Software||software|San Francisco|CA|9-Apr-08|7250000|USD|b +SiBEAM||hardware|Sunnyvale|CA|1-Dec-04|1250000|USD|seed +SiBEAM||hardware|Sunnyvale|CA|1-May-05|15000000|USD|a +SiBEAM||hardware|Sunnyvale|CA|1-Aug-06|21000000|USD|b +SiBEAM||hardware|Sunnyvale|CA|7-Apr-08|40000000|USD|c +Lumos Labs||web|San Francisco|CA|11-Jun-07|400000|USD|angel +Lumos Labs||web|San Francisco|CA|3-Jun-08|3000000|USD|a +iRise|150.0|software|El Segundo|CA|1-Mar-08|20000000|USD|unattributed +richrelevance||web|San Francisco|CA|8-Apr-08|4200000|USD|b +Labmeeting||web||CA|1-May-08|500000|USD|seed +Shopflick|10.0|web|Los Angeles|CA|15-Mar-08|1000000|USD|angel +Shopflick|10.0|web|Los Angeles|CA|1-Jul-08|7000000|USD|a +TurnHere|35.0|web|Emeryville|CA|15-Feb-08|7500000|USD|a +TurnHere|35.0|web|Emeryville|CA|1-Nov-06|1100000|USD|seed +Coupa||web|Foster City|CA|13-Mar-07|1500000|USD|a +Coupa||web|Foster City|CA|9-Apr-08|6000000|USD|b +SquareTrade||hardware|San Francisco|CA|1-Oct-99|400000|USD|seed +SquareTrade||hardware|San Francisco|CA|10-Apr-08|9000000|USD|b +V-Enable||mobile|San Diego|CA|28-Feb-06|6000000|USD|c +V-Enable||mobile|San Diego|CA|21-Sep-03|3750000|USD|b +Aeria||web|Santa Clara|CA|1-Oct-07|288000|USD|seed +Heysan|6.0|mobile|San Francisco|CA|24-Jan-07|20000|USD|seed +Memeo||software|Aliso Viejo|CA|7-Jan-08|8100000|USD|b +imageshack||web|Los Gatos|CA|1-May-07|10000000|USD|a +CellSpin|12.0|mobile|San Jose|CA|1-Dec-06|1100000|USD|angel +Remixation|5.0|web|San Francisco|CA|1-Jul-07|1000000|USD|a +The Auteurs|9.0|web|Palo Alto|CA|1-Aug-07|750000|USD|a +Modern Feed||web|Los Angeles|CA|1-Apr-07|3000000|USD|seed +GROU.PS||web|San Francisco|CA|1-Jun-08|1100000|USD|a +Triggit|5.0|web|San Francisco|CA|1-Mar-07|350000|USD|seed +Triggit|5.0|web|San Francisco|CA|1-Jul-07|500000|USD|angel +Serious Business|6.0|web|San Francisco|CA|25-Apr-08|4000000|USD|unattributed +Presdo|1.0|web|Mountain View|CA|1-Dec-07|35000|USD|seed +Nile Guide||web|San Francisco|CA|5-Jun-08|8000000|USD|b +Adify|10.0|web|San Bruno|CA|1-Aug-06|8000000|USD|a +Adify|10.0|web|San Bruno|CA|18-Apr-07|19000000|USD|b +Invensense||hardware|Sunnyvale|CA|28-Apr-08|19000000|USD|c +Center'd||web|Menlo Park|CA|1-Feb-07|1000000|USD|angel +Center'd||web|Menlo Park|CA|1-Oct-07|5500000|USD|a +Center'd||web|Menlo Park|CA|1-May-07|500000|USD|debt_round +New Relic||web||CA|1-Apr-08|3500000|USD|a +Gridstone Research||software|San Mateo|CA|4-Apr-08|10000000|USD|b +FusionOps|10.0|software|Sunnyvale|CA|1-Mar-05|4000000|USD|a +MarketLive||software|Foster City|CA|5-May-08|20000000|USD|e +SnapLogic||software|San Mateo|CA|22-May-07|2500000|USD|a +Boardwalktech|20.0|software|Palo Alto|CA|1-Oct-06|500000|USD|angel +Rosum||hardware|Mountain View|CA|15-Apr-08|15000000|USD|b +Dilithium Networks||web|Petaluma|CA|23-Apr-03|10000000|USD|b +Dilithium Networks||web|Petaluma|CA|14-Mar-05|18000000|USD|c +Dilithium Networks||web|Petaluma|CA|3-Jul-07|33000000|USD|d +Experience Project||web|San Francisco|CA|13-May-08|3000000|USD|a +Mozes||web|Palo Alto|CA|22-Feb-07|5000000|USD|a +Mozes||web|Palo Alto|CA|1-May-08|11500000|USD|b +rVita|6.0|software|Santa Clara|CA|1-Oct-07|1000000|USD|angel +Mefeedia|6.0|web|Burbank|CA|19-Mar-08|250000|USD|angel +Wavemaker Software||software|San Francisco|CA|15-Apr-08|4500000|USD|a +VirtualLogix||software|Sunnyvale|CA|11-Jul-07|16000000|USD|b +Fonemesh|7.0|software|San Francisco|CA|1-Jun-08|100000|USD|angel +Fonemesh|7.0|software|San Francisco|CA|1-May-08|150000|USD|seed +Cognition Technologies|20.0|software|Culver City|CA|15-Jul-08|2700000|USD|unattributed +Sometrics||web|Los Angeles|CA|14-May-08|1000000|USD|a +SocialVibe||web|Los Angeles|CA|1-Dec-07|4200000|USD|a +deviantART||web|Hollywood|CA|21-Jun-07|3500000|USD|a +MyThings||web|Menlo Park|CA|1-Apr-06|8000000|USD|a +mywaves|35.0|mobile|Sunnyvale|CA|8-Dec-06|6000000|USD|a +litescape||web|Redwood Shores|CA|6-Aug-07|14000000|USD|b +Parascale||software|Cupertino|CA|23-Jun-08|11370000|USD|a +Row44||hardware|Westlake Village|CA|20-May-08|21000000|USD|a +JellyCloud||web|Redwood City|CA|16-May-08|6600000|USD|a +Aster Data Systems|50.0|software|Redwood City|CA|1-Nov-05|1000000|USD|angel +Aster Data Systems|50.0|software|Redwood City|CA|1-May-07|5000000|USD|a +Pixim||hardware|Mountain View|CA|7-Mar-07|15000000|USD|b +Pixim||hardware|Mountain View|CA|9-Jun-05|12000000|USD|a +Pixim||hardware|Mountain View|CA|12-Jun-07|5100000|USD|b +Funambol||mobile|Redwood City|CA|8-Aug-05|5000000|USD|a +Funambol||mobile|Redwood City|CA|1-Dec-06|5500000|USD|a +Funambol||mobile|Redwood City|CA|17-Jun-08|12500000|USD|b +Funambol||mobile|Redwood City|CA|1-Jun-08|2000000|USD|debt_round +Moblyng||web|Menlo Park|CA|21-May-08|5700000|USD|b +Moblyng||web|Menlo Park|CA|28-Mar-07|1530000|USD|a +Zecter|3.0|web|Mountain View|CA|1-Jun-07|15000|USD|seed +Votigo||web|Emeryville|CA|31-Dec-07|1265000|USD|a +Zinio||web|San Francisco|CA|12-Sep-05|7000000|USD|a +Dreamfactory||web|Mountain View|CA|8-May-06|5800000|USD|a +GreenNote|15.0|web|Redwood City|CA|1-Oct-07|4200000|USD|a +Skyfire||software|Mountain View|CA|1-Jun-07|4800000|USD|a +Skyfire||software|Mountain View|CA|28-May-08|13000000|USD|b +eduFire||web|Santa Monica|CA|9-Apr-08|400000|USD|angel +B-hive Networks||software|San Mateo|CA|25-Aug-06|7000000|USD|a +NeuroVigil|5.0|biotech|La Jolla|CA|30-May-08|250000|USD|seed +Sylantro||web|Campbell|CA|1-Apr-06|11000000|USD|e +Sylantro||web|Campbell|CA|1-Nov-03|4500000|USD|d +Sylantro||web|Campbell|CA|1-Oct-00|55000000|USD|c +TeleFlip||mobile|Santa Monica|CA|1-Jan-08|4900000|USD|b +Vidshadow|16.0|web|Placentia|CA|15-Feb-07|2000000|USD|a +Jigsaw||web|San Mateo|CA|1-Dec-03|750000|USD|a +Jigsaw||web|San Mateo|CA|1-Sep-04|5200000|USD|b +Jigsaw||web|San Mateo|CA|1-Mar-06|12000000|USD|c +Ozmo Devices||hardware|Palo Alto|CA|30-Mar-06|12550000|USD|a +Cooliris||web|Menlo Park|CA|1-Jul-07|3000000|USD|a +Gamook||web|Menlo Park|CA|16-Mar-08|1500000|USD|a +Vindicia||web|Redwood City|CA|31-Mar-08|5600000|USD|c +Dizzywood||web||CA|7-Feb-08|1000000|USD|a +Limbo|37.0|web|Burlingame|CA|25-Apr-07|8000000|USD|b +StartForce|21.0|web|San Francisco|CA|1-Sep-07|1000000|USD|a +coolearth|9.0|cleantech|Livermore|CA|20-Feb-08|21000000|USD|a +coolearth|9.0|cleantech|Livermore|CA|1-Jun-07|1000000|USD|angel +Yield Software||web|San Mateo|CA|4-Jun-08|6000000|USD|b +Tapulous|9.0|web|Palo Alto|CA|1-Jul-08|1800000|USD|angel +Codefast||software|San Jose|CA|15-Mar-05|6500000|USD|a +Hyperic||web|San Francisco|CA|10-May-06|3800000|USD|a +iPling :))|7.0|mobile|San Francisco|CA|1-Mar-08|300000|USD|angel +Intacct|100.0|software|San Jose|CA|29-Apr-08|15000000|USD|unattributed +Intacct|100.0|software|San Jose|CA|27-Jun-07|14000000|USD|unattributed +Vivaty|25.0|web|Menlo Park|CA|1-Aug-07|9400000|USD|a +Aurora Biofuels||cleantech|Alameda|CA|10-Jun-08|20000000|USD|b +AllBusiness.com|50.0|other|San Francisco|CA|1-Jul-04|10000000|USD|b +AllBusiness.com|50.0|other|San Francisco|CA|1-Feb-06|12400000|USD|c +InsideView|40.0|software|San Francisco|CA|1-Jun-07|7400000|USD|a +Clickability||software|San Francisco|CA|14-Jul-08|3500000|USD|debt_round +Keibi Technologies|30.0|software|San Francisco|CA|1-May-07|5000000|USD|b +RoboDynamics|5.0|hardware|Santa Monica|CA|1-Sep-03|100000|USD|seed +RoboDynamics|5.0|hardware|Santa Monica|CA|1-May-06|500000|USD|angel +ImageSpan||web|Sausalito|CA|23-Jun-08|11000000|USD|b +Solarflare||hardware|Irvine|CA|18-Jun-08|26000000|USD|unattributed +Clupedia||web|Santa Ana|CA|22-May-07|1300000|USD|a +Zigabid|10.0|other|La Canada|CA|1-Dec-06|500000|USD|seed +Zigabid|10.0|other|La Canada|CA|1-Feb-08|500000|USD|angel +InThrMa|3.0|software|Oakland|CA|1-Oct-07|10000|USD|seed +Fluid Entertainment||other|Mill Valley|CA|12-Mar-08|3200000|USD|a +Unisfair||other|Menlo Park|CA|21-Jan-08|10000000|USD|b +ON24||web|San Francisco|CA|11-Jul-08|8000000|USD|unattributed +trueAnthem|10.0|other|Newport Beach|CA|28-Jul-08|2000000|USD|angel +Colizer||web|San Diego|CA|1-Apr-04|120000|USD|a +Coremetrics||software|San Mateo|CA|9-Mar-06|31000000|USD|d +Coremetrics||software|San Mateo|CA|4-Apr-08|60000000|USD|e +Appirio||software|San Mateo|CA|13-Mar-08|1100000|USD|a +Appirio||software|San Mateo|CA|21-Jul-08|10000000|USD|b +samfind|3.0|web|Los Angeles|CA|1-Jan-06|20000|USD|seed +Eye-Fi||hardware|Mountain View|CA|11-Jun-07|5500000|USD|a +ResponseLogix||web|Sunnyvale|CA|23-Jan-08|8000000|USD|a +Qumu||software|Emeryville|CA|21-Jul-08|10700000|USD|c +CarbonFlow||cleantech|San Francsico|CA|23-Jul-08|2900000|USD|a +Allvoices|8.0|web|San Francisco|CA|31-Jul-07|4500000|USD|a +Moxsie||web|Palo Alto|CA|27-Jun-08|1000000|USD|a +Service-now.com|80.0|web|Solana Beach|CA|5-Jul-05|2500000|USD|a +Service-now.com|80.0|web|Solana Beach|CA|5-Dec-06|5000000|USD|b +Anvato||web|Mountain View|CA|29-Jul-08|550000|USD|seed +Vantage Media|150.0|web|El Segundo|CA|28-Feb-07|70000000|USD|a +Entone Technologies|80.0|hardware|San Mateo|CA|1-Aug-08|14500000|USD|b +Entone Technologies|80.0|hardware|San Mateo|CA|2-May-03|9500000|USD|a +750 Industries|7.0|web|San Francisco|CA|1-Aug-08|1000000|USD|a +Plastic Logic||hardware|Mountain View|CA|20-Apr-02|13700000|USD|a +Plastic Logic||hardware|Mountain View|CA|5-Jan-05|8000000|USD|b +Plastic Logic||hardware|Mountain View|CA|30-Nov-05|24000000|USD|c +Plastic Logic||hardware|Mountain View|CA|6-Jan-07|100000000|USD|d +Plastic Logic||hardware|Mountain View|CA|4-Aug-08|50000000|USD|e +Paymo||mobile|San Francisco|CA|1-Aug-08|5000000|USD|seed +SkyGrid||web|Sunnyvale|CA|6-Aug-08|11000000|USD|b +Intense Debate|4.0|web|Boulder|CO|1-May-07|15000|USD|seed +Associated Content||web|Denver|CO|1-Jan-06|5400000|USD|a +Associated Content||web|Denver|CO|1-Jul-07|10000000|USD|b +madKast||web|Boulder|CO|1-Mar-07|15000|USD|seed +madKast||web|Boulder|CO|1-Oct-07|300000|USD|a +EventVue||web|Boulder|CO|1-Aug-07|15000|USD|seed +EventVue||web|Boulder|CO|1-Sep-07|250000|USD|a +Socialthing!|6.0|web|Boulder|CO|18-May-07|15000|USD|seed +Socialthing!|6.0|web|Boulder|CO|1-Oct-07|500000|USD|debt_round +J Squared Media||web|Boulder|CO|1-Aug-07|15000|USD|seed +Search to Phone||web|Boulder|CO|1-Aug-07|15000|USD|seed +Filtrbox||web|Boulder|CO|1-Aug-07|15000|USD|seed +Filtrbox||web|Boulder|CO|28-Feb-08|500000|USD|seed +Brightkite||web|Denver|CO|1-Aug-07|15000|USD|seed +Brightkite||web|Denver|CO|1-Mar-08|1000000|USD|angel +NewsGator||web|Denver|CO|23-Jun-04|1400000|USD|a +NewsGator||web|Denver|CO|1-Dec-07|12000000|USD|c +NewsGator||web|Denver|CO|1-Dec-04|8600000|USD|b +Me.dium||web|Boulder|CO|1-Jun-07|15000000|USD|b +Buzzwire||web|Denver|CO|1-Dec-07|8000000|USD|b +HiveLive||web|Boulder|CO|1-Feb-08|2200000|USD|angel +HiveLive||web|Boulder|CO|27-Feb-08|5600000|USD|a +XAware||web|Colorado Springs|CO|1-Jan-08|7400000|USD|b +XAware||web|Colorado Springs|CO|1-Nov-02|2100000|USD|a +Lijit||web|Boulder|CO|1-Jan-07|900000|USD|a +Lijit||web|Boulder|CO|1-Jun-07|3300000|USD|b +hubbuzz|8.0|web|Centennial|CO|1-Mar-07|750000|USD|angel +Gnip|6.0|web|Boulder|CO|1-Mar-08|1100000|USD|a +Rally Software||software|Boulder|CO|4-Jun-08|16850000|USD|c +Rally Software||software|Boulder|CO|14-Jun-06|8000000|USD|b +Symplified||software|Boulder|CO|9-Jun-08|6000000|USD|a +Indeed||web|Stamford|CT|1-Aug-05|5000000|USD|a +Geezeo||web|Hartford|CT|24-Apr-08|1200000|USD|unattributed +Entrecard|1.0|web|Hamden|CT|1-Jan-07|30000|USD|seed +Entrecard|1.0|web|Hamden|CT|1-Nov-07|40000|USD|seed +AmericanTowns.com|10.0|web|Fairfield|CT|1-Jul-06|1100000|USD|a +AmericanTowns.com|10.0|web|Fairfield|CT|1-Sep-07|3300000|USD|b +Kayak|58.0|web|Norwalk|CT|1-May-06|11500000|USD|c +Kayak|58.0|web|Norwalk|CT|1-Dec-04|7000000|USD|b +Kayak|58.0|web|Norwalk|CT|1-Dec-07|196000000|USD|d +GoCrossCampus|25.0|web|New Haven|CT|1-Sep-07|375000|USD|seed +Health Plan One||web|Shelton|CT|21-Apr-08|6500000|USD|a +Your Survival|10.0|web|Westport|CT|1-Nov-07|350000|USD|angel +Media Lantern|9.0|web|New London|CT|30-Mar-08|250000|USD|seed +GridPoint||cleantech|Washington|DC|1-Sep-07|32000000|USD|d +GridPoint||cleantech|Washington|DC|1-May-06|16000000|USD|b +GridPoint||cleantech|Washington|DC|1-Sep-06|21000000|USD|c +GridPoint||cleantech|Washington|DC|28-Mar-08|15000000|USD|d +HotPads|11.0|web|Washington|DC|1-Mar-07|2300000|USD|a +LaunchBox||web|Washinton|DC|1-Feb-08|250000|USD|a +Cogent||web|Washington|DC|12-Feb-08|510000|USD|seed +SwapDrive||web|Washington|DC|1-May-00|2650000|USD|a +SwapDrive||web|Washington|DC|1-May-01|2000000|USD|a +Searchles||web|Washington|DC|1-Jul-08|2000000|USD|angel +PayPerPost||web|Orlando|FL|1-Jun-07|7000000|USD|b +PayPerPost||web|Orlando|FL|1-Oct-06|3000000|USD|a +Affinity Internet||web|Fort Lauderdale|FL|1-Oct-99|60000000|USD|a +Affinity Internet||web|Fort Lauderdale|FL|1-Jan-02|25000000|USD|a +Multiply||web|Boca Raton|FL|1-Nov-05|2000000|USD|a +Multiply||web|Boca Raton|FL|1-Jul-06|3000000|USD|a +Multiply||web|Boca Raton|FL|1-Aug-07|16600000|USD|b +Revolution Money||web|Largo|FL|1-Sep-07|50000000|USD|b +Batanga||web|Miami|FL|1-Aug-07|30000000|USD|c +Batanga||web|Miami|FL|1-Apr-06|5000000|USD|b +divorce360|6.0|web|North Palm Beach|FL|1-Sep-07|2500000|USD|a +Infinity Box|3.0|web|Tampa|FL|1-Jan-06|18000|USD|seed +Infinity Box|3.0|web|Tampa|FL|1-Apr-06|100000|USD|angel +MOLI||web|West Palm Beach|FL|1-Jan-08|29600000|USD|b +Global Roaming|29.0|mobile|Miami|FL|1-Feb-07|7500000|USD|a +Global Roaming|29.0|mobile|Miami|FL|1-Feb-08|23000000|USD|b +Slingpage|8.0|software|Estero|FL|1-Dec-07|2250000|USD|angel +WrapMail|10.0|web|Fort Lauderdale|FL|6-Jan-07|1100000|USD|seed +eJamming||web|Boca Raton|FL|2-Jun-08|150000|USD|unattributed +Lehigh Technologies||cleantech|Naples|FL|23-Jun-08|34500000|USD|unattributed +TournEase|10.0|web|Lakeland|FL|1-Apr-06|3000000|USD|angel +TournEase|10.0|web|Lakeland|FL|1-Mar-08|500000|USD|angel +Vitrue||web|Atlanta|GA|1-Oct-07|10000000|USD|b +Vitrue||web|Atlanta|GA|1-May-06|2200000|USD|seed +Screaming Sports||web|Atlanta|GA|1-Jul-07|1250000|USD|a +beRecruited||web|Atlanta|GA|1-Nov-07|1200000|USD|a +MFG||web|Atlanta|GA|1-Sep-05|14000000|USD|a +MFG||web|Atlanta|GA|1-Jan-07|4000000|USD|c +MFG||web|Atlanta|GA|1-Jan-08|26000000|USD|d +Scintella Solutions|2.0|consulting|Atlanta|GA|30-Apr-08|10000|USD|seed +ScribeStorm|12.0|web|Fairfield|IA|24-Apr-06|225000|USD|angel +Balihoo||mobile|Boise|ID|1-Jul-07|1500000|USD|a +Balihoo||mobile|Boise|ID|1-Jan-08|4000000|USD|b +Info||web|Chicago|IL|1-Nov-04|8400000|USD|a +FeedBurner||web|Chicago|IL|1-Jun-04|1000000|USD|a +FeedBurner||web|Chicago|IL|1-Apr-05|7000000|USD|b +Viewpoints||web|Chicago|IL|1-Jun-07|5000000|USD|a +GrubHub||web|Chicago|IL|1-Nov-07|1100000|USD|a +TicketsNow||web|Rolling Meadows|IL|1-Jan-07|34000000|USD|a +The Point||web|Chicago|IL|1-Nov-07|2500000|USD|angel +The Point||web|Chicago|IL|1-Feb-08|4800000|USD|a +Inkling|2.0|web|Chicago|IL|1-Jan-07|20000|USD|seed +crowdSPRING|6.0|web|Chicago|IL|23-May-08|3000000|USD|angel +Ifbyphone|16.0|web|Skokie|IL|1-Jul-07|1500000|USD|a +Fave Media|18.0|web|Chicago|IL|17-Jan-08|1600000|USD|a +Accertify||web|Schaumburg|IL|3-Jun-08|4000000|USD|a +Firefly Energy||cleantech|Peoria|IL|14-Oct-04|4000000|USD|a +Firefly Energy||cleantech|Peoria|IL|10-Jun-08|15000000|USD|c +Firefly Energy||cleantech|Peoria|IL|13-Nov-06|10000000|USD|b +SAVO|68.0|software|Chicago|IL|1-Sep-05|10000000|USD|a +ChaCha|75.0|web|Carmel|IN|1-Jan-07|6000000|USD|a +ChaCha|75.0|web|Carmel|IN|1-Nov-07|10000000|USD|b +Better World Books||web|Mishawaka|IN|7-Apr-08|4500000|USD|a +Compendium Blogware|25.0|software|Indianapolis|IN|1-May-07|1100000|USD|angel +Compendium Blogware|25.0|software|Indianapolis|IN|1-May-08|1600000|USD|angel +Instagarage|4.0|web|New Orleans|LA|10-May-07|25000|USD|seed +iSkoot||web|Cambridge|MA|27-Feb-07|7000000|USD|b +iSkoot||web|Cambridge|MA|29-Nov-06|6200000|USD|a +Gotuit Media||web|Woburn|MA|1-Dec-04|10000000|USD|b +Gotuit Media||web|Woburn|MA|1-Dec-02|6000000|USD|a +Carbonite|68.0|web|Boston|MA|1-Mar-06|2500000|USD|a +Carbonite|68.0|web|Boston|MA|1-Dec-06|3500000|USD|a +Carbonite|68.0|web|Boston|MA|1-May-07|15000000|USD|b +Carbonite|68.0|web|Boston|MA|28-Dec-07|5000000|USD|b +ScanScout|40.0|web|Boston|MA|1-Mar-07|7000000|USD|a +ScanScout|40.0|web|Boston|MA|1-Apr-07|2000000|USD|angel +Going||web|Boston|MA|1-Jul-07|5000000|USD|a +Brightcove||web|Cambridge|MA|1-Mar-05|5500000|USD|a +Brightcove||web|Cambridge|MA|1-Nov-05|16200000|USD|b +Brightcove||web|Cambridge|MA|1-Jan-07|59500000|USD|c +Brightcove||web|Cambridge|MA|1-Sep-06|5000000|USD|b +Brightcove||web|Cambridge|MA|1-May-08|4900000|USD|d +PermissionTV||web|Waltham|MA|1-Jun-07|9000000|USD|c +Bountii||web|Boston|MA|1-Jun-07|15000|USD|seed +Conduit Labs||web|Cambridge|MA|1-Aug-07|5500000|USD|a +ZoomInfo|80.0|web|Waltham|MA|1-Jul-04|7000000|USD|a +ZoomInfo|80.0|web|Waltham|MA|1-Jul-04|7000000|USD|a +Vlingo||web|Cambridge|MA|2-Apr-08|20000000|USD|b +Vtap||web|Andover|MA|1-May-07|14000000|USD|b +MocoSpace|25.0|mobile|Boston|MA|1-Jan-07|3000000|USD|a +Quattro Wireless||web|Waltham|MA|1-May-07|6000000|USD|a +Quattro Wireless||web|Waltham|MA|5-Sep-07|12300000|USD|b +Care.com||web|Waltham|MA|1-May-07|3100000|USD|a +OnForce||web|Lexington|MA|1-Sep-07|6750000|USD|a +OnForce||web|Lexington|MA|12-Jan-06|15000000|USD|a +RatePoint||web|Needham|MA|1-Jun-07|6500000|USD|a +UpDown|5.0|web|Cambridge|MA|29-Jan-08|750000|USD|angel +Eons||web|Boston|MA|1-Mar-07|22000000|USD|b +Eons||web|Boston|MA|1-Apr-06|10000000|USD|a +GamerDNA||web|Cambridge|MA|18-Apr-08|3000000|USD|a +Mix & Meet|2.0|web|Cambridge|MA|29-Mar-08|400000|USD|angel +Sermo||web|Cambridge|MA|1-Sep-07|25000000|USD|c +Sermo||web|Cambridge|MA|1-Jan-07|9500000|USD|b +Sermo||web|Cambridge|MA|1-Sep-06|3000000|USD|a +WorkLight|30.0|web|Newton|MA|1-Sep-06|5100000|USD|a +WorkLight|30.0|web|Newton|MA|30-Apr-08|12000000|USD|b +MatchMine||web|Needham|MA|1-Sep-07|10000000|USD|a +CondoDomain|4.0|other|Boston|MA|1-Jun-05|300000|USD|angel +uTest|10.0|web|Ashland|MA|1-Oct-07|2300000|USD|a +Compete||web|Boston|MA|1-Aug-07|10000000|USD|c +Compete||web|Boston|MA|6-Oct-03|13000000|USD|b +Azuki Systems|30.0|web|Acton|MA|1-Sep-07|6000000|USD|a +Acinion||web|Acton|MA|1-Dec-06|5000000|USD|a +Acinion||web|Acton|MA|1-Oct-07|16000000|USD|b +xkoto|45.0|software|Waltham|MA|1-Nov-07|7500000|USD|b +HubSpot|30.0|web|Cambridge|MA|1-Sep-07|5000000|USD|a +HubSpot|30.0|web|Cambridge|MA|16-May-08|12000000|USD|b +HubSpot|30.0|web|Cambridge|MA|1-May-06|500000|USD|seed +Utterz|3.0|mobile|Maynard|MA|1-Sep-07|4000000|USD|a +Intronis||web|Boston|MA|1-Oct-07|5000000|USD|a +Acquia|11.0|web|Andover|MA|1-Dec-07|7000000|USD|a +A123Systems||web|Watertown|MA|1-Oct-07|30000000|USD|d +A123Systems||web|Watertown|MA|1-Jan-07|40000000|USD|c +A123Systems||web|Watertown|MA|1-Feb-06|30000000|USD|b +Boston Power|55.0|web|Westborough|MA|1-Nov-06|8000000|USD|a +Boston Power|55.0|web|Westborough|MA|1-Jan-08|45000000|USD|c +Boston Power|55.0|web|Westborough|MA|1-Jan-07|15600000|USD|b +Visible Measures||web|Boston|MA|1-Mar-07|5000000|USD|a +Visible Measures||web|Boston|MA|1-Jan-08|13500000|USD|b +Visible Measures||web|Boston|MA|1-Jan-06|800000|USD|seed +Endeca|500.0|web|Cambridge|MA|1-Jun-04|15000000|USD|c +Endeca|500.0|web|Cambridge|MA|1-Jan-08|15000000|USD|d +Endeca|500.0|web|Cambridge|MA|1-Nov-01|15000000|USD|b +Endeca|500.0|web|Cambridge|MA|1-Jan-01|10000000|USD|a +ChoiceStream|70.0|software|Cambridge|MA|1-Jan-00|15000000|USD|seed +ChoiceStream|70.0|software|Cambridge|MA|22-Feb-05|7000000|USD|a +ChoiceStream|70.0|software|Cambridge|MA|1-Jun-06|13100000|USD|b +ChoiceStream|70.0|software|Cambridge|MA|4-Apr-07|26500000|USD|c +YouCastr|5.0|web|Cambridge|MA|1-Feb-08|100000|USD|angel +JackPot Rewards||web|Newton|MA|1-Feb-08|16700000|USD|a +Mzinga||web|Burlington|MA|3-Mar-08|32500000|USD|d +Dimdim||web|Burlington|MA|1-Feb-07|2400000|USD|a +Dimdim||web|Burlington|MA|1-Jul-08|6000000|USD|b +utoopia|2.0|web|Boston|MA|1-Mar-07|100000|USD|seed +Retail Convergence||web|Boston|MA|24-Apr-08|25000000|USD|a +Frame Media||web|Wellesley|MA|9-Nov-07|2000000|USD|a +Frame Media||web|Wellesley|MA|2-May-08|3000000|USD|unattributed +Turbine|200.0|web|Westwood|MA|29-Apr-08|40000000|USD|c +Turbine|200.0|web|Westwood|MA|9-May-05|30000000|USD|b +Zeer|5.0|web|Boston|MA|1-Aug-07|1050000|USD|angel +SimpleTuition||web|Newton|MA|14-Apr-06|4400000|USD|a +SimpleTuition||web|Newton|MA|18-Dec-06|7500000|USD|b +Sirtris Pharmaceuticals||biotech|Cambridge|MA|1-Dec-04|13000000|USD|a +Sirtris Pharmaceuticals||biotech|Cambridge|MA|8-Mar-05|27000000|USD|b +Sirtris Pharmaceuticals||biotech|Cambridge|MA|19-Apr-06|37000000|USD|c +Good Data|30.0|web|Cambridge|MA|23-Jul-08|2000000|USD|seed +Navic Networks||web|Waltham|MA|14-Feb-00|2000000|USD|a +Navic Networks||web|Waltham|MA|26-Feb-01|20000000|USD|c +Navic Networks||web|Waltham|MA|7-Jun-00|20000000|USD|b +Pivot|40.0|software|Cambridge|MA|1-Dec-04|5000000|USD|a +Pivot|40.0|software|Cambridge|MA|1-Apr-06|8000000|USD|b +Optaros|200.0|consulting|Boston|MA|1-Jun-08|12000000|USD|c +Optaros|200.0|consulting|Boston|MA|20-Nov-06|13000000|USD|b +Optaros|200.0|consulting|Boston|MA|9-Mar-05|7000000|USD|a +Astaro||hardware|Burlington|MA|1-May-03|6200000|USD|a +Astaro||hardware|Burlington|MA|1-May-04|6700000|USD|b +Pangea Media|25.0|web|Watertown|MA|1-Apr-07|1000000|USD|angel +Posterous||web|Boston|MA|1-May-08|15000|USD|seed +Spire||web|Boston|MA|8-Jul-08|9000000|USD|a +neoSaej||web|Burlington|MA|14-Jul-08|7000000|USD|unattributed +GenArts||software|Cambridge|MA|17-Jul-08|22400000|USD|unattributed +OrderMotion||web|Boston|MA|21-Jul-08|1400000|USD|unattributed +HAM-IT|7.0|web|North Andover|MA|1-Oct-07|340000|USD|seed +Freewebs|35.0|web|Silver Spring|MD|1-Aug-06|12000000|USD|a +MPTrax|4.0|web|Baltimore|MD|1-Jan-07|350000|USD|angel +JackBe|0.0|web|Chevy Chase|MD|1-Oct-07|9500000|USD|c +ZeniMax||web|Rockville|MD|1-Oct-07|300000000|USD|a +ZeniMax||web|Rockville|MD|30-May-08|9900000|USD|a +Intelliworks|24.0|software|Rockville|MD|14-Feb-05|6000000|USD|a +Intelliworks|24.0|software|Rockville|MD|10-Oct-06|10000000|USD|b +Intelliworks|24.0|software|Rockville|MD|7-Apr-08|4000000|USD|c +HEXIO|1.0|web|Kennebunk|ME|10-Jan-08|20000|USD|seed +Foneshow|8.0|web|Portland|ME|1-Sep-07|1050000|USD|a +Foneshow|8.0|web|Portland|ME|1-Sep-06|25000|USD|seed +Zattoo|45.0|web|Ann Arbor|MI|1-Nov-07|10000000|USD|b +LoudClick|9.0|web|Richfield|MN|31-Mar-08|600000|USD|angel +Agilis Systems||mobile|St. Louis|MO|16-May-08|5000000|USD|b +International Liars Poker Association|24.0|other|St. Louis|MO|1-Nov-07|1250000|USD|seed +ChannelAdvisor|300.0|web|Morrisville|NC|1-May-07|30000000|USD|c +ChannelAdvisor|300.0|web|Morrisville|NC|22-Jan-04|7000000|USD|a +ChannelAdvisor|300.0|web|Morrisville|NC|28-Apr-05|18000000|USD|b +Yap||mobile|Charlotte|NC|1-Mar-07|1500000|USD|angel +Yap||mobile|Charlotte|NC|10-Jun-08|6500000|USD|a +PrepChamps|10.0|web|Durham|NC|22-Apr-08|1200000|USD|a +BrightDoor Systems|26.0|web|Cary|NC|13-Apr-07|200000|USD|a +DriftToIt|4.0|web|Raleigh|NC|1-Jun-07|300000|USD|angel +rPath|45.0|other|Raleigh|NC|24-Jan-06|6400000|USD|a +rPath|45.0|other|Raleigh|NC|24-Jan-07|9100000|USD|b +rPath|45.0|other|Raleigh|NC|24-Jun-08|10000000|USD|c +Ntractive|6.0|web|Grand Forks|ND|8-Jul-08|570000|USD|a +Bill Me Later||web|Omaha|NE|1-Mar-06|27400000|USD|a +AdaptiveBlue|6.0|web|Livingston|NJ|15-Feb-07|1500000|USD|a +Phanfare||web|Metuchen|NJ|1-Nov-07|2500000|USD|c +Phanfare||web|Metuchen|NJ|1-Jul-06|2000000|USD|b +EnterpriseDB||software|Edison|NJ|7-Sep-05|7000000|USD|a +EnterpriseDB||software|Edison|NJ|1-Aug-06|20000000|USD|b +EnterpriseDB||software|Edison|NJ|25-Mar-08|10000000|USD|c +Neocleus||web|Jersey City|NJ|19-Jun-08|11000000|USD|b +Datapipe||web|Jersey City|NJ|8-Jul-08|75000000|USD|unattributed +Switch2Health||web|North Brunswick|NJ|16-Jul-08|200000|USD|unattributed +Voltaix||hardware|N. Branch|NJ|29-Jul-08|12500000|USD|unattributed +SpaBoom|9.0|web|Albuquerque|NM|15-Jul-06|700000|USD|a +SpaBoom|9.0|web|Albuquerque|NM|15-Sep-07|600000|USD|b +Novint||other|Albuquerque|NM|17-Jun-08|5200000|USD|unattributed +MeetMoi|7.0|web|New York City|NY|1-Jun-07|1500000|USD|a +Meetup|1.0|mobile|New York|NY|1-Dec-02|2800000|USD|a +Meetup|1.0|mobile|New York|NY|1-Nov-03|5300000|USD|b +Meetup|1.0|mobile|New York|NY|23-Jul-08|7500000|USD|d +Mogulus|20.0|web|New York|NY|1-May-07|1200000|USD|angel +Mogulus|20.0|web|New York|NY|1-Jan-08|1500000|USD|angel +Mogulus|20.0|web|New York|NY|1-Jul-08|10000000|USD|a +Pando|23.0|software|New York|NY|1-Jan-07|11000000|USD|b +Pando|23.0|software|New York|NY|1-Mar-08|20900000|USD|c +Outside.in|17.0|web|Brooklyn|NY|1-Feb-07|900000|USD|angel +Outside.in|17.0|web|Brooklyn|NY|1-Oct-07|1500000|USD|angel +Outside.in|17.0|web|Brooklyn|NY|19-May-08|3000000|USD|a +SelectMinds|55.0|web|New York|NY|1-Aug-07|5500000|USD|a +Veotag||web|New York|NY|1-May-07|750000|USD|angel +KIT digital|100.0|web|New York|NY|8-May-08|15000000|USD|b +KIT digital|100.0|web|New York|NY|18-Apr-08|5000000|USD|a +ContextWeb||web|New York|NY|1-Jun-04|3000000|USD|a +ContextWeb||web|New York|NY|1-Jun-05|9000000|USD|b +ContextWeb||web|New York|NY|20-Jul-08|26000000|USD|d +Datran Media||web|New York|NY|1-Mar-05|60000000|USD|a +Eyeblaster||web|New York|NY|1-Dec-03|8000000|USD|a +Eyeblaster||web|New York|NY|21-Mar-07|30000000|USD|b +Covestor||web|New York|NY|1-Jun-07|1000000|USD|angel +Covestor||web|New York|NY|7-Apr-08|6500000|USD|a +Global Grind|20.0|web|New York|NY|1-Aug-07|4500000|USD|b +Heavy.com||web|New York|NY|1-Mar-01|3000000|USD|a +SpiralFrog|15.0|web|New York|NY|1-Dec-07|2000000|USD|debt_round +Broadband Enterprises||web|New York|NY|1-Jan-08|10000000|USD|a +Thumbplay||mobile|New York|NY|13-Mar-08|18000000|USD|e +Waterfront Media||web|Brooklyn, New York|NY|1-Sep-07|25000000|USD|d +Waterfront Media||web|Brooklyn, New York|NY|1-Mar-04|4000000|USD|a +Waterfront Media||web|Brooklyn, New York|NY|1-Mar-06|6000000|USD|b +Waterfront Media||web|Brooklyn, New York|NY|1-Apr-07|8000000|USD|c +Tutor|55.0|web|New Yorl|NY|1-May-07|13500000|USD|b +Daylife||web|New York|NY|1-Jun-07|8300000|USD|b +Teach The People|1.0|web|Astoria|NY|1-Jan-07|300000|USD|angel +OrganizedWisdom|18.0|web|New York|NY|1-Jun-08|2300000|USD|a +Snooth||web|New York|NY|1-Dec-06|300000|USD|angel +Snooth||web|New York|NY|1-Nov-07|1000000|USD|a +5min|8.0|web|New York|NY|1-Apr-07|300000|USD|angel +5min|8.0|web|New York|NY|1-Nov-07|5000000|USD|a +Kaltura|20.0|web|Brooklyn|NY|1-May-07|2100000|USD|a +Mimeo||web|New York|NY|1-Sep-07|25000000|USD|a +RayV||web|New York|NY|1-Oct-07|8000000|USD|b +Tumblr||web|New York|NY|31-Oct-07|750000|USD|a +Payoneer|50.0|web|New York|NY|24-Jul-08|8000000|USD|b +eXelate||web|New York|NY|1-Oct-07|4000000|USD|a +Quigo||web|New York|NY|1-Mar-04|5000000|USD|a +Peer39|50.0|web|New York|NY|1-Feb-07|3000000|USD|a +Peer39|50.0|web|New York|NY|1-Sep-07|8200000|USD|b +Peer39|50.0|web|New York|NY|1-Mar-06|500000|USD|seed +Rebel Monkey|15.0|web|New York|NY|5-Feb-08|1000000|USD|a +Answers Corporation||web|New York|NY|1-Jan-99|300000|USD|a +Answers Corporation||web|New York|NY|1-Apr-99|1360000|USD|b +Answers Corporation||web|New York|NY|1-Sep-99|2750000|USD|c +Answers Corporation||web|New York|NY|1-May-00|28000000|USD|d +Answers Corporation||web|New York|NY|17-Jun-08|13000000|USD|debt_round +SeeToo||web|New York|NY|1-Oct-07|1000000|USD|angel +drop.io||web|Brooklyn|NY|1-Nov-07|1250000|USD|a +drop.io||web|Brooklyn|NY|10-Mar-08|2700000|USD|b +Motionbox||web|New York|NY|1-Sep-06|4200000|USD|a +Motionbox||web|New York|NY|1-Dec-07|7000000|USD|b +DGP Labs||web|New York|NY|1-Nov-07|4750000|USD|a +Ideeli||web|New York|NY|1-Dec-07|3800000|USD|a +Live Gamer||web|New York|NY|1-Dec-07|24000000|USD|a +WeShow|0.0|web|New York|NY|1-Jun-07|5000000|USD|a +Etsy|45.0|web|Brooklyn|NY|1-Jun-06|315000|USD|angel +Etsy|45.0|web|Brooklyn|NY|1-Nov-06|1000000|USD|a +Etsy|45.0|web|Brooklyn|NY|1-Jul-07|3250000|USD|b +Etsy|45.0|web|Brooklyn|NY|1-Jan-08|27000000|USD|c +PhoneTag|10.0|web|New York|NY|1-Feb-07|3500000|USD|angel +PhoneTag|10.0|web|New York|NY|1-Jan-04|200000|USD|seed +PhoneTag|10.0|web|New York|NY|1-Dec-07|2000000|USD|angel +Tremor Media||web|New York|NY|1-Sep-06|8400000|USD|a +Tremor Media||web|New York|NY|1-Jan-08|11000000|USD|b +YooNew||web|New York|NY|1-Aug-05|2000000|USD|angel +Fifth Generation Systems||web|Roslyn Heights|NY|1-Jan-08|5300000|USD|b +Fifth Generation Systems||web|Roslyn Heights|NY|1-Nov-06|5250000|USD|a +IGA Worldwide||web|New York|NY|1-Feb-06|12000000|USD|a +IGA Worldwide||web|New York|NY|1-Jul-07|25000000|USD|b +IGA Worldwide||web|New York|NY|1-Jan-08|5000000|USD|b +TheLadders|200.0|web|New York|NY|8-Nov-04|7250000|USD|a +Adotube|30.0|web|New York|NY|31-Jul-07|630000|USD|seed +Adotube|30.0|web|New York|NY|1-Apr-08|600000|USD|seed +Kluster||web|New York|NY|1-Jan-08|1000000|USD|seed +Blog Talk Radio||web|New York|NY|25-Jun-08|4600000|USD|a +Pingg|7.0|web|New York|NY|1-Jan-07|500000|USD|seed +Pingg|7.0|web|New York|NY|1-Mar-07|800000|USD|angel +Outbrain||web|New York City|NY|1-Jan-07|1000000|USD|seed +Outbrain||web|New York City|NY|25-Feb-08|5000000|USD|a +Mochila|52.0|web|New York|NY|2-Jan-07|8000000|USD|b +OLX|85.0|web|New York City|NY|1-Sep-07|10000000|USD|a +OLX|85.0|web|New York City|NY|11-Apr-08|13500000|USD|b +Boonty|150.0|web|New York|NY|7-Jul-05|10000000|USD|b +Tripology||web|New York|NY|1-Jan-07|1250000|USD|a +The Feedroom||web|New York|NY|9-Jul-08|12000000|USD|unattributed +Next New Networks|15.0|web|New York|NY|1-Jan-07|8000000|USD|a +Next New Networks|15.0|web|New York|NY|12-Mar-08|15000000|USD|b +RiverWired||web|New York|NY|1-Mar-08|1500000|USD|seed +Fynanz|10.0|web|New York|NY|1-Oct-07|500000|USD|angel +Digital Railroad||web|New York|NY|14-Jun-05|5200000|USD|a +Digital Railroad||web|New York|NY|5-Feb-07|10000000|USD|b +Undertone Networks||web|New York|NY|31-Mar-08|40000000|USD|a +Someecards||web|New York|NY|1-Apr-08|350000|USD|seed +Trunkt|2.0|web|New York|NY|15-May-07|350000|USD|seed +Cutcaster|6.0|web|New York City|NY|1-Jan-08|150000|USD|seed +Visible World||software|New York|NY|14-Apr-08|25000000|USD|c +Visible World||software|New York|NY|17-Nov-03|8000000|USD|b +Mad Mimi|3.0|web||NY|29-Apr-07|200000|USD|angel +Social Median||web|New York|NY|7-Mar-08|500000|USD|seed +Scanbuy||software|New York|NY|12-Dec-06|9000000|USD|b +Scanbuy||software|New York|NY|1-Nov-07|6800000|USD|b +Pontiflex||web|Brooklyn|NY|30-Apr-08|2500000|USD|a +CHIC.TV|12.0|web|New York|NY|1-Jan-06|500000|USD|angel +ExpertFlyer|3.0|web|Patchogue|NY|1-Mar-04|30000|USD|seed +x+1||web|New York|NY|1-Jun-08|16000000|USD|a +Media6¡||web|New York|NY|1-May-08|2000000|USD|debt_round +Knewton||web|New York|NY|21-May-08|2500000|USD|a +Sense Networks||mobile|New York City|NY|1-Apr-08|3000000|USD|a +TargetSpot|20.0|web|New York|NY|11-Mar-08|8600000|USD|b +BountyJobs|31.0|web|New York|NY|7-Jul-08|12000000|USD|b +vbs tv|40.0|other|Brooklyn|NY|1-Dec-06|10000000|USD|seed +Instinctiv||mobile|Ithaca|NY|1-Jun-08|750000|USD|seed +VISUALPLANT|6.0|web|New York|NY|1-Mar-07|500000|USD|seed +XunLight||hardware|Toledo|OH|7-May-08|22000000|USD|b +Strands|150.0|web|Corvallis|OR|1-Mar-06|6000000|USD|a +Strands|150.0|web|Corvallis|OR|18-Jun-07|25000000|USD|b +Strands|150.0|web|Corvallis|OR|1-Dec-07|24000000|USD|b +Jive Software||web|Portland|OR|1-Aug-07|15000000|USD|a +Platial||web|Portland|OR|1-Oct-05|800000|USD|angel +Platial||web|Portland|OR|1-Feb-07|2600000|USD|a +GarageGames||web|Eugene|OR|1-Sep-07|50000000|USD|a +iovation|50.0|web|Portland|OR|27-Mar-08|15000000|USD|a +InGrid||web|Berwyn|PA|1-Jul-07|13500000|USD|c +InGrid||web|Berwyn|PA|1-Sep-04|6600000|USD|a +InGrid||web|Berwyn|PA|1-Jun-06|8100000|USD|b +InGrid||web|Berwyn|PA|1-Jun-06|1500000|USD|debt_round +Sleep.FM|4.0|web|Philadelphia|PA|30-Mar-08|15000|USD|seed +Boomi|0.0|web|Berwyn|PA|1-Jul-08|4000000|USD|a +Styky|3.0|web|Philadelphia|PA|1-Jan-07|100000|USD|seed +TotalTakeout|25.0|web|Allentown|PA|1-Oct-07|150000|USD|seed +QponDirect|10.0|web|Pittsburgh|PA|1-Mar-08|300000|USD|angel +EnergyWeb Solutions|3.0|web|Allentown|PA|15-Jun-06|100000|USD|seed +Aria Systems||software|Media|PA|7-Nov-07|4000000|USD|a +Viv’simo||software|Pittsburgh|PA|17-Mar-08|4000000|USD|a +Viv’simo||software|Pittsburgh|PA|12-Jul-03|960000|USD|seed +Viv’simo||software|Pittsburgh|PA|4-Jul-02|500000|USD|seed +Viv’simo||software|Pittsburgh|PA|1-Jun-00|100000|USD|seed +Viv’simo||software|Pittsburgh|PA|29-Jan-01|100000|USD|seed +ShowClix||web|Oakmont|PA|1-Oct-07|150000|USD|seed +ShowClix||web|Oakmont|PA|1-Jun-08|250000|USD|seed +BioWizard|8.0|web|Wayne|PA|3-Jan-08|1000000|USD|a +TicketLeap|4.0|web|Philadelphia|PA|22-Jul-08|2000000|USD|a +Tizra||web|Providence|RI|1-May-07|500000|USD|seed +Quickoffice||software|Plano|TN|5-Feb-07|7000000|USD|b +Quickoffice||software|Plano|TN|1-Jan-06|11500000|USD|a +Quickoffice||software|Plano|TN|23-May-08|3000000|USD|c +Thoof||web|Austin|TX|1-Jun-07|1000000|USD|seed +Bazaarvoice||web|Austin|TX|1-May-06|4000000|USD|a +Bazaarvoice||web|Austin|TX|1-Sep-07|8800000|USD|b +Bazaarvoice||web|Austin|TX|18-Jun-08|7100000|USD|c +Small World Labs|25.0|web|Austin|TX|19-Mar-08|1000000|USD|a +Pluck||web|Austin|TX|6-Oct-04|8500000|USD|b +Pluck||web|Austin|TX|14-Nov-06|7000000|USD|c +Spiceworks||web|Austin|TX|1-Aug-07|8000000|USD|b +SpendView|3.0|web|Houston|TX|1-Jan-08|2000000|USD|a +Shangby||web|Austin|TX|1-Jun-07|1000000|USD|a +On Networks|20.0|web|Austin|TX|1-Nov-06|4000000|USD|a +On Networks|20.0|web|Austin|TX|1-Nov-07|12000000|USD|b +CareFlash|0.0|web|Houston|TX|1-Aug-07|600000|USD|seed +HelioVolt||web|Austin|TX|1-Aug-07|77000000|USD|b +Challenge Games||web|Austin|TX|10-Jul-08|4500000|USD|a +Woot|100.0|web|Carrollton|TX|1-Jan-08|4000000|USD|a +Mumboe|17.0|software|Austin|TX|1-Oct-06|4500000|USD|seed +BreakingPoint Systems|54.0|hardware|Austin|TX|12-Nov-07|15000000|USD|c +FameCast||web|Austin|TX|1-Jun-07|4500000|USD|a +Click Forensics||web|Austin|TX|1-Jan-07|5000000|USD|a +Click Forensics||web|Austin|TX|1-Mar-08|10000000|USD|b +GodTube||web|Plano|TX|4-May-08|30000000|USD|b +iBiz Software|50.0|software|Dallas|TX|20-May-08|250000|USD|angel +Cosential|10.0|web|Austin|TX|1-Jun-02|250000|USD|b +JAD Tech Consulting|6.0|consulting|Richardson|TX|23-Sep-93|125000|USD|seed +Mozy|26.0|web|American Fork|UT|1-May-05|1900000|USD|a +Mozy|26.0|web|American Fork|UT|1-May-05|1900000|USD|a +Ancestry.com||web|Provo|UT|1-Sep-99|33200000|USD|b +Move Networks||web|American Fork|UT|1-Dec-06|11300000|USD|a +Move Networks||web|American Fork|UT|1-Oct-07|34000000|USD|b +Move Networks||web|American Fork|UT|14-Apr-08|46000000|USD|c +World Vital Records||web|Provo|UT|1-Sep-07|1200000|USD|a +Bungee Labs|38.0|web|Orem|UT|14-Mar-08|8000000|USD|c +Footnote|31.0|web|Lindon|UT|1-Jan-08|8000000|USD|a +mediaFORGE||web|Salt Lake City|UT|1-Jul-06|1500000|USD|a +TeamStreamz|5.0|web|Lehi|UT|10-Jan-07|80000|USD|seed +Exinda||software|Sandy|UT|22-May-04|6000000|USD|a +Clearspring||web|McLean|VA|1-May-06|2500000|USD|a +Clearspring||web|McLean|VA|1-Feb-07|5500000|USD|b +Clearspring||web|McLean|VA|20-May-08|18000000|USD|c +Clearspring||web|McLean|VA|27-Jul-07|10000000|USD|b +Avail Media||web|Reston|VA|1-May-07|17000000|USD|b +Avail Media||web|Reston|VA|1-Nov-07|25000000|USD|c +FortiusOne||web|Arlington|VA|1-May-07|5450000|USD|b +Mixx||web||VA|1-Sep-07|1500000|USD|a +Mixx||web||VA|1-Feb-08|2000000|USD|b +Jobfox||web|McLean|VA|1-Jan-08|20000000|USD|c +Jobfox||web|McLean|VA|1-May-06|13000000|USD|b +Jobfox||web|McLean|VA|1-Apr-05|7000000|USD|a +HealthCentral||web|Arlington|VA|1-Jan-08|50000000|USD|a +comScore||web|Reston|VA|6-Jun-02|20000000|USD|d +comScore||web|Reston|VA|13-Aug-01|15000000|USD|c +VisualCV|20.0|web|Reston|VA|28-Jan-08|2000000|USD|a +ShoutWire|9.0|web||VA|1-Jan-07|500000|USD|a +Parature|100.0|software|Vienna|VA|5-Jul-06|13500000|USD|a +Parature|100.0|software|Vienna|VA|7-May-08|16000000|USD|b +Loladex|2.0|web|Leesburg|VA|1-Nov-07|350000|USD|seed +Appian|120.0|software|Vienna|VA|21-Jul-08|10000000|USD|a +Fortisphere|50.0|software|Chantilly|VA|19-Nov-07|10000000|USD|a +Wetpaint|35.0|web|Seattle|WA|1-Oct-05|5250000|USD|a +Wetpaint|35.0|web|Seattle|WA|1-Jan-07|9500000|USD|b +Wetpaint|35.0|web|Seattle|WA|1-May-05|25000000|USD|c +Jobster||web|Seattle|WA|1-Aug-05|19500000|USD|b +Jobster||web|Seattle|WA|1-Jul-06|18000000|USD|c +Jobster||web|Seattle|WA|1-Jan-05|8000000|USD|a +Jobster||web|Seattle|WA|25-Apr-08|7000000|USD|d +Yapta||web|Seattle|WA|1-Jul-07|2300000|USD|a +Yapta||web|Seattle|WA|1-Jul-07|700000|USD|seed +Farecast|26.0|web|Seattle|WA|1-Oct-04|1500000|USD|a +Farecast|26.0|web|Seattle|WA|1-Jul-05|7000000|USD|b +Farecast|26.0|web|Seattle|WA|1-Jan-07|12100000|USD|c +Haute Secure||web|Seattle|WA|1-Jan-07|500000|USD|a +Newsvine|6.0|web|Seattle|WA|1-Jul-05|1250000|USD|a +iLike|28.0|web|Seattle|WA|1-Jan-06|2500000|USD|a +iLike|28.0|web|Seattle|WA|1-Jan-06|13300000|USD|b +Redfin|100.0|web|Seattle|WA|1-Jul-07|12000000|USD|c +Redfin|100.0|web|Seattle|WA|1-May-06|8000000|USD|b +Redfin|100.0|web|Seattle|WA|1-Sep-05|770000|USD|a +Action Engine||web|Bellevue|WA|1-May-00|7700000|USD|a +Action Engine||web|Bellevue|WA|1-May-02|5000000|USD|b +Action Engine||web|Bellevue|WA|1-Jan-05|10000000|USD|d +Action Engine||web|Bellevue|WA|1-Mar-03|15500000|USD|c +Action Engine||web|Bellevue|WA|1-Jul-07|20000000|USD|e +Wishpot||web|Seattle|WA|29-Apr-08|1000000|USD|a +PayScale||web|Seattle|WA|1-Oct-04|3200000|USD|a +PayScale||web|Seattle|WA|1-Oct-05|7000000|USD|b +PayScale||web|Seattle|WA|1-Jul-07|10300000|USD|c +BuddyTV||web|Seattle|WA|1-Jul-07|2800000|USD|a +BuddyTV||web|Seattle|WA|1-May-07|250000|USD|angel +BuddyTV||web|Seattle|WA|14-Apr-08|6000000|USD|b +Judys Book||web|Seattle|WA|1-Jul-04|2500000|USD|a +Judys Book||web|Seattle|WA|1-Nov-05|8000000|USD|b +Sampa|4.0|web|Redmond|WA|1-Aug-07|310000|USD|angel +Sampa|4.0|web|Redmond|WA|2-Apr-08|1000000|USD|angel +Zango|225.0|web|Bellevue|WA|1-Mar-04|40000000|USD|a +Cdigix||web|Seattle|WA|1-Nov-05|4000000|USD|a +Ripl||web|Seattle|WA|1-Aug-07|4500000|USD|b +EyeJot|5.0|web|Seattle|WA|1-May-07|750000|USD|seed +EyeJot|5.0|web|Seattle|WA|1-Jan-07|400000|USD|angel +FlowPlay|6.0|web|Seattle|WA|1-May-07|500000|USD|angel +FlowPlay|6.0|web|Seattle|WA|6-Feb-08|3700000|USD|a +SmartSheet||web|Bellevue|WA|1-Jun-07|2690000|USD|a +Visible Technologies|60.0|web|Seattle|WA|1-Aug-06|3500000|USD|a +Visible Technologies|60.0|web|Seattle|WA|1-Sep-07|12000000|USD|b +Zillow|155.0|web|Seattle|WA|1-Oct-05|32000000|USD|a +Zillow|155.0|web|Seattle|WA|1-Jul-06|25000000|USD|b +Zillow|155.0|web|Seattle|WA|1-Sep-07|30000000|USD|c +SEOMoz||web|Seattle|WA|1-Sep-07|1250000|USD|a +DocuSign||web|Seattle|WA|1-Apr-06|10000000|USD|b +DocuSign||web|Seattle|WA|1-Sep-07|12400000|USD|c +AdReady|33.0|web|Seattle|WA|1-Dec-07|10000000|USD|b +Treemo||web|Seattle|WA|1-Oct-07|2550000|USD|a +GridNetworks||web|Seattle|WA|1-Oct-07|9500000|USD|a +Pelago||web|Seattle|WA|1-Nov-06|7400000|USD|a +Pelago||web|Seattle|WA|27-May-08|15000000|USD|b +Blist||web|Seattle|WA|20-Feb-08|6500000|USD|a +RealSelf||web|Seattle|WA|1-Oct-07|1000000|USD|angel +RescueTime||web|Seattle|WA|14-Oct-07|20000|USD|seed +Zoji||web|Seattle|WA|1-Oct-07|1500000|USD|angel +Snapvine|20.0|web|Seattle|WA|1-Jul-06|2000000|USD|a +Snapvine|20.0|web|Seattle|WA|1-Sep-07|10000000|USD|b +Jott||web|Seattle|WA|1-May-07|5400000|USD|b +Earth Class Mail||web|Seattle|WA|1-Sep-07|7400000|USD|a +Earth Class Mail||web|Seattle|WA|1-Jan-08|5900000|USD|a +Smilebox||web|Redmond|WA|1-Feb-06|5000000|USD|a +Smilebox||web|Redmond|WA|1-Dec-07|7000000|USD|b +Fyreball||web|Bellevue|WA|1-Dec-07|1000000|USD|angel +Delve Networks||web|Seattle|WA|1-Dec-06|1650000|USD|seed +Delve Networks||web|Seattle|WA|1-Aug-07|8000000|USD|a +LiveMocha||web|Bellevue|WA|1-Jan-08|6000000|USD|a +Mercent Corporation|50.0|web|Seattle|WA|1-Jan-08|6500000|USD|b +CleverSet||web|Seattle|WA|1-Aug-06|1400000|USD|angel +CleverSet||web|Seattle|WA|1-Sep-05|1200000|USD|a +CleverSet||web|Seattle|WA|1-Dec-07|500000|USD|angel +LiquidPlanner|11.0|web|Bellevue|WA|1-Jan-08|1200000|USD|angel +Limeade|10.0|web|Bellevue|WA|1-Jan-07|1000000|USD|angel +Yodio|4.0|web|Bellevue|WA|1-Feb-08|850000|USD|a +Tastemakers|11.0|web|Seattle|WA|1-Feb-07|1000000|USD|a +WhitePages.com|125.0|web|Seattle|WA|1-Aug-05|45000000|USD|a +RevenueScience||web|Seattle|WA|19-Dec-05|24000000|USD|e +GotVoice|15.0|mobile|Kirkland|WA|25-Oct-06|3000000|USD|a +CarDomain Network|50.0|web|Seattle|WA|29-Jun-07|3000000|USD|a +mpire||web|Seattle|WA|1-Feb-07|9800000|USD|a +mpire||web|Seattle|WA|11-Jun-08|10000000|USD|b +TeachStreet|8.0|web|Seattle|WA|1-Mar-08|2250000|USD|a +Estately||web||WA|24-Apr-08|450000|USD|angel +Infinia||cleantech|Kennewick|WA|22-Apr-08|57000000|USD|b +Infinia||cleantech|Kennewick|WA|1-Jun-07|9500000|USD|a +M:Metrics||web|Seattle|WA|16-Oct-05|7000000|USD|b +Cozi|26.0|software|Seattle|WA|11-Jul-07|3000000|USD|a +Cozi|26.0|software|Seattle|WA|1-Jun-08|8000000|USD|c +Trusera|15.0|web|Seattle|WA|1-Jun-07|2000000|USD|angel +Alerts.com||web|Bellevue|WA|8-Jul-08|1200000|USD|a +Myrio|75.0|software|Bothell|WA|1-Jan-01|20500000|USD|unattributed +Grid Networks||web|Seattle|WA|30-Oct-07|9500000|USD|a +Grid Networks||web|Seattle|WA|20-May-08|10500000|USD|b diff --git a/linreg_1d.jpg b/linreg_1d.jpg new file mode 100644 index 0000000..cb6485f Binary files /dev/null and b/linreg_1d.jpg differ diff --git a/matrix.txt b/matrix.txt new file mode 100644 index 0000000..b05343b --- /dev/null +++ b/matrix.txt @@ -0,0 +1,10 @@ +0 1 1 0 1 0 1 1 0 1 +0 0 1 0 1 1 0 1 0 1 +0 0 1 0 0 0 1 1 0 0 +0 1 0 0 1 0 1 1 0 0 +1 0 1 1 0 0 1 0 1 1 +1 0 1 0 0 1 1 0 1 0 +1 1 1 0 1 1 1 0 1 1 +0 0 0 0 0 1 0 1 0 1 +1 1 0 1 0 1 1 1 0 0 +1 0 1 0 1 0 0 1 0 1 diff --git a/pl.txt b/pl.txt new file mode 100644 index 0000000..e80e6bf --- /dev/null +++ b/pl.txt @@ -0,0 +1,386 @@ +# Premier League, 2011-12-es szezon +# 1. oszlop: fordulo +# 2. oszlop: hazai csapat +# 3. oszlop: vendegcsapat +# 4. oszlop: hazai csapat goljainak szama +# 5. oszlop: vendegcsapat goljainak szama +1 Blackburn Rovers Wolverhampton Wanderers 1 2 +1 Fulham FC Aston Villa 0 0 +1 Liverpool FC Sunderland AFC 1 1 +1 Queens Park Rangers Bolton Wanderers 0 4 +1 Wigan Athletic Norwich City 1 1 +1 Newcastle United Arsenal FC 0 0 +1 Stoke City Chelsea FC 0 0 +1 West Bromwich Albion Manchester United 1 2 +1 Manchester City Swansea City 4 0 +1 Tottenham Hotspur Everton FC 2 0 +2 Sunderland AFC Newcastle United 0 1 +2 Arsenal FC Liverpool FC 0 2 +2 Aston Villa Blackburn Rovers 3 1 +2 Everton FC Queens Park Rangers 0 1 +2 Swansea City Wigan Athletic 0 0 +2 Chelsea FC West Bromwich Albion 2 1 +2 Norwich City Stoke City 1 1 +2 Wolverhampton Wanderers Fulham FC 2 0 +2 Bolton Wanderers Manchester City 2 3 +2 Manchester United Tottenham Hotspur 3 0 +3 Aston Villa Wolverhampton Wanderers 0 0 +3 Wigan Athletic Queens Park Rangers 2 0 +3 Blackburn Rovers Everton FC 0 1 +3 Chelsea FC Norwich City 3 1 +3 Swansea City Sunderland AFC 0 0 +3 Liverpool FC Bolton Wanderers 3 1 +3 Newcastle United Fulham FC 2 1 +3 Tottenham Hotspur Manchester City 1 5 +3 West Bromwich Albion Stoke City 0 1 +3 Manchester United Arsenal FC 8 2 +4 Arsenal FC Swansea City 1 0 +4 Everton FC Aston Villa 2 2 +4 Manchester City Wigan Athletic 3 0 +4 Stoke City Liverpool FC 1 0 +4 Sunderland AFC Chelsea FC 1 2 +4 Wolverhampton Wanderers Tottenham Hotspur 0 2 +4 Bolton Wanderers Manchester United 0 5 +4 Norwich City West Bromwich Albion 0 1 +4 Fulham FC Blackburn Rovers 1 1 +4 Queens Park Rangers Newcastle United 0 0 +5 Blackburn Rovers Arsenal FC 4 3 +5 Aston Villa Newcastle United 1 1 +5 Bolton Wanderers Norwich City 1 2 +5 Everton FC Wigan Athletic 3 1 +5 Swansea City West Bromwich Albion 3 0 +5 Wolverhampton Wanderers Queens Park Rangers 0 3 +5 Tottenham Hotspur Liverpool FC 4 0 +5 Fulham FC Manchester City 2 2 +5 Sunderland AFC Stoke City 4 0 +5 Manchester United Chelsea FC 3 1 +6 Manchester City Everton FC 2 0 +6 Arsenal FC Bolton Wanderers 3 0 +6 Chelsea FC Swansea City 4 1 +6 Liverpool FC Wolverhampton Wanderers 2 1 +6 Newcastle United Blackburn Rovers 3 1 +6 West Bromwich Albion Fulham FC 0 0 +6 Wigan Athletic Tottenham Hotspur 1 2 +6 Stoke City Manchester United 1 1 +6 Queens Park Rangers Aston Villa 1 1 +6 Norwich City Sunderland AFC 2 1 +7 Everton FC Liverpool FC 0 2 +7 Aston Villa Wigan Athletic 2 0 +7 Blackburn Rovers Manchester City 0 4 +7 Manchester United Norwich City 2 0 +7 Sunderland AFC West Bromwich Albion 2 2 +7 Wolverhampton Wanderers Newcastle United 1 2 +7 Bolton Wanderers Chelsea FC 1 5 +7 Fulham FC Queens Park Rangers 6 0 +7 Swansea City Stoke City 2 0 +7 Tottenham Hotspur Arsenal FC 2 1 +8 Liverpool FC Manchester United 1 1 +8 Manchester City Aston Villa 4 1 +8 Norwich City Swansea City 3 1 +8 Queens Park Rangers Blackburn Rovers 1 1 +8 Stoke City Fulham FC 2 0 +8 Wigan Athletic Bolton Wanderers 1 3 +8 Chelsea FC Everton FC 3 1 +8 West Bromwich Albion Wolverhampton Wanderers 2 0 +8 Arsenal FC Sunderland AFC 2 1 +8 Newcastle United Tottenham Hotspur 2 2 +9 Wolverhampton Wanderers Swansea City 2 2 +9 Aston Villa West Bromwich Albion 1 2 +9 Bolton Wanderers Sunderland AFC 0 2 +9 Newcastle United Wigan Athletic 1 0 +9 Liverpool FC Norwich City 1 1 +9 Arsenal FC Stoke City 3 1 +9 Fulham FC Everton FC 1 3 +9 Manchester United Manchester City 1 6 +9 Blackburn Rovers Tottenham Hotspur 1 2 +9 Queens Park Rangers Chelsea FC 1 0 +10 Everton FC Manchester United 0 1 +10 Chelsea FC Arsenal FC 3 5 +10 Manchester City Wolverhampton Wanderers 3 1 +10 Norwich City Blackburn Rovers 3 3 +10 Sunderland AFC Aston Villa 2 2 +10 Swansea City Bolton Wanderers 3 1 +10 Wigan Athletic Fulham FC 0 2 +10 West Bromwich Albion Liverpool FC 0 2 +10 Tottenham Hotspur Queens Park Rangers 3 1 +10 Stoke City Newcastle United 1 3 +11 Newcastle United Everton FC 2 1 +11 Arsenal FC West Bromwich Albion 3 0 +11 Aston Villa Norwich City 3 2 +11 Blackburn Rovers Chelsea FC 0 1 +11 Liverpool FC Swansea City 0 0 +11 Manchester United Sunderland AFC 1 0 +11 Queens Park Rangers Manchester City 2 3 +11 Wolverhampton Wanderers Wigan Athletic 3 1 +11 Bolton Wanderers Stoke City 5 0 +11 Fulham FC Tottenham Hotspur 1 3 +12 Norwich City Arsenal FC 1 2 +12 Everton FC Wolverhampton Wanderers 2 1 +12 Manchester City Newcastle United 3 1 +12 Stoke City Queens Park Rangers 2 3 +12 Sunderland AFC Fulham FC 0 0 +12 West Bromwich Albion Bolton Wanderers 2 1 +12 Wigan Athletic Blackburn Rovers 3 3 +12 Swansea City Manchester United 0 1 +12 Chelsea FC Liverpool FC 1 2 +12 Tottenham Hotspur Aston Villa 2 0 +13 Stoke City Blackburn Rovers 3 1 +13 Bolton Wanderers Everton FC 0 2 +13 Chelsea FC Wolverhampton Wanderers 3 0 +13 Manchester United Newcastle United 1 1 +13 Norwich City Queens Park Rangers 2 1 +13 Sunderland AFC Wigan Athletic 1 2 +13 West Bromwich Albion Tottenham Hotspur 1 3 +13 Arsenal FC Fulham FC 1 1 +13 Swansea City Aston Villa 0 0 +13 Liverpool FC Manchester City 1 1 +14 Newcastle United Chelsea FC 0 3 +14 Blackburn Rovers Swansea City 4 2 +14 Manchester City Norwich City 5 1 +14 Queens Park Rangers West Bromwich Albion 1 1 +14 Tottenham Hotspur Bolton Wanderers 3 0 +14 Wigan Athletic Arsenal FC 0 4 +14 Aston Villa Manchester United 0 1 +14 Everton FC Stoke City 0 1 +14 Wolverhampton Wanderers Sunderland AFC 2 1 +14 Fulham FC Liverpool FC 1 0 +15 Arsenal FC Everton FC 1 0 +15 Bolton Wanderers Aston Villa 1 2 +15 Liverpool FC Queens Park Rangers 1 0 +15 Manchester United Wolverhampton Wanderers 4 1 +15 Norwich City Newcastle United 4 2 +15 Swansea City Fulham FC 2 0 +15 West Bromwich Albion Wigan Athletic 1 2 +15 Sunderland AFC Blackburn Rovers 2 1 +15 Stoke City Tottenham Hotspur 2 1 +15 Chelsea FC Manchester City 2 1 +16 Blackburn Rovers West Bromwich Albion 1 2 +16 Everton FC Norwich City 1 1 +16 Fulham FC Bolton Wanderers 2 0 +16 Newcastle United Swansea City 0 0 +16 Wolverhampton Wanderers Stoke City 1 2 +16 Wigan Athletic Chelsea FC 1 1 +16 Queens Park Rangers Manchester United 0 2 +16 Aston Villa Liverpool FC 0 2 +16 Tottenham Hotspur Sunderland AFC 1 0 +16 Manchester City Arsenal FC 1 0 +17 Wolverhampton Wanderers Norwich City 2 2 +17 Blackburn Rovers Bolton Wanderers 1 2 +17 Aston Villa Arsenal FC 1 2 +17 Manchester City Stoke City 3 0 +17 Newcastle United West Bromwich Albion 2 3 +17 Queens Park Rangers Sunderland AFC 2 3 +17 Wigan Athletic Liverpool FC 0 0 +17 Everton FC Swansea City 1 0 +17 Fulham FC Manchester United 0 5 +17 Tottenham Hotspur Chelsea FC 1 1 +18 Chelsea FC Fulham FC 1 1 +18 Bolton Wanderers Newcastle United 0 2 +18 Liverpool FC Blackburn Rovers 1 1 +18 Manchester United Wigan Athletic 5 0 +18 Sunderland AFC Everton FC 1 1 +18 West Bromwich Albion Manchester City 0 0 +18 Stoke City Aston Villa 0 0 +18 Arsenal FC Wolverhampton Wanderers 1 1 +18 Swansea City Queens Park Rangers 1 1 +18 Norwich City Tottenham Hotspur 0 2 +19 Liverpool FC Newcastle United 3 1 +19 Manchester United Blackburn Rovers 2 3 +19 Arsenal FC Queens Park Rangers 1 0 +19 Bolton Wanderers Wolverhampton Wanderers 1 1 +19 Chelsea FC Aston Villa 1 3 +19 Norwich City Fulham FC 1 1 +19 Stoke City Wigan Athletic 2 2 +19 Swansea City Tottenham Hotspur 1 1 +19 West Bromwich Albion Everton FC 0 1 +19 Sunderland AFC Manchester City 1 0 +20 Blackburn Rovers Stoke City 1 2 +20 Aston Villa Swansea City 0 2 +20 Queens Park Rangers Norwich City 1 2 +20 Wolverhampton Wanderers Chelsea FC 1 2 +20 Fulham FC Arsenal FC 2 1 +20 Tottenham Hotspur West Bromwich Albion 1 0 +20 Wigan Athletic Sunderland AFC 1 4 +20 Manchester City Liverpool FC 3 0 +20 Everton FC Bolton Wanderers 1 2 +20 Newcastle United Manchester United 3 0 +21 Aston Villa Everton FC 1 1 +21 Blackburn Rovers Fulham FC 3 1 +21 Chelsea FC Sunderland AFC 1 0 +21 Liverpool FC Stoke City 0 0 +21 Manchester United Bolton Wanderers 3 0 +21 Tottenham Hotspur Wolverhampton Wanderers 1 1 +21 West Bromwich Albion Norwich City 1 2 +21 Newcastle United Queens Park Rangers 1 0 +21 Swansea City Arsenal FC 3 2 +21 Wigan Athletic Manchester City 0 1 +22 Norwich City Chelsea FC 0 0 +22 Everton FC Blackburn Rovers 1 1 +22 Fulham FC Newcastle United 5 2 +22 Queens Park Rangers Wigan Athletic 3 1 +22 Stoke City West Bromwich Albion 1 2 +22 Sunderland AFC Swansea City 2 0 +22 Wolverhampton Wanderers Aston Villa 2 3 +22 Bolton Wanderers Liverpool FC 3 1 +22 Manchester City Tottenham Hotspur 3 2 +22 Arsenal FC Manchester United 1 2 +23 Swansea City Chelsea FC 1 1 +23 Tottenham Hotspur Wigan Athletic 3 1 +23 Wolverhampton Wanderers Liverpool FC 0 3 +23 Manchester United Stoke City 2 0 +23 Everton FC Manchester City 1 0 +23 Aston Villa Queens Park Rangers 2 2 +23 Bolton Wanderers Arsenal FC 0 0 +23 Sunderland AFC Norwich City 3 0 +23 Fulham FC West Bromwich Albion 1 1 +23 Blackburn Rovers Newcastle United 0 2 +24 Arsenal FC Blackburn Rovers 7 1 +24 Norwich City Bolton Wanderers 2 0 +24 Queens Park Rangers Wolverhampton Wanderers 1 2 +24 Stoke City Sunderland AFC 0 1 +24 West Bromwich Albion Swansea City 1 2 +24 Wigan Athletic Everton FC 1 1 +24 Manchester City Fulham FC 3 0 +24 Newcastle United Aston Villa 2 1 +24 Chelsea FC Manchester United 3 3 +24 Liverpool FC Tottenham Hotspur 0 0 +25 Manchester United Liverpool FC 2 1 +25 Blackburn Rovers Queens Park Rangers 3 2 +25 Bolton Wanderers Wigan Athletic 1 2 +25 Everton FC Chelsea FC 2 0 +25 Fulham FC Stoke City 2 1 +25 Sunderland AFC Arsenal FC 1 2 +25 Swansea City Norwich City 2 3 +25 Tottenham Hotspur Newcastle United 5 0 +25 Wolverhampton Wanderers West Bromwich Albion 1 5 +25 Aston Villa Manchester City 0 1 +26 Chelsea FC Bolton Wanderers 3 0 +26 Newcastle United Wolverhampton Wanderers 2 2 +26 Queens Park Rangers Fulham FC 0 1 +26 West Bromwich Albion Sunderland AFC 4 0 +26 Wigan Athletic Aston Villa 0 0 +26 Manchester City Blackburn Rovers 3 0 +26 Arsenal FC Tottenham Hotspur 5 2 +26 Norwich City Manchester United 1 2 +26 Stoke City Swansea City 2 0 +26 Liverpool FC Everton FC 3 0 +27 Liverpool FC Arsenal FC 1 2 +27 Blackburn Rovers Aston Villa 1 1 +27 Manchester City Bolton Wanderers 2 0 +27 Queens Park Rangers Everton FC 1 1 +27 Stoke City Norwich City 1 0 +27 West Bromwich Albion Chelsea FC 1 0 +27 Wigan Athletic Swansea City 0 2 +27 Newcastle United Sunderland AFC 1 1 +27 Fulham FC Wolverhampton Wanderers 5 0 +27 Tottenham Hotspur Manchester United 1 3 +28 Bolton Wanderers Queens Park Rangers 2 1 +28 Aston Villa Fulham FC 1 0 +28 Chelsea FC Stoke City 1 0 +28 Sunderland AFC Liverpool FC 1 0 +28 Wolverhampton Wanderers Blackburn Rovers 0 2 +28 Everton FC Tottenham Hotspur 1 0 +28 Manchester United West Bromwich Albion 2 0 +28 Swansea City Manchester City 1 0 +28 Norwich City Wigan Athletic 1 1 +28 Arsenal FC Newcastle United 2 1 +29 Fulham FC Swansea City 0 3 +29 Wigan Athletic West Bromwich Albion 1 1 +29 Wolverhampton Wanderers Manchester United 0 5 +29 Newcastle United Norwich City 1 0 +29 Blackburn Rovers Sunderland AFC 2 0 +29 Manchester City Chelsea FC 2 1 +29 Tottenham Hotspur Stoke City 1 1 +29 Everton FC Arsenal FC 0 1 +29 Queens Park Rangers Liverpool FC 3 2 +29 Aston Villa Bolton Wanderers 1 2 +30 Chelsea FC Tottenham Hotspur 0 0 +30 Arsenal FC Aston Villa 3 0 +30 Bolton Wanderers Blackburn Rovers 2 1 +30 Liverpool FC Wigan Athletic 1 2 +30 Norwich City Wolverhampton Wanderers 2 1 +30 Sunderland AFC Queens Park Rangers 3 1 +30 Swansea City Everton FC 0 2 +30 Stoke City Manchester City 1 1 +30 West Bromwich Albion Newcastle United 1 3 +30 Manchester United Fulham FC 1 0 +31 Aston Villa Chelsea FC 2 4 +31 Everton FC West Bromwich Albion 2 0 +31 Fulham FC Norwich City 2 1 +31 Manchester City Sunderland AFC 3 3 +31 Queens Park Rangers Arsenal FC 2 1 +31 Wigan Athletic Stoke City 2 0 +31 Wolverhampton Wanderers Bolton Wanderers 2 3 +31 Newcastle United Liverpool FC 2 0 +31 Tottenham Hotspur Swansea City 3 1 +31 Blackburn Rovers Manchester United 0 2 +32 Swansea City Newcastle United 0 2 +32 Sunderland AFC Tottenham Hotspur 0 0 +32 Bolton Wanderers Fulham FC 0 3 +32 Chelsea FC Wigan Athletic 2 1 +32 Liverpool FC Aston Villa 1 1 +32 Norwich City Everton FC 2 2 +32 West Bromwich Albion Blackburn Rovers 3 0 +32 Stoke City Wolverhampton Wanderers 2 1 +32 Manchester United Queens Park Rangers 2 0 +32 Arsenal FC Manchester City 1 0 +33 Everton FC Sunderland AFC 4 0 +33 Newcastle United Bolton Wanderers 2 0 +33 Tottenham Hotspur Norwich City 1 2 +33 Aston Villa Stoke City 1 1 +33 Fulham FC Chelsea FC 1 1 +33 Blackburn Rovers Liverpool FC 2 3 +33 Manchester City West Bromwich Albion 4 0 +33 Wigan Athletic Manchester United 1 0 +33 Wolverhampton Wanderers Arsenal FC 0 3 +33 Queens Park Rangers Swansea City 3 0 +34 Norwich City Manchester City 1 6 +34 Sunderland AFC Wolverhampton Wanderers 0 0 +34 Swansea City Blackburn Rovers 3 0 +34 West Bromwich Albion Queens Park Rangers 1 0 +34 Manchester United Aston Villa 4 0 +34 Arsenal FC Wigan Athletic 1 2 +34 Liverpool FC Fulham FC 0 1 +34 Stoke City Everton FC 1 1 +34 Chelsea FC Newcastle United 0 2 +34 Bolton Wanderers Tottenham Hotspur 1 4 +35 Arsenal FC Chelsea FC 0 0 +35 Aston Villa Sunderland AFC 0 0 +35 Blackburn Rovers Norwich City 2 0 +35 Bolton Wanderers Swansea City 1 1 +35 Fulham FC Wigan Athletic 2 1 +35 Newcastle United Stoke City 3 0 +35 Queens Park Rangers Tottenham Hotspur 1 0 +35 Manchester United Everton FC 4 4 +35 Liverpool FC West Bromwich Albion 0 1 +35 Wolverhampton Wanderers Manchester City 0 2 +36 Everton FC Fulham FC 4 0 +36 Stoke City Arsenal FC 1 1 +36 Sunderland AFC Bolton Wanderers 2 2 +36 Swansea City Wolverhampton Wanderers 4 4 +36 West Bromwich Albion Aston Villa 0 0 +36 Wigan Athletic Newcastle United 4 0 +36 Norwich City Liverpool FC 0 3 +36 Chelsea FC Queens Park Rangers 6 1 +36 Tottenham Hotspur Blackburn Rovers 2 0 +36 Manchester City Manchester United 1 0 +37 Arsenal FC Norwich City 3 3 +37 Newcastle United Manchester City 0 2 +37 Aston Villa Tottenham Hotspur 1 1 +37 Bolton Wanderers West Bromwich Albion 2 2 +37 Fulham FC Sunderland AFC 2 1 +37 Queens Park Rangers Stoke City 1 0 +37 Wolverhampton Wanderers Everton FC 0 0 +37 Manchester United Swansea City 2 0 +37 Blackburn Rovers Wigan Athletic 0 1 +37 Liverpool FC Chelsea FC 4 1 +38 Chelsea FC Blackburn Rovers 2 1 +38 Everton FC Newcastle United 3 1 +38 Manchester City Queens Park Rangers 3 2 +38 Norwich City Aston Villa 2 0 +38 Stoke City Bolton Wanderers 2 2 +38 Sunderland AFC Manchester United 0 1 +38 Swansea City Liverpool FC 1 0 +38 Tottenham Hotspur Fulham FC 2 0 +38 West Bromwich Albion Arsenal FC 2 3 +38 Wigan Athletic Wolverhampton Wanderers 3 2 diff --git a/pyprog_bevezetes.pdf b/pyprog_bevezetes.pdf new file mode 100644 index 0000000..a9c9991 Binary files /dev/null and b/pyprog_bevezetes.pdf differ diff --git a/unicef.txt b/unicef.txt new file mode 100644 index 0000000..bf1025a --- /dev/null +++ b/unicef.txt @@ -0,0 +1,855 @@ +Country|United Nations Region|United Nations Sub-Region|World Bank Income Classification|Survey Year|Survey Sample (N)|Severe Wasting|Wasting|Stunting|Underweight|Overweight|Source|Notes|U5 Population ('000s) +AFGHANISTAN|Asia|Southern Asia|Low Income|1997|4846||18,2|53,2|44,9|6,5| Afghanistan 1997 multiple indicator baseline (MICS). Report to UNICEF. Communitiy Information and Epidemiological Technologies Firm (CIET) International, 1998 (and additional analysis)|Converted estimates|3637,632 +AFGHANISTAN|Asia|Southern Asia|Low Income|2004|946|3,5|8,6|59,3|32,9|4,6|Summary report of the national nutrition survey, 2004. Kabul, Islamic Republic of Afghanistan: Ministry of Public Health and UNICEF, 2005 (and additional analysis).||4667,487 +AFGHANISTAN|Asia|Southern Asia|Low Income|2013|21922|4,0|9,5|40,9|25,0|5,4|Afghanistan National Nutrition Survey 2013.|(pending reanalysis)|5235,867 +ALBANIA|Europe|Southern Europe|Upper Middle Income|1996-98|7642||8,1|20,4|7,1|9,5|National study on nutrition in Albania. Institute of Public Health, Food and Nutrition Section, 1999 (and additional analysis).|Converted estimates|307,887 +ALBANIA|Europe|Southern Europe|Upper Middle Income|2000|1382|6,2|12,2|39,2|17,0|30,0|Multiple indicator cluster survey report Albania (MICS). Committee on Women and Family, Institute of Public Health, Faculty of Social Sciences and UNICEF (Albania). Tirana, Albania: UNICEF, 2000 (and additional analysis).||278,753 +ALBANIA|Europe|Southern Europe|Upper Middle Income|2005|1090|3,7|7,3|26,7|6,6|24,8|Albania multiple indicator cluster survey 2005, final report. Tirana, Albania: Albanian National Institute of Statistics, 2008 (and additional analysis).||219,025 +ALBANIA|Europe|Southern Europe|Upper Middle Income|2008-09|1489|5,9|9,6|23,2|6,3|23,2|Albania demographic and health survey 2008-09. Demographic and Health Surveys. Tirana, Albania: Institute of Statistics, Institute of Public Health and ICF Macro, 2010 (and additional analysis).||179,148 +ALBANIA|Europe|Southern Europe|Upper Middle Income|2017-18|2367|0,5|1,6|11,3|1,5|16,4|Albania Demographic and Health Survey 2017-18. Tirana, Albania: Institute of Statistics, Institute of Public Health, and ICF (and additional analysis)||177,175 +ALGERIA|Africa|Northern Africa|Upper Middle Income|1987|2344||4,0|16,9|8,0||Etat nutritionnel des enfants algériens de 0 à 10 ans et niveaux d'urbanisation d'après les résultats préliminaires de l'enquête épidémiologique sur la malnutrition protéino-énérgétique en 1987. Institut National de Santé Publique, Algiers; 1987.|Converted estimates|3979,1620000000003 +ALGERIA|Africa|Northern Africa|Upper Middle Income|1992|4629|3,0|7,1|22,9|9,2|8,7|Enquête Algérienne sur la santé de la mère et de l'enfant. Office national des statistiques. PAPCHILD surveys. Cairo: Ligue des Etats Arabes, 1992 (and additional analysis).||3942,777 +ALGERIA|Africa|Northern Africa|Upper Middle Income|1995|3825|4,2|9,6|22,5|11,3|13,2|"Enquête nationale sur les objectifs de la mi-decennie, ""MDG Algerie"", 1995. Alger, Algerie, 1996 (and additional analysis)."||3734,288 +ALGERIA|Africa|Northern Africa|Upper Middle Income|2000|4178|1,1|3,1|23,6|5,4|14,7|Enquête nationale sur les objectives de la fin décennie santé mère et enfant EDG Algérie 2000 (MICS). Institut National de Santé Publique. République Algérienne Démocratique et Populaire, 2001 (and additional analysis).||3087,8309999999997 +ALGERIA|Africa|Northern Africa|Upper Middle Income|2002|4357|5,0|9,6|24,0|11,1|15,1|Enquête Algérienne sur la santé de la famille-2002: Rapport principal. Alger, Algérie: Agence Nationale de la Documentation en Santé, 2004 (and additional analysis).||2885,61 +ALGERIA|Africa|Northern Africa|Upper Middle Income|2005|13976|1,6|4,0|15,9|3,7|12,9|Suivi de la situation des enfant et des femmes. Enquête nationale à indicateurs multiples: Rapport principal. MICS3. République Algérienne Démocratique et Populaire, Décembre 2008 (and additional analysis).||2964,659 +ALGERIA|Africa|Northern Africa|Upper Middle Income|2012-13|13860|1,4|4,1|11,7|3,0|12,4|République Algérienne Démocratiqe et Populaire enquête par grappes à indicateurs mulitples (MICS) 2012-2013. Rapport final. Ministère de la Santé, de la Population et de la Réforme Hospitalière, 2015 (and additional analysis)||4340,456 +ANGOLA|Africa|Middle Africa|Lower Middle Income|1996|3016|3,3|8,6|61,7|37,0|1,6|Inquerito de indicadores multiplos (MICS) 1996. Instituto Nacional de Estatistica - Gabinete de Monitorizaçao das Condiçoes de Vida da Populaçao. Luanda, Angola, 1999 (and additional analysis).||2875,53 +ANGOLA|Africa|Middle Africa|Lower Middle Income|2007|10224|4,3|8,2|29,2|15,6||Relatorio do inquerito sobre a nutriçao em Angola 2007. Luanda, Republica de Angola: Ministerio da Saude, Direcçao nacional de Saude Publica, 2008.||4091,763 +ANGOLA|Africa|Middle Africa|Lower Middle Income|2015-16|7468|1,1|4,9|37,6|19,0|3,4|Inquérito de Indicadores Múltiplos e de Saúde em Angola 2015-2016. Luanda, Angola e Rockville, Maryland, EUA: INE, MINSA, MINPLAN e ICF International (and additional analysis)||5277,121999999999 +ARGENTINA|Latin America and the Caribbean|South America|High Income|1994|5296||1,6|7,1|1,7|11,1|The organisation of a national survey for evaluating child psychomotor development in Argentina. Paediatric and Perinatal Epidemiology 1997;11:359-373 (and additional analysis).|Converted estimates|3523,0209999999997 +ARGENTINA|Latin America and the Caribbean|South America|High Income|1995-96|91943||4,2|16,9|4,7|13,5|Encuesta antropometrica en menores de 6 años bajo programa materno infantil. In: Estudios antropometricos en la poblacion infanto-juvenil. Rep. Argentina 1993-1996. Ministerio de Salud y Accion Social. Buenos Aires, 1999 (and additional analysis).|Converted estimates|3514,0679999999998 +ARGENTINA|Latin America and the Caribbean|South America|High Income|2004-05|999999|0,2|1,2|8,2|2,3|9,9|Nutrition status in Argentinean children 6 to 72 months old. Results from the National Nutrition and Health Survey (ENNyS). Archivos Argentinos de Pediatria 2009;107:397-404 (and additional analysis).||3594,8759999999997 +ARMENIA|Asia|Western Asia|Upper Middle Income|1998|3241|1,0|3,3|15,1|2,7|10,8|The health and nutritional status of children an women in Armenia. National Institute of Nutrition - Italy, 1998 (and additional analysis).||222,671 +ARMENIA|Asia|Western Asia|Upper Middle Income|2000-01|1486|0,7|2,5|17,3|2,6|15,7|Armenia demographic and health survey 2000. Demographic and Health Surveys. Calverton, Maryland: National Statistical Service, Ministry of Health, and ORC Macro, 2001 (and additional analysis).||196,554 +ARMENIA|Asia|Western Asia|Upper Middle Income|2005|1377|2,6|5,4|17,9|4,2|11,4|Armenia demographic and health survey 2005. Demographic and Health Surveys. Calverton, Maryland: National Statistical Service, Ministry of Health, and ORC Macro, 2006 (and additional analysis).||186,628 +ARMENIA|Asia|Western Asia|Upper Middle Income|2010|1411|2,0|4,1|20,9|5,3|16,5|Armenia demographic and health survey 2010. Demographic and Health Surveys. Calverton, Maryland: National Statistical Service, Ministry of Health, and ICF International, 2012 (and additional analysis).||201,083 +ARMENIA|Asia|Western Asia|Upper Middle Income|2015-16|1609|1,7|4,5|9,4|2,6|13,7|Armenia Demographic and Health Survey 2015-16. Rockville, Maryland, USA: National Statistical Service, Ministry of Health, and ICF (and additional analysis)||202,199 +AUSTRALIA|Oceania|Australia/New Zealand|High Income|1995-96|1036810||0,0|0,0|0,0|7,9|National nutrition survey Australia 1995. Canberra: Australian Bureau of Statistics and Commonwealth Department of Health and Family Services, 1997 (and additional analysis).|Age-adjusted; converted estimates|1303,522 +AUSTRALIA|Oceania|Australia/New Zealand|High Income|2007|1007|0,0|0,0|2,0|0,2|7,7|The 2007 national children's nutrition and physical activity survey. Canberra, Australia: DoHA, 2010 (and additional analysis).|Age-adjusted;|1329,3670000000002 +AZERBAIJAN|Asia|Western Asia|Upper Middle Income|1996|500||3,8|28,0|8,8|6,1|Health and nutrition survey of internally displaced and resident population of Azerbaijan - April 1996. Baku, Azerbaijan, 1996 (and additional analysis).|Converted estimates|855,429 +AZERBAIJAN|Asia|Western Asia|Upper Middle Income|2000|1787|4,1|9,0|24,2|14,0|6,2|Azerbaijan multiple indicator cluster survey 2000 (MICS). Baku, Azerbaijan: United Nations Children's Fund, 2001 (and additional analysis).||712,543 +AZERBAIJAN|Asia|Western Asia|Upper Middle Income|2001|2426||3,2|18,0|5,9|4,4|UNFPA, UNHCR. Reproductive health survey Azerbaijan, 2001: Final report. Serbanescu F, Morris L, Rahimova S, Stupp P, eds. Atlanta, GA: US Department of Health and Human Services, CDC, 2003 (and additional analysis).|Converted estimates|674,064 +AZERBAIJAN|Asia|Western Asia|Upper Middle Income|2006|2125|2,2|6,8|26,5|8,4|13,9|Azerbaijan demographic and health survey 2006. Demographic and Health Surveys. Calverton, Maryland, USA: State Statistical Committee and Macro International Inc., 2008 (and additional analysis).||656,8610000000001 +AZERBAIJAN|Asia|Western Asia|Upper Middle Income|2011|2505|2,9|6,6|16,4|6,5|10,4|The Demographic and Health Survey, Azerbaijan, 2011 Final Report|(pending reanalysis)|734,926 +AZERBAIJAN|Asia|Western Asia|Upper Middle Income|2013|3613423|1,1|3,2|17,8|4,9|14,1|Azerbaijan nutrition survey (AzNS), 2013. Baku, Republic of Azerbaijan, 2014 (and additional analysis)||813,868 +BAHRAIN|Asia|Western Asia|High Income|1989|2033||6,8|13,9|6,3|7,5|Bahrain child health survey 1989. Manama, Bahrain, 1992.|Converted estimates|65,456 +BAHRAIN|Asia|Western Asia|High Income|1995|673||6,6|13,6|7,6||Bahrain family health survey 1995: principal report. Manama, Bahrain: Ministry of Health, 2000.|Converted estimates (Bahraini)|61,291000000000004 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1985-86|2675||17,3|70,9|66,8|0,2|Report of the child nutrition status module, Bangladesh household expenditure survey 1985-86. Bangladesh bureau of statistics. Dhaka, Bangladesh, 1987 (and additional analysis).|Converted estimates|15921,293 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1989-90|1914||17,5|63,4|61,5|0,6|Report of the child nutrition status survey 1989-90. Bangladesh bureau of statistics. Dhaka, Bangladesh, 1991 (and additional analysis).|Converted estimates|16461,413 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1991|32493|2,6|15,2|73,6|61,2|0,3|Nutritional Surveillance Project 1991: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16573,078999999998 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1992|36997|3,0|16,1|71,5|60,6|0,2|Nutritional Surveillance Project 1992: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16611,504 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1993|42826|2,5|14,0|69,2|56,1|0,4|Nutritional Surveillance Project 1993: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16603,45 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1994|63753|3,2|16,7|67,3|58,0|0,2|Nutritional Surveillance Project 1994: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16591,037 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1995|87051|2,7|15,1|65,8|55,2|0,2|Nutritional Surveillance Project 1995: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16608,371 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1996|81067|2,8|15,5|63,8|54,0|0,3|Nutritional Surveillance Project 1996: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16641,067 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1996-97|5204|6,9|20,7|59,5|53,6|2,3|Bangladesh demographic and health survey 1996-97. Demographic and Health Surveys. National Institute for Population Research and Training. Dhaka, Bangladesh, 1997 (and additional analysis).||16684,087 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1998|49496|2,3|15,0|59,3|50,7|0,2|Nutritional Surveillance Project 1998: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16734,686 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1999|49374|2,0|13,7|59,9|49,5|0,6|Nutritional Surveillance Project 1999: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16779,926 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|1999-00|6007|2,5|12,5|51,1|42,4|0,9|Bangladesh demographic and health survey 1999-2000 (DHS). Dhaka, Bangladesh and Calverton, Maryland: National Institute of Population Research and Training, Mitra and Associates, and ORC Macro, 2001 (and additional analysis).||16814,042 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2001|63444|2,3|12,7|53,2|43,2|0,9|Nutritional Surveillance Project 2001: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16914,645 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2002|53315|2,1|12,4|51,4|41,0|1,0|Nutritional Surveillance Project 2002: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16952,624 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2003|86999|2,1|12,5|47,8|38,9|1,0|Nutritional Surveillance Project 2003: data on rural national (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008.| Adjusted NR to NA; nutritional surveillance|16933,025 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2004|6253|3,5|14,6|50,5|42,8|0,9|Bangladesh demographic and health survey 2004. Demographic and Health Surveys. Dhaka, Bangladesh and Calverton, Maryland [USA]: NIPORT, Mitra and Associates, and ORC Macro, 2005 (and additional analysis).||16860,593 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2005|74758|1,9|11,8|45,9|37,3|1,0|Nutritional Surveillance Project 2005: Rural data (using the WHO Child Growth Standards). Unpublished estimates. Dhakar, Bangladesh: HKI and Institute of Public Health Nutrition, 2007.| Adjusted NR to NA; nutritional surveillance|16744,481 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2006|24302|1,6|11,9|45,1|37,9|0,8|Nutritional Surveillance Project 2006: data on rural national data (using the WHO Child Growth Standards). Unpublished estimates. Dhaka, Bangladesh: HKI and Institute of Public Health Nutrition, 2008 (and additional analysis).| Adjusted NR to NA; nutritional surveillance|16676,261000000002 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2007|5488|2,9|17,5|43,2|41,3|1,1|Bangladesh demographic and health survey 2007. DHS. Dhaka, Bangladesh and Calverton, Maryland, USA: National Institute of Population Research and Training, Mitra and Associates, and Macro International, 2009 (and additional analysis).||16502,793999999998 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2011|8170|4,2|15,7|41,3|36,7|1,9|Bangladesh demographic and health survey 2011. Demographic and Health Surveys. Dhaka, Bangladesh and Calverton, Maryland, USA: NIPORT, Mitra and Associates, and ICF International, 2013 (and additional analysis).||15607,968 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2012-13|19924|2,9|10,7|42,0|32,6|1,6|Bangladesh 2012-13 multiple indicator cluster survey. Final Report. Dhaka, Bangladesh: Bangladesh Bureau of Statistics and UNICEF Bangladesh, 2014 (and additional analysis)||15467,715 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2013|4029|4,9|18,1|38,7|35,1|2,6|Utilization of Essential Service Delivery (UESD) Survey 2013. Dhaka: National Institute of Population Research and Training (NIPORT), 2014.||15390,253999999999 +BANGLADESH|Asia|Southern Asia|Lower Middle Income|2014|7642|3,2|14,4|36,2|32,8|1,6|Bangladesh Demographic and Health Survey 2014. Dhaka, Bangladesh, and Rockville, Maryland, USA: NIPORT, Mitra and Associates, and ICF International. 2016 (and additional analysis)||15329,075 +BARBADOS|Latin America and the Caribbean|Caribbean|High Income|2012|403|2,0|6,8|7,7|3,5|12,2|Barbados multiple indicator cluster survey 2012: Final report (MICS4). Bridgetown, Barbados: BSS, 2014 (and additional analysis)||17,317999999999998 +BELARUS|Europe|Eastern Europe|Upper Middle Income|2005|3031|0,6|2,2|4,5|1,3|9,7|Belarus multiple indicator cluster survey 2005, final report. Minsk, Republic of Belarus: Ministry of Statistics and Analysis [Belarus] and Research Institute of Statistics of the MSA [Belarus], 2007 (and additional analysis).||448,32599999999996 +BELIZE|Latin America and the Caribbean|Central America|Upper Middle Income|1992|8516||||5,4||Assessment of the food, nutrition and health situation of Belize. INCAP Publication DC1/002. Kingston: Institute of Nutrition of Central America and Panama, 1992 (and additional analysis).|Converted estimate|30,405 +BELIZE|Latin America and the Caribbean|Central America|Upper Middle Income|2006|722|0,8|1,9|22,0|5,0|13,6|Multiple indicator cluster survey Belize, 2006. UNICEF (and additional analysis).||37,928000000000004 +BELIZE|Latin America and the Caribbean|Central America|Upper Middle Income|2011|1809|1,2|3,3|19,3|6,2|7,9|Belize multiple indicator cluster survey 2011 (MICS). Belize city, Belize: SIB and UNICEF, 2012 (and additional analysis).||37,53 +BELIZE|Latin America and the Caribbean|Central America|Upper Middle Income|2015-16|2426|0,5|1,8|15,0|4,6|7,3|Belize Multiple Indicator Cluster Survey, 2015-2016, Final Report. Belmopan, Belize: Statistical Institute of Belize and UNICEF Belize (and additional analysis)||39,454 +BENIN|Africa|Western Africa|Low Income|1996|2601|4,6|12,3|39,1|26,2|2,4|Enquête démographique et de santé 1996. Demographic and Health Surveys. Ministère du Plan, de la Restructuration Economique et de la Promotion de l'Emploi. Cotonou, Benin, 1997 (and additional analysis).|Age-adjusted;|1107,596 +BENIN|Africa|Western Africa|Low Income|2001|4158|3,2|9,0|36,2|19,5|3,1|Enquête démographique et de santé au Bénin 2001. Demographic and Health Surveys. Calverton, Maryland, USA: Institut National de la Statistique et de l'Analyse Economique et ORC Macro, 2002 (and additional analysis).||1252,444 +BENIN|Africa|Western Africa|Low Income|2006|14176|3,1|8,5|43,4|19,7|11,2|Enquête démographique et de santé (EDSB-III) - Bénin 2006. Demographic and Health Surveys. Calverton, Maryland, USA : Institut National de la Statistique et de l'Analyse Économique et Macro International Inc., 2007 (and additional analysis).||1413,734 +BENIN|Africa|Western Africa|Low Income|2014|12025|1,7|5,3|34,0|18,6|1,7|Enquête par grappes à indicateurs multiples 2014, Rapport final , Cotonou, Bénin : Institut national de la statistique et de l’analyse économique (and additional analysis)||1704,411 +BENIN|Africa|Western Africa|Low Income|2017-18|12832|1,1|5,0|32,2|16,8|1,9|Enquête Démographique et de Santé au Bénin, 2017-2018 : Indicateurs Clés. Cotonou, Bénin et Rockville, Maryland, USA : INSAE et ICF||1841,7220000000002 +BHUTAN|Asia|Southern Asia|Lower Middle Income|1986-88|3273||5,2|60,9|34,0|3,5|Bhutan Directorate of Health Services. Report on the national nutrition survey. Bhutan; December 1989.|Converted estimates|86,91799999999999 +BHUTAN|Asia|Southern Asia|Lower Middle Income|1999|2996|0,8|2,5|47,7|14,1|3,9|National anthropometric survey of under five children in Bhutan. Division of Health Services. Thimpu, Bhutan, 1999 (and additional analysis).||78,02199999999999 +BHUTAN|Asia|Southern Asia|Lower Middle Income|2008|2162|1,4|4,7|34,9|10,4|4,4|The nutritional status of children in Bhutan: results from the national nutrition survey of 2008 and trends over time. BMC Pediatrics 2012;12:151.||73,359 +BHUTAN|Asia|Southern Asia|Lower Middle Income|2010|6071|2,0|5,9|33,5|12,7|7,6|Bhutan multiple indicator cluster survey (BMIS) 2010. Thimphu, Bhutan: NSB, May 2011 (and additional analysis).||73,48 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|1988|151481||||9,8||Situacion alimentaria y nutricional de Bolivia 1992. La Paz: Instituto Nacional de Alimentacion y Nutricion, 1992 (and additional analysis).|SVEN; converted estimate|1027,01 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|1989|2563|0,5|1,5|44,0|7,8|7,4|Encuesta nacional de demografia y salud 1989. Demographic and Health Surveys. La Paz, Bolivia, 1990 (and additional analysis).|Age-adjusted;|1035,329 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|1990|490699||||9,7||Situacion alimentaria y nutricional de Bolivia 1992. La Paz: Instituto Nacional de Alimentacion y Nutricion, 1992 (and additional analysis).|SVEN; converted estimate|1045,257 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|1991|536952||||10,2||Situacion alimentaria y nutricional de Bolivia 1992. La Paz: Instituto Nacional de Alimentacion y Nutricion, 1992 (and additional analysis).|SVEN; converted estimate|1057,088 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|1992|666872||||10,5||Bolivia: mapa de la desnutricion 1990-1992. La Paz, Bolivia, 1994 (and additional analysis).|SVEN; converted estimate|1068,007 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|1993-94|2730|1,2|3,6|37,1|11,0|6,7|Encuesta nacional de demografia y salud 1994. Demographic and Health Surveys. La Paz, Bolivia, 1994 (and additional analysis).|Age-adjusted;|1089,6660000000002 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|1998|5993|0,7|1,6|33,2|5,9|10,7|Encuesta nacional de demografia y salud 1998. Demographic and Health Surveys. La Paz, Bolivia, 1998 (and additional analysis).||1141,989 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|2003-04|9986|0,6|1,7|32,4|5,8|9,2|Encuesta nacional de demografia y salud (ENDSA) 2003. Demographic and Health Surveys. La Paz, Bolivia: Instituto Nacional de Estadistica, Ministerio de Salud y Deportes, Programa Measure DHS+/ORC Macro, 2004 (and additional analysis).||1180,765 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|2008|8564|0,5|1,4|27,1|4,5|8,7|Encuesta nacional de demografía y salud ENDSA 2008. Demographic and Health Surveys. La Paz, Bolivia: MSD, PRS, INE y Macro International, 2009 (and additional analysis).||1188,421 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|2012|10887|0,5|1,6|18,1|3,6||Encuesta de Evaluación de Salud y Nutrición 2012: Informe de Resultados |(pending reanalysis)|1189,367 +BOLIVIA (PLURINATIONAL STATE OF)|Latin America and the Caribbean|South America|Lower Middle Income|2016|5250|0,9|2,0|16,1|3,4|10,1|Bolivia Encuesta de Demografia y Salud - EDSA 2016: Indicadores Priorizados (and additional analysis)||1188,513 +BOSNIA AND HERZEGOVINA|Europe|Southern Europe|Upper Middle Income|2000|2598|3,5|7,4|12,1|4,2|16,3|Household survey of women and children: Bosnia and Herzegovina 2000 (B&H MICS 2000): Draft final report, May 29, 2002. Sarajevo, Bosnia and Herzegovina: UNICEF, 2002 (and additional analysis).||235,649 +BOSNIA AND HERZEGOVINA|Europe|Southern Europe|Upper Middle Income|2006|3158|1,5|4,0|11,8|1,6|25,6|Bosnia and Herzegovina multiple indicator cluster survey 2006. Sarajevo, Bosnia and Herzegovina: UNICEF, 2007 (and additional analysis).||165,667 +BOSNIA AND HERZEGOVINA|Europe|Southern Europe|Upper Middle Income|2011-12|2199|1,6|2,3|8,9|1,6|17,4|Institute for Public Health [Federation of Bosnia and Herzegovina]. Bosnia and Herzegovina multiple indicator cluster survey (MICS) 2011-2012. Final report. Sarajevo, Federation of Bosnia and Herzegovina: UNICEF, 2013 (and additional analysis).||179,641 +BOTSWANA|Africa|Southern Africa|Upper Middle Income|1996|||13,2|35,1|15,1||The 1996 Botswana family health survey III. Gaborone: Central Statistics Office, 1999 (and additional analysis).|Converted estimates|222,23 +BOTSWANA|Africa|Southern Africa|Upper Middle Income|2000|177285|2,7|5,9|29,1|11,1|10,1|Multiple indicator survey (MIS) 2000. Full report. Gaborone, Botswana, 2001 (and additional analysis).||220,976 +BOTSWANA|Africa|Southern Africa|Upper Middle Income|2007-08|2623|3,2|7,2|31,4|11,2|11,2|2007 Botswana family health survey IV report. Gaborone, Botswana: CSO, 2009 (and additional analysis by UNICEF).||221,702 +BRAZIL|Latin America and the Caribbean|South America|Upper Middle Income|1989|7276|||19,4|5,3||Growth and nutritional status of the Brazilian children: findings from the 1989 National Health and Nutrition Survey. Country Studies on Nutritional Anthropometry NUT/ANTREF/1/91. Geneva: World Health Organization, 1991 (and additional analysis).||18121,635 +BRAZIL|Latin America and the Caribbean|South America|Upper Middle Income|1996|4139|1,0|2,8|13,0|4,5|6,0|Pesquisa nacional sobre demografia e saude 1996. Demographic and Health Surveys. Rio de Janeiro, Brasil: Litografia Tucano Ltda., 1997 (and additional analysis).||17560,196 +BRAZIL|Latin America and the Caribbean|South America|Upper Middle Income|2002-03|17107||||3,7||Pesquisa de orçamentos familiares (POF - 2002-03). Rio de Janeiro, Brazil, 2007 (http://www.ibge.gov.br/home/estatistica/populacao/condicaodevida/pof/2003medidas/default.shtm).||17389,623 +BRAZIL|Latin America and the Caribbean|South America|Upper Middle Income|2006-07|12754059|0,4|1,8|7,0|2,2|6,4|Pesquisa nacional de demografia e saúde da criança e da mulher - PNDS 2006. Relatório da pesquisa. Sao Paulo: CEBRAP, 2008 (and additional analysis).||15733,44 +BRUNEI DARUSSALAM|Asia|South-Eastern Asia|High Income|2009|1126|0,4|2,9|19,7|9,6|8,3|2nd National health and nutritional status survey (NHANSS). Phase 1: 0-5 years old. Brunei Darussalam, January 2013.||31,444000000000003 +BULGARIA|Europe|Eastern Europe|Upper Middle Income|2004|315|1,3|3,2|8,8|1,6|13,6|National monitoring of dietary intake and nutritional status of Bulgarian population, 2004. Department of Nutrition and Public Health, National Center of Public Health Protection, Sofia, Bulgaria (and additional analysis).|Age interval 1-5; unadjusted;|322,05400000000003 +BURKINA FASO|Africa|Western Africa|Low Income|1992-93|4557|5,9|15,4|38,7|28,7|2,8|Enquête démographique et de santé, Burkina Faso 1993. Demographic and Health Surveys. Ouagadougou, Burkina Faso, 1994 (and additional analysis).||1794,8529999999998 +BURKINA FASO|Africa|Western Africa|Low Income|1998-99|3941|5,6|15,6|41,4|30,9|1,9|Enquête démographique et de santé, Burkina Faso 1998-1999. Demographic and Health Surveys. Calverton, Maryland (USA): Macro International Inc., 2000 (and additional analysis).||2113,626 +BURKINA FASO|Africa|Western Africa|Low Income|2003|9290|9,7|21,2|43,1|35,2|5,4|Enquête démographique et de santé du Burkina Faso 2003. Demographic and Health Surveys. Calverton, Maryland, USA: INSD et ORC Macro, 2004 (and additional analysis).||2360,659 +BURKINA FASO|Africa|Western Africa|Low Income|2006|4321|12,1|24,4|40,0|35,9|7,0|Burkina Faso, suivi de la situation des enfants et des femmes. Enquête par grappes à indicateurs multiples 2006. Burkina Faso, 2008 (and additional analysis).||2564,729 +BURKINA FASO|Africa|Western Africa|Low Income|2009|15318|2,7|11,3|35,1|26,0||Enquête nutritionnelle nationale 2009. Ouagadougou, Burkina Faso: Direction de la Nutrition, 2009 (and additional analysis).||2773,744 +BURKINA FASO|Africa|Western Africa|Low Income|2010|7222|5,9|15,5|34,7|26,2|2,8|Enquête démographique et de santé et à indicateurs multiples du Burkina Faso 2010. Demographic and Health Surveys and MICS. Calverton, Maryland, USA: INSD, 2012 (and additional analysis).||2842,945 +BURKINA FASO|Africa|Western Africa|Low Income|2011|47342|2,2|10,4|34,6|25,1|0,7|Rapport enquête nutritionnelle nationale 2011. Ouagadougou, Burkona Faso, 2012 (and additional analysis)||2920,98 +BURKINA FASO|Africa|Western Africa|Low Income|2012|18172|1,9|10,7|32,8|24,3|0,6|Enquête nutritionnelle nationale 2012. Rapport final. Ouagadougou, Burkina Faso, 2012 (and additional analysis)||2986,453 +BURKINA FASO|Africa|Western Africa|Low Income|2013|15312|1,6|8,1|31,3|20,9|0,8|Enquete Nutritionnelle Nationale 2013 (and additional analysis)||3044,453 +BURKINA FASO|Africa|Western Africa|Low Income|2014|15881|1,8|8,6|29,0|20,1|1,1|Enquete Nutritionnelle Nationale - Rapport final, Burkina Faso, Décembre 2014 (and additonal analysis)||3101,095 +BURKINA FASO|Africa|Western Africa|Low Income|2016|9684|1,4|7,5|26,8|18,9|1,2|Enquête nutritionnelle nationale 2016. Burkina Faso SMART Survey, Rapport final, December 2016 (and additional analysis).||3220,6459999999997 +BURKINA FASO|Africa|Western Africa|Low Income|2017|19504|2,0|8,6|21,1|16,2|1,7|Enquête Nutritionnelle Nationale, Burkina Faso 2017 (and additional analysis)||3281,716 +BURUNDI|Africa|Eastern Africa|Low Income|1987|1956|1,3|6,7|56,2|33,6|1,3|Enquête démographique et de la santé au Burundi, 1987. Demographic and Health Surveys. Gsitega, Burundi, 1988 (and additional analysis).|Age-adjusted;|1006,087 +BURUNDI|Africa|Eastern Africa|Low Income|2000|2359|3,8|9,9|64,0|40,0|1,5|Enquête nationale d'evaluation des conditions de vie de l'enfant et de la femme au Burundi (ENECEF-BURUNDI 2000): Rapport final (MICS). Bujumbura: République du Burundi and UNICEF, 2001 (and additional analysis).||1154,396 +BURUNDI|Africa|Eastern Africa|Low Income|2005|7065||9,0|57,7|35,2||Rapport de l'enquête nationale de nutrition de la population, 2005. Bujumbura, Burundi, October 2006 (and additional analysis).|Converted estimates|1279,3310000000001 +BURUNDI|Africa|Eastern Africa|Low Income|2010-11|3646|1,4|6,0|57,6|29,1|2,9|Enquête démographique et de santé Burundi 2010. Demographic and Health Surveys. Bujumbura, Burundi : ISTEEBU, MSPLS, et ICF International, 2012 (and additional analysis).||1577,319 +BURUNDI|Africa|Eastern Africa|Low Income|2016-17|6464|0,9|5,1|55,9|29,3|1,4|Troisième Enquête Démographique et de Santé. Bujumbura, Burundi 2016-17: ISTEEBU, MSPLS, et ICF (and additional analysis)||1901,345 +CABO VERDE|Africa|Western Africa|Lower Middle Income|1985|9450||4,2|26,8|13,7||Better health data with a portable microcomputer at the periphery: an anthropometric survey in Cape Verde. Bulletin of the World Health Organization 1987;65:651-657 (and additional analysis).|Age-adjusted; converted estimates|57,03 +CABO VERDE|Africa|Western Africa|Lower Middle Income|1994|1610||6,9|21,4|11,8||A saude das crianças menores de cinco anos em Cabo Verde. Ministério de Saude e Promoçao Social e UNICEF. Cabo Verde, 1996 (and additional analysis).|Converted estimates|63,597 +CAMBODIA|Asia|South-Eastern Asia|Lower Middle Income|1996|5773|4,5|13,4|58,6|42,6|6,5|Socio economic survey of Cambodia 1996: Volume 1, summary results. National Institute of Statistics. Phnom Penh, Cambodia, 1997 (and additional analysis).||1750,3029999999999 +CAMBODIA|Asia|South-Eastern Asia|Lower Middle Income|2000|3617|7,5|17,1|49,0|39,7|4,0|Cambodia demographic and health survey 2000. Demographic and Health Surveys. Phnom Penh, Cambodia, and Calverton, Maryland, USA: National Institute of Statistics, Directorate General for Health, and ORC Macro, 2001 (and additional analysis).||1574,6570000000002 +CAMBODIA|Asia|South-Eastern Asia|Lower Middle Income|2005-06|3696|1,8|8,5|42,7|28,3|1,6|Cambodia demographic and health survey 2005. Demographic and Health Surveys. Phnom Penh, Cambodia and Calverton, Maryland, USA: National Institute of Public Health, National Institute of Statistics and ORC Macro, 2006 (and additional analysis).||1531,38 +CAMBODIA|Asia|South-Eastern Asia|Lower Middle Income|2008|49833504|1,9|9,1|39,5|28,3|2,0|Cambodia anthropometrics survey 2008. Phnom Penh, Cambodia: National Institute of Statistics, Ministry of Planning and UNICEF Cambodia, 2009 (and additional analysis).||1620,999 +CAMBODIA|Asia|South-Eastern Asia|Lower Middle Income|2010-11|4087|2,8|11,0|39,8|28,9|1,9|Cambodia demographic and health survey 2010. Demographic and Health Surveys. Phnom Penh, Cambodia and Calverton, Maryland, USA: National Institute of Statistics, Directorate General for Health, and ICF Macro, 2011 (and additional analysis).||1671,681 +CAMBODIA|Asia|South-Eastern Asia|Lower Middle Income|2014|5005|2,5|9,8|32,4|24,1|2,2|Cambodia Demographic and Health Survey 2014. Phnom Penh, Cambodia, and Rockville, Maryland, USA: National Institute of Statistics, Directorate General for Health, and ICF International (and additional analysis)||1758,251 +CAMEROON|Africa|Middle Africa|Lower Middle Income|1991|2421|1,1|4,5|31,6|12,9|4,7|Enquête démographique et de santé Cameroun, 1991. Demographic and Health Surveys. Yaoundé, République du Cameroun, 1992 (and additional analysis).||2239,077 +CAMEROON|Africa|Middle Africa|Lower Middle Income|1998|2070|1,8|6,2|38,2|17,3|8,2|Enquete démographique et de santé, Cameroun 1998. Demographic and Health Surveys. Calverton, Maryland, U.S.A. : Bureau Central des Recensements et des Études de Population et Macro International Inc., 1999 (and additional analysis).|Age-adjusted;|2520,186 +CAMEROON|Africa|Middle Africa|Lower Middle Income|2004|3867|2,3|6,2|35,6|15,1|8,7|Enquête démographique et de santé du Cameroun 2004. Demographic and Health Surveys. Calverton, Maryland, USA: INS et ORC Macro, 2004 (and additional analysis).||2899,3979999999997 +CAMEROON|Africa|Middle Africa|Lower Middle Income|2006|6077|2,9|8,2|37,1|16,5|10,2|Cameroun: Suivi de la situation des enfants et des femmes. Enquête par grappee à indicateurs multiples 2006. Rapport principal. Yaoundé, Cameroun: Institut National de la Statistique et UNICEF, 2008 (and additional analysis).||3081,8920000000003 +CAMEROON|Africa|Middle Africa|Lower Middle Income|2011|6014|2,0|5,7|32,6|15,2|6,4|Enquête démographique et de santé et à indicateurs multiples du Cameroun 2011. Demographic and Health Surveys and MICS. Calverton, Maryland, USA : INS et ICF International, 2012 (and additional analysis)||3477,5640000000003 +CAMEROON|Africa|Middle Africa|Lower Middle Income|2014|6776|1,3|5,2|31,7|14,8|6,7|Enquête par grappes à indicateurs multiples (MICS5), 2014, Rapport Final. Yaoundé, Cameroun, Institut National de la Statistique (and additional analysis)||3679,344 +CANADA|Northern America|Northern America|High Income|2004||||||10,4|Canadian childhood obesity estimates based on WHO, IOTF and CDC cut-points. International Journal of Pediatric Obesity 2010;5:265-73.|Age-adjusted; overweight using BMI-for-age z-scores|1704,406 +CENTRAL AFRICAN REPUBLIC (THE)|Africa|Middle Africa|Low Income|1994-95|2448|2,6|8,7|41,5|24,0|3,7|Enquête demographique et de santé République Centrafricaine 1994-95. Demographic and Health Surveys. Calverton, Maryland, USA: Direction des Statistiques Démographiques et Sociales et Macro Inc., 1995 (and additional analysis).|Age-adjusted;|539,518 +CENTRAL AFRICAN REPUBLIC (THE)|Africa|Middle Africa|Low Income|2000|11700|4,7|10,4|44,4|21,3|10,8|Enquête à indicateurs mutliples - MICS 2000. Rapport Final. Bangui, République Centrafricaine: BBA editions, 2001 (and additional analysis).||612,089 +CENTRAL AFRICAN REPUBLIC (THE)|Africa|Middle Africa|Low Income|2006|7775|5,2|12,6|43,1|26,1|8,1|Suivi de la situation des enfants et des femmes. MICS-3 Résultats de l'enquête nationale à indicateurs multiples couplée avec la sérologie VIH et enémie en RCA 2006. Bangui, Republique Centrafricaine: ICASEES, 2009 (and additional analysis).||686,053 +CENTRAL AFRICAN REPUBLIC (THE)|Africa|Middle Africa|Low Income|2010-11|10233|3,0|8,3|40,7|24,0|1,8|Suivi de la situation des enfants, des femmes et des hommes. Enquête par grappes à indicateurs multiples - MICS couplée avec la sérologie VIH, RCA, 2010: Rapport final. Bangui, RCA: ICASEES, 2012 (and additional analysis)||713,165 +CENTRAL AFRICAN REPUBLIC (THE)|Africa|Middle Africa|Low Income|2012|15458|1,8|7,6|39,6|24,6|1,9|Enquete Nationale Sur La Situation Nutritionnelle et la Mortalité en Republique Centrafricaine, Rapport Finale du 30 Mai au 15 Juillet 2012 (and additional analysis)||724,416 +CHAD|Africa|Middle Africa|Low Income|1996-97|5913|6,1|16,5|44,5|34,3|2,7|Enquête démographique et de santé, Tschad 1996-97. Demographic and Health Surveys. Calverton, Maryland, USA: Bureau Central du Recensement et Macro International Inc., 1998 (and additional analysis).||1515,2420000000002 +CHAD|Africa|Middle Africa|Low Income|2000|5191|4,2|13,9|38,9|29,2|2,7|Enquête par grappes à indicateurs multiples: Rapport complet (MICS). N'Djamena: Direction Generale, Direction de la Statistique, des Etudes Economiques et Demographiques, Bureau Central de Recensement et UNICEF,January 2001 (and additional analysis).||1684,3120000000001 +CHAD|Africa|Middle Africa|Low Income|2004|4871|6,6|16,2|44,4|33,8|4,2|Enquête démographique et de santé Tchad 2004. Demographic and Health Surveys. Calverton, Maryland, U.S.A. : INSEED et ORC Macro, 2005 (and additional analysis).||1947,111 +CHAD|Africa|Middle Africa|Low Income|2010|12903|9,9|19,4|38,7|33,0|2,7|Enquête par grappes à indicateurs multiples (MICS), Tchad 2010: Rapport final. N'Djamena, République du Tchad, 2011 (and additional analysis)||2293,915 +CHAD|Africa|Middle Africa|Low Income|2014-15|11253|4,4|13,3|39,8|29,4|2,8|Enquête Démographique et de Santé et à Indicateurs Multiples du Tchad 2014-2015. Rockville, Maryland, USA: INSEED, MSP et ICF International, 2016 (and additional analysis)||2600,644 +CHILE|Latin America and the Caribbean|South America|High Income|1986|196467||0,7|13,5|2,2|15,4|Estado nutricional de la poblacion infantil, 1986. Santiago, Republica de Chile, 1987 (and additional analysis).|Converted estimates|1346,1860000000001 +CHILE|Latin America and the Caribbean|South America|High Income|1994|1181816||0,5|4,2|0,8|10,1|National health service system. Santiago: Nutrition Unit, 1994 (and additional analysis).|Converted estimates|1413,911 +CHILE|Latin America and the Caribbean|South America|High Income|1995|||0,5|3,9|0,8|10,9|National health service system. Santiago, Chile, December 1995 (and additional analysis).|Converted estimates|1398,9679999999998 +CHILE|Latin America and the Caribbean|South America|High Income|1996|1148353||0,5|3,7|0,7|10,7|National health service system. Santiago, Chile, 1997 (and additional analysis).|Converted estimates|1372,7420000000002 +CHILE|Latin America and the Caribbean|South America|High Income|1998|1063064||0,6|3,3|0,7|11,2|Boletin anual de vigilancia nutricional, año 1998. Departamento Coordinacion e Informatica. Santiago, Republica de Chile, 1999 (and additional analysis).|Converted estimates|1343,818 +CHILE|Latin America and the Caribbean|South America|High Income|1999|1031657||0,5|3,1|0,7|11,9|Boletin anual de vigilancia nutricional, año 1999. Departamento Coordinacion e Informatica. Santiago, Republica de Chile, 2000 (and additional analysis).|Converted estimates|1333,0720000000001 +CHILE|Latin America and the Caribbean|South America|High Income|2001|1002454||0,5|2,8|0,7|12,9|National health service system. Santiago, Chile, 2002 (and additional analysis).|Converted estimates|1305,382 +CHILE|Latin America and the Caribbean|South America|High Income|2002|1022552||0,5|2,5|0,7|12,0|National health service system. Santiago, Chile, 2003 (and additional analysis).|Converted estimates|1290,797 +CHILE|Latin America and the Caribbean|South America|High Income|2003|1022896||0,5|2,5|0,6|12,1|National health service system. Santiago, Chile, 2005. http://deis.minsal.cl/ev/en/ capturado el 9 de junio 2005 (and additional analysis).|Converted estimates|1275,786 +CHILE|Latin America and the Caribbean|South America|High Income|2004|1008335||0,5|2,4|0,6|12,1|National health service system. Santiago, Chile, 2005. http://deis.minsal.cl/ev/en/ capturado el 9 de junio 2005 (and additional analysis).|Converted estimates|1262,786 +CHILE|Latin America and the Caribbean|South America|High Income|2006|973578||0,5|2,2|0,6|11,7|National health service system. Santiago, Chile, 2006. http://deis.minsal.cl/ev/en/ (and additional analysis).|Converted estimates|1248,194 +CHILE|Latin America and the Caribbean|South America|High Income|2007|946528||0,3|2,1|0,6|9,8|Ministerio de Salud. National Health Service System. Santiago, Chile, December 2007 (www.minsal.cl).||1246,249 +CHILE|Latin America and the Caribbean|South America|High Income|2008|964033||0,3|2,0|0,5|9,5|Ministerio de Salud. National Health Service System. Santiago, Chile, December 2008 (www.minsal.cl).||1246,285 +CHILE|Latin America and the Caribbean|South America|High Income|2013|988663||0,3|1,8|0,5|10,1|National health service system: 2013. Santiago, Chile, 2014 (and additional analysis).||1220,741 +CHILE|Latin America and the Caribbean|South America|High Income|2014|839435||0,3|1,8|0,5|9,3|National health service system: 2014. Santiago, Chile, 2015 (and additional analysis).||1206,927 +CHINA|Asia|Eastern Asia|Upper Middle Income|1987|76130||4,8|38,3|18,7||The third national growth and development survey of children in China, 1987 (and additional analysis).|Converted estimates-9 province|120606,621 +CHINA|Asia|Eastern Asia|Upper Middle Income|1990|4332|1,4|4,2|32,3|12,6|5,3|Nutritional status of children aged 0-5 years old in China (1990) - National surveillance system in 7 provinces. Beijing, China: Chinese Center for Disease Control and Prevention, 2010.|NSS: 7 provinces|133229,699 +CHINA|Asia|Eastern Asia|Upper Middle Income|1992|5535|1,3|3,9|38,0|14,2|7,2|The dietary and nutritional status of Chinese population: 1992 national nutrition survey. Beijing: Institute of Nutrition and Food Hygiene, 1995 (and additional analysis).||131239,77800000002 +CHINA|Asia|Eastern Asia|Upper Middle Income|1995|2832|1,8|5,0|31,2|10,7|13,6|Nutritional status of children aged 0-5 years old in China (1995) - National surveillance system in 7 provinces. Beijing, China: Chinese Center for Disease Control and Prevention, 2010.|NSS: 7 provinces|103277,82199999999 +CHINA|Asia|Eastern Asia|Upper Middle Income|1998|13838|0,6|2,4|19,8|6,9|5,5|Nutritional status of children aged 0-5 years old in China (1998) - National (40 nutrition surveillance sites from 26 provinces). Beijing, China: Chinese Center for Disease Control and Prevention, 2010.|NSS: 26 provinces|82804,567 +CHINA|Asia|Eastern Asia|Upper Middle Income|2000|16460|0,5|2,5|17,8|7,4|3,4|Nutritional status of children aged 0-5 years old in China (2000) - National (40 nutrition surveillance sites from 26 provinces). Beijing, China: Chinese Center for Disease Control and Prevention, 2010.|NSS: 26 provinces|81757,54400000001 +CHINA|Asia|Eastern Asia|Upper Middle Income|2002|16564|0,8|3,0|21,8|6,8|9,2|[Trends and prevalence of malnutrition among Chinese children under five years old.] Acta Nutrimenta Sinica 2005;25:185-88 (and additional analysis).||82161,492 +CHINA|Asia|Eastern Asia|Upper Middle Income|2005|15987|0,8|2,9|11,7|4,5|5,9|Nutritional status of children aged 0-5 years old in China (2005) - National (40 nutrition surveillance sites from 26 provinces). Beijing, China: Chinese Center for Disease Control and Prevention, 2010.|NSS: 26 provinces|79269,322 +CHINA|Asia|Eastern Asia|Upper Middle Income|2008|10726|0,6|2,6|9,8|3,8|5,8|Nutritional status of children aged 0-5 years old in China (2008) - National (26 nutrition surveillance sites from rural areas). Beijing, China: Chinese Center for Disease Control and Prevention, 2010.|Adjusted NR to NA; NSS: 26 surveillance sites|81658,41900000001 +CHINA|Asia|Eastern Asia|Upper Middle Income|2009|10635|0,7|2,6|9,0|3,4|5,7|Nutrition and rapid economic development - 2010 research report on nutrition policy in China. Beijing, China: Chinese Center for Disease Control and Prevention, 2010 (and additional analysis).|Adjusted NR to NA; NSS: 26 surveillance sites|81971,341 +CHINA|Asia|Eastern Asia|Upper Middle Income|2010|15399|0,7|2,3|9,4|3,4|6,6|Nutritional status of children aged 0-5 years old in China (2010) - National (38 nutrition surveillance sites from 25 provinces). Beijing, China: Chinese Center for Disease Control and Prevention, 2012 (and additional analysis).|NSS: 25 provinces|82581,42599999999 +CHINA|Asia|Eastern Asia|Upper Middle Income|2013|28840||1,9|8,1|2,4|9,1|China Nutrition and Health Surveillance (CNHS) 2013||84981,605 +COLOMBIA|Latin America and the Caribbean|South America|Upper Middle Income|1986|1317|0,3|1,0|26,6|8,9|4,2|Tercera encuesta nacional de prevalencia del uso de anticonceptivos y primera de demografia y salud, 1986. Demographic and Health Surveys. Institute for Resource Development. Bogota, Colombia, 1988 (and additional analysis).|Age-adjusted;|4301,99 +COLOMBIA|Latin America and the Caribbean|South America|Upper Middle Income|1989|1973||3,8|21,8|8,8||Consistent improvement in the nutritional status of Colombian children between 1965 and 1989. Bulletin of PAHO 1992;26:1-13 (and additional analysis).|Converted estimates|4334,596 +COLOMBIA|Latin America and the Caribbean|South America|Upper Middle Income|1995|4458|0,5|1,7|19,6|6,3|4,5|Encuesta nacional de demografia y salud 1995. Demographic and Health Surveys. Bogota, Colombia, 1995 (and additional analysis).||4351,073 +COLOMBIA|Latin America and the Caribbean|South America|Upper Middle Income|2000|4119|0,4|1,0|18,2|4,9|5,3|Salud sexual y reproductiva en Colombia, encuesta nacional de demografia y salud 2000. Demographic and Health Surveys. Bogota, Colombia: PROFAMILIA, 2000 (and additional analysis).||4151,616 +COLOMBIA|Latin America and the Caribbean|South America|Upper Middle Income|2004-05|12752|0,4|1,6|16,0|5,0|4,2|Resultados encuesta nacional de demografia y salud 2005. Demographic and Health Surveys. Bogota, Colombia: Profamilia y Macro International Inc., 2005 (and additional analysis).||4112,844 +COLOMBIA|Latin America and the Caribbean|South America|Upper Middle Income|2009-10|15775|0,2|0,9|12,6|3,4|4,8|Encuesta nacional de demografia y salud 2010. Demographic and Health Surveys. Bogota, Colombia: Profamilia, 2011 (and additional analysis).||3929,005 +COMOROS (THE)|Africa|Eastern Africa|Low Income|1991-92|1954||5,3|38,5|15,2||Rapport sur l'état nutritionnel et les facteurs impliqués chez les enfants de moins de deux ans en République Fédérale Islamique des Comores 1991. Direction de la Santé Familiale. Comores, 1995 (and additional analysis).|Age-adjusted; converted estimates|77,982 +COMOROS (THE)|Africa|Eastern Africa|Low Income|1996|1005|4,5|10,7|40,0|21,1|5,3|Enquête demographique et de santé, Comores 1996. Demographic and Health Surveys. Centre National de Documentation et de Recherche Scientifique. Moroni, Comores, 1997 (and additional analysis).|Age-adjusted;|83,016 +COMOROS (THE)|Africa|Eastern Africa|Low Income|2000|4314|7,2|13,3|46,9|25,1|21,5|Enquête a indicateurs multiples (MICS 2000): Rapport final (1er draft Février 2001). Moroni, Comoros: UNICEF, 2001 (and additional analysis).||88,75200000000001 +COMOROS (THE)|Africa|Eastern Africa|Low Income|2012|3169|4,5|11,3|31,1|16,9|10,6|Enquête démographique et de santé et à indicateurs multiples aux Comores 2012. Demographic and Health Surveys and MICS. Rockville, MD 20850, USA : DGSP et ICF International, 2014 (and additional analysis).||111,399 +CONGO (THE)|Africa|Middle Africa|Lower Middle Income|1987|2429||6,6|30,1|16,4|1,6|Enquête nationale sur l'état nutritionnel des enfants d'age prescolaire au Congo. Collection Etudes et Theses. Paris: ORSTOM, Institut Français de Recherche Scientifique pour le Développement en Coopération, 1990 (and additional analysis).|Adjusted NR to NA; Converted estimates|379,792 +CONGO (THE)|Africa|Middle Africa|Lower Middle Income|2005|4697|3,0|8,0|31,2|11,9|8,5|Enquête démographique et de santé du Congo 2005. Demographic and Health Surveys. Calverton, Maryland, USA : CNSEE et ORC Macro, 2006 (and additional analysis).||615,452 +CONGO (THE)|Africa|Middle Africa|Lower Middle Income|2011-12|4648|1,7|6,0|24,4|11,8|3,5|Enquête démographique et de santé du Congo (EDSC-II) 2011-2012. Demographic and Health Surveys. Calverton, Maryland, USA : CNSEE et ICF International, 2013 (and additional analysis).||754,671 +CONGO (THE)|Africa|Middle Africa|Lower Middle Income|2014-15|8757|2,6|8,2|21,2|12,3|5,9|Enquête par grappes à indicateurs multiples (MICS5 2014-2015), Rapport final. Brazzaville, Congo : Institut National de la Statistique et UNICEF (and additional analysis)||813,95 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|1989|197000||||2,4||Analisis del estado nutricional de la poblacion Costarricense 1992. Departamento de Nutricion y Atencion Integral, Seccion Vigilancia Nutricional. San Jose, Costa Rica, 1994 (and additional analysis).|NSS; converted estimate|395,31800000000004 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|1990|190000||||2,5||Analisis del estado nutricional de la poblacion Costarricense 1992. Departamento de Nutricion y Atencion Integral, Seccion Vigilancia Nutricional. San Jose, Costa Rica, 1994 (and additional analysis).|NSS; converted estimate|400,13 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|1991|191000||||2,2||Analisis del estado nutricional de la poblacion Costarricense 1992. Departamento de Nutricion y Atencion Integral, Seccion Vigilancia Nutricional. San Jose, Costa Rica, 1994 (and additional analysis).|NSS; converted estimate|402,564 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|1992|176935||||2,0||Analisis del estado nutricional de la poblacion Costarricense 1992. Departamento de Nutricion y Atencion Integral, Seccion Vigilancia Nutricional. San Jose, Costa Rica, 1994 (and additional analysis).|NSS; converted estimate|404,279 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|1993|174000||||2,0||Estado nutricional de preescolares atendidos por el programa de atencion primaria. Departamento de Nutriticion, Seccion de Vigilancia Nutricional. San José, Costa Rica, 1996 (and additional analysis).|NSS; converted estimate|405,24199999999996 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|1994|161000||||1,9||Estado nutricional de preescolares atendidos por el programa de atencion primaria. Departamento de Nutriticion, Seccion de Vigilancia Nutricional. San José, Costa Rica, 1996 (and additional analysis).|NSS; converted estimate|405,64599999999996 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|1996|1008||2,4|8,2|3,8|9,5|Encuesta nacional de nutricion: 1 fasciculo antropometria. San Jose, Costa Rica, 1996 (and additional analysis).|Age-adjusted; converted estimates|404,29400000000004 +COSTA RICA|Latin America and the Caribbean|Central America|Upper Middle Income|2008-09|351||1,0|5,6|1,1|8,1|Encuesta nacional de nutricion 2008-2009. San Jose, Costa Rica, 2011.||356,955 +COTE D'IVOIRE|Africa|Western Africa|Lower Middle Income|1986|1947||10,3|22,5|10,8||Malnutrition in Côte d'Ivoire, prevalence and determinants. Working paper No. 4. Washington D.C.: The World Bank, 1990 (and additional analysis).|Converted estimates|1959,655 +COTE D'IVOIRE|Africa|Western Africa|Lower Middle Income|1994|3486|2,2|8,3|34,2|20,3|2,5|Enquête demographique et de santé, Côte d'Ivoire 1994. Demographic and Health Surveys. Abidjan, Côte d'Ivoire, 1995 (and additional analysis).|Age-adjusted;|2454,409 +COTE D'IVOIRE|Africa|Western Africa|Lower Middle Income|1998-99|1690|1,9|6,9|31,2|18,2|4,6|Enquête démographique et de santé, Côte d'Ivoire 1998-99. Demographic and Health Surveys. Calverton, Maryland, USA: Institut National de la Statistique et ORC Macro, 2001 (and additional analysis).||2757,551 +COTE D'IVOIRE|Africa|Western Africa|Lower Middle Income|2006|8482|3,4|9,0|40,5|16,5|8,9|Enquête à indicateurs multiples, Côte d'Ivoire 2006, Rapport final, Abidjan, Côte d'Ivoire : INS, 2007 (and additional analysis).||3146,3 +COTE D'IVOIRE|Africa|Western Africa|Lower Middle Income|2007|854|5,4|14,0|39,0|29,4|4,9|Evaluation des carences en vitamine A et fer en Côte d'Ivoire (Rapport final). Ministère de la Santé et de l'Hygiène Publique et Helen Keller Int., Abidjan, Côte d'Ivoire, 2009 (and additional analysis).||3188,212 +COTE D'IVOIRE|Africa|Western Africa|Lower Middle Income|2011-12|3680|1,8|7,6|29,9|15,7|3,2|Enquête démographique et de santé et à indicateurs multiples de Côte d'Ivoire 2011-2012. Demographic and Health Surveys and MICS. Calverton, Maryland, USA : INS et ICF International, 2012 (and additional analysis).||3511,797 +COTE D'IVOIRE|Africa|Western Africa|Lower Middle Income|2016|8809|1,2|6,1|21,6|12,8|1,5|Enquête par grappes à indicateurs multiples - Côte d’Ivoire 2016, Rapport Final, Septembre 2017 (and additional analysis)||3860,612 +CUBA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2000|1571||2,4|7,0|3,4||Encuesta de agrupacion de indicadores multiples: Informe final, diciembre del 2000 (MICS2). La Habana, Cuba, 2000 (and additional analysis).|Converted estimates|753,523 +CZECHIA|Europe|Eastern Europe|High Income|1991|32345||2,8|3,1|0,9|6,7|Vth. Nation-wide anthropological survey of children and adolescents 1991 (Czech Republic). Prague: National Institute of Public Health, 1993 (and additional analysis).|Converted estimates|669,528 +CZECHIA|Europe|Eastern Europe|High Income|2001-02|16932|1,0|4,6|2,6|2,1|4,4|6th nationwide anthropological survey of children and adolescents 2001, Czech Republic. Summary results. Prague, Czech Republic: National Institute of Public Health, 2006 (and additional analysis).||417,626 +DEMOCRATIC PEOPLE'S REP. OF KOREA (THE)|Asia|Eastern Asia|Low Income|1998|1263||20,8|63,9|55,5||Nutrition survey of the Democratic People's Republic of Korea. Report by the EU, UNICEF and WFP of a study undertaken in collaboration with the Government to DPRK (Internet, 7 January 1999 at http://www.wfp.org/OP/Countries/dprk/nutrion_survey.html).|Converted estimates; subtotals|2064,2329999999997 +DEMOCRATIC PEOPLE'S REP. OF KOREA (THE)|Asia|Eastern Asia|Low Income|2000|4175||12,2|51,0|24,7||Report of the second multiple indicator cluster survey 2000, DPRK (MICS). Pyongyang, Democratic People's Republic of Korea, 2000.|Converted estimates|1987,652 +DEMOCRATIC PEOPLE'S REP. OF KOREA (THE)|Asia|Eastern Asia|Low Income|2002|5297|3,5|8,7|44,7|17,8|0,9|Nutrition assessment 2002 D.P.R. Korea. Pyongyang: Government of D.P.R. Korea, United Nations Children's Fund and World Food Programme, 2003 (and additional analysis).||1931,5610000000001 +DEMOCRATIC PEOPLE'S REP. OF KOREA (THE)|Asia|Eastern Asia|Low Income|2004|4795||8,5|43,1|20,6||DPRK 2004 nutrition assessment, report of survey results. Democratic People's Republic of Korea: Central Bureau of Statistics, 2005.|Converted estimates|1924,503 +DEMOCRATIC PEOPLE'S REP. OF KOREA (THE)|Asia|Eastern Asia|Low Income|2009|2172|0,5|5,2|32,4|18,8|0,0|The Democratic People's Republic of Korea (DPR Korea) multiple indicator cluster survey 2009 (MICS4). Final Report. Pyongyang, DPR Korea: CBS and UNICEF, 2010.||1773,511 +DEMOCRATIC PEOPLE'S REP. OF KOREA (THE)|Asia|Eastern Asia|Low Income|2012|8036|0,6|4,0|27,9|15,2||Final report of the national nutrition survey 2012, September 17th to October 17th 2012. Pyongyang, Democratic People's Republic of Korea, 2013.||1696,64 +DEMOCRATIC PEOPLE'S REP. OF KOREA (THE)|Asia|Eastern Asia|Low Income|2017|2271|0,5|2,5|19,1|9,3|2,3|DPR Korea Multiple Indicator Cluster Survey 2017, Survey Findings Report. Pyongyang, DPR Korea: Central Bureau of Statistics and UNICEF ||1733,371 +DEMOCRATIC REP. OF THE CONGO (THE)|Africa|Middle Africa|Low Income|1995|4362||11,4|51,0|30,7||Enquête nationale sur la situation des enfants et des femmes au Zaire en 1995. Kinshasa, Zaire, 1996 (and additional analysis).|Converted estimates|7692,581999999999 +DEMOCRATIC REP. OF THE CONGO (THE)|Africa|Middle Africa|Low Income|2001|9170|11,9|20,9|44,4|33,6|6,5|Enquête nationale sur la situation des enfants et des femmes MICS2 / 2001. Rapport d'analyse. Kinshasa, République Démocratique du Congo, juillet 2002 (and additional analysis).||8927,312 +DEMOCRATIC REP. OF THE CONGO (THE)|Africa|Middle Africa|Low Income|2007|4149|4,8|10,4|45,8|25,6|7,0|Enquête démographique et de santé, République Démocratique du Congo 2007. Demographic and Health Surveys. Calverton, Maryland, U.S.A.: Ministère du Plan et Macro International, 2008 (and additional analysis).||10986,313999999998 +DEMOCRATIC REP. OF THE CONGO (THE)|Africa|Middle Africa|Low Income|2010|10784|5,2|10,7|43,4|25,6|4,7|Enquête par grappes à indicateurs multiples en République Démocratique du Congo (MICS-RDC 2010). Rapport final, mai 2011. Kinshasa, République Démocratique du Congo, 2011 (and additional analysis).||12126,623 +DEMOCRATIC REP. OF THE CONGO (THE)|Africa|Middle Africa|Low Income|2013-14|9397|2,9|8,1|42,7|23,4|4,4|Enquête démographique et de santé en République Démocratique du Congo 2013-2014. Demographic and Health Surveys. Rockville, Maryland, USA : MPSMRM, MSP et ICF International, 2014 (and additional analysis).||13347,831 +DJIBOUTI|Africa|Eastern Africa|Lower Middle Income|1989|3750||12,5|28,0|20,2||Enquete couverture vaccinale malnutrition. Republique de Djibouti, Djibouti: Ministere de la Sante Publique et des Affaires Sociales,1990 (and additional analysis).|Converted estimates|103,074 +DJIBOUTI|Africa|Eastern Africa|Lower Middle Income|1996|||14,9|31,7|16,0||Enquête djiboutienne auprès des ménages indicateurs sociaux (EDAM-IS 1996). Ministère du Commerce et du Tourisme, Direction Nationale de la Statistique. Djibouti ville, République de Djibouti, 1997 (and additional analysis).|Converted estimates|96,75200000000001 +DJIBOUTI|Africa|Eastern Africa|Lower Middle Income|2002|1425|9,5|19,4|26,8|24,4|8,4|Enquête djiboutienne sur la santé de la famille (EDSF/PAPFAM) 2002, PAPFAM Rapport final. Djibouti, 2004 (and additional analysis).||105,119 +DJIBOUTI|Africa|Eastern Africa|Lower Middle Income|2012|3153|9,2|21,6|33,5|29,9|8,1|Enquête djiboutienne à indicateurs multiples (EDIM): Rapport preliminaire. Djibouti: Ministère de la Santé et PAPFAM, 2013 (and additional analysis).||99,06700000000001 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|1986|1794|1,0|3,3|20,4|8,7|3,8|Encuesta demografica y de salud, 1986. Demographic and Health Surveys. Consejo Nacional de Poblacion y Familia. Santo Domingo, Republica Dominicana, 1987 (and additional analysis).|Age-adjusted;|961,232 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|1991|2991|0,6|2,1|21,1|8,4|4,2|Encuesta demografica y de salud 1991. Demographic and Health Surveys. Santo Domingo, Republica Dominicana, 1992 (and additional analysis).||993,17 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|1996|3565|0,6|2,0|13,5|4,7|6,7|Encuesta demografica y de salud 1996 (DHS). Centro de Estudios Sociales y Demograficos, Asociacion Dominicana Pro Bienestar de la Familia, Oficina Nacional de Planificacion. Santo Domingo, Republica Dominicana, 1997 (and additional analysis).||1032,126 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|2000|1869|0,5|1,5|7,7|3,3|6,9|Encuesta por conglomerados de indicadores multiples (MICS-2000). Santo Domingo, D.N.: Secretariado Técnico de la Presidencia, Fondo de las Naciones Unidas para la Infancia (UNICEF), 2001 (and additional analysis).||1019,829 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|2002|10666|0,8|2,2|11,6|4,2|8,6|Encuesta demografica y de salud, ENDESA 2002. Demographic and Health Surveys. Santo Domingo, Republica Dominicana: Centro de Estudios Sociales y Demograficos, 2003 (and additional analysis).||1022,1310000000001 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|2006|3782||1,9|10,5|4,6|7,4|Encuesta nacional de hogares de proposito multiples (ENHOGAR 2006): Informe general. Santo Domingo, Republica Dominicana: ONE, 2008 (and additional analysis).|Converted estimates|1065,649 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|2007|10770|0,9|2,3|10,1|3,4|8,3|Encuesta demográfica y de salud 2007. Demographic and Health Surveys. Santo Domingo, República Dominicana: CESDEM y Macro International Inc., 2008 (and additional analysis).||1070,143 +DOMINICAN REPUBLIC (THE)|Latin America and the Caribbean|Caribbean|Upper Middle Income|2013|3667|0,8|2,4|7,1|4,0|7,6|Encuesta demográfica y de salud 2013. Demographic and Health Surveys. Santo Domingo, República Dominicana: CESDEM y ICF International, 2014 (and additional analysis).||1063,448 +ECUADOR|Latin America and the Caribbean|South America|Upper Middle Income|1986|7798||2,3|40,2|14,5||[Diagnostico de la situacion alimentaria, nutricional y de salud de la poblacion ecuatoriana menor de cinco años. Quito: Ministerio de Salud Publica y Consejo Nacional de Desarrollo, 1988 (and additional analysis).|Converted estimates|1335,5179999999998 +ECUADOR|Latin America and the Caribbean|South America|Upper Middle Income|1998|1368536|0,4|2,7|27,9|10,4|2,6|Equidad desde el principio - situacion nutricional de los niños ecuatorianos. Encuesta de condiciones de vida, 1998. Organizacion Panamericana de la Salud y Ministerio de Salud Publica, Ecuador. Washington, D.C.: OPS, 2001 (and additional analysis).||1507,441 +ECUADOR|Latin America and the Caribbean|South America|Upper Middle Income|2004|5263|0,7|2,0|29,2|6,7|5,3|Encuesta demografía y de salud materna e infantil, ENDEMAIN 2004: Informe final. Quito, Ecuador: CEPAR, 2005 (and additional analysis).||1515,4920000000002 +ECUADOR|Latin America and the Caribbean|South America|Upper Middle Income|2005-06|1438765|0,5|2,1|25,9|6,8|5,2|Ecuador - Encuesta de Condiciones De Vida 2005-2006 v.1.4, V Ronda (and additional analysis)||1518,099 +ECUADOR|Latin America and the Caribbean|South America|Upper Middle Income|2012-13|1621518|0,7|2,4|25,4|6,4|7,5|RESUMEN EJECUTIVO. TOMO I. Encuesta Nacional de Salud y Nutrición del Ecuador. ENSANUT-ECU 2011-2013 Ministerio de Salud Pública/Instituto Nacional de Estadística y Censos. (and additional analysis).||1603,808 +ECUADOR|Latin America and the Caribbean|South America|Upper Middle Income|2013-14|1523946|0,6|1,6|23,9|5,1|8,0|Tabulados Encuesta de Condiciones de Vida 2014 - Sexta Ronda (and additional analysis)||1607,961 +EGYPT|Africa|Northern Africa|Lower Middle Income|1988|2077|0,6|1,9|34,0|9,4|6,9|Egypt demographic and health survey 1988. Demographic and Health Surveys. Egypt National Population Council. Cairo, Egypt, 1989 (and additional analysis).|Age-adjusted;|8787,823 +EGYPT|Africa|Northern Africa|Lower Middle Income|1991|3614|2,3|4,5|34,9|10,5|14,9|Egyptian maternal and child health survey (EMCHS). PAPCHILD Surveys. Agency for Public Mobilisation and Statistics. Cairo, Arab Republic of Egypt, 1992 (and additional analysis).||9132,702 +EGYPT|Africa|Northern Africa|Lower Middle Income|1992-93|7644|1,8|4,0|31,1|8,2|14,3|Egypt demographic and health survey 1992. Demographic and Health Surveys. Cairo, Egypt, 1993 (and additional analysis).||8873,349 +EGYPT|Africa|Northern Africa|Lower Middle Income|1995-96|10226|2,3|5,7|34,8|10,8|14,6|Egypt demographic and health survey 1995. Demographic and Health Surveys. National Population Council. Cairo, Egypt, 1996 (and additional analysis).||8510,313 +EGYPT|Africa|Northern Africa|Lower Middle Income|1997-98|3328||7,5|30,9|10,2||Egypt demographic and health survey 1997. Demographic and Health Surveys. El-Zanaty and Associates, Cairo, Egypt, 1998 (and additional analysis).|Converted estimates|8156,704000000001 +EGYPT|Africa|Northern Africa|Lower Middle Income|1998|3997||6,4|26,3|9,4||Egypt demographic and health survey 1998. Demographic and Health Surveys. Cairo, Egypt, 1999 (and additional analysis).|Converted estimates|8158,771 +EGYPT|Africa|Northern Africa|Lower Middle Income|2000|10675|||24,4|||Egypt demographic and health survey 2000. Demographic and Health Surveys. Calverton, Maryland, USA: Ministry of Health and Population [Egypt], National Population Council and ORC Macro, 2001 (and additional analysis).| Weight data possibly flawed|8272,629 +EGYPT|Africa|Northern Africa|Lower Middle Income|2003|5940|1,8|5,2|20,2|8,7|9,2|2003 Egypt interim demographic and health survey. Demographic and Health Survey. Cairo, Egypt: Ministry of Health and Population [Egypt], National Population Council, El-Zanaty and Asociates, and ORC Macro, 2004 (and additional analysis).||8696,987 +EGYPT|Africa|Northern Africa|Lower Middle Income|2005|12828|2,5|5,3|23,9|5,4|14,1|Egypt demographic and health survey 2005. Demographic and Health Surveys. Caire, Egypt: Ministry of Health and Population, National Population Council, El-Zanaty and Associates, and ORC Macro, 2006 (and additional analysis).||9000,943000000001 +EGYPT|Africa|Northern Africa|Lower Middle Income|2008|10047|3,8|7,9|30,7|6,8|20,4|Egypt demographic and health survey 2008. Demographic and Health Surveys. Cairo, Egypt: Ministry of Health, 2009 (and additional analysis).||9427,461 +EGYPT|Africa|Northern Africa|Lower Middle Income|2014|14899|4,8|9,5|22,3|7,0|15,7| Egypt demographic and health survey 2014. Demographic and Health Surveys. Cairo, Egypt and Rockville, Maryland, USA: Ministry of Health and Population and ICF International, 2015 (and additional analysis)||11982,538999999999 +EL SALVADOR|Latin America and the Caribbean|Central America|Lower Middle Income|1988|2002|0,5|2,2|36,7|11,1|3,0|Evaluacion de la situacion alimentaria nutricional en El Salvador (ESANES-88). Ministerio de Salud Publica y Asistencia Social. San Salvador, El Salvador, 1990 (and additional analysis).||738,903 +EL SALVADOR|Latin America and the Caribbean|Central America|Lower Middle Income|1993|3598|0,4|1,4|29,5|7,2|3,9|National family health survey 1993 (FESAL-93). San Salvador: Government of El Salvador, 1994 (and additional analysis).||764,618 +EL SALVADOR|Latin America and the Caribbean|Central America|Lower Middle Income|1998|13788|0,4|1,5|32,3|9,7|3,9|National family health survey 1998: final report (FESAL-98). San Salvador, Republica de San Salvador, C.A., 2000 (and additional analysis).||772,357 +EL SALVADOR|Latin America and the Caribbean|Central America|Lower Middle Income|2002-03|6368|0,3|1,3|24,6|6,1|5,8|Encuesta nacional de salud familiar (FESAL) 2002/03. Informe final (and additional analysis)||687,987 +EL SALVADOR|Latin America and the Caribbean|Central America|Lower Middle Income|2008|605724|0,5|1,6|20,8|6,7|5,7|Encuesta nacional de salud familiar, FESAL 2008. Informe resumido. San Salvador, El Salvador: ADS, 2009 (and additional analysis).||611,036 +EL SALVADOR|Latin America and the Caribbean|Central America|Lower Middle Income|2014|7229|0,4|2,1|13,6|5,0|6,4|Encuesta nacional de salud 2014 - Encuesta de indicadores multiples por conglomerados 2014, Resultados principales. San Salvador, El Salvador: Ministerio de Salud e Instituto Nacional de Salud.||584,868 +EQUATORIAL GUINEA|Africa|Middle Africa|Upper Middle Income|1997|412|2,5|4,0|38,7|13,8|3,4|The economic and nutrition transition in Equatorial Guinea coincided with a double burden of over- and under nutrition. Economics and Human Biology 2010;8:80-87 (and additional analysis).||90,985 +EQUATORIAL GUINEA|Africa|Middle Africa|Upper Middle Income|2000|2429|4,2|9,2|42,6|15,7|13,9|Encuesta de indicadores multiples (MICS 2000): Informe final. Malabo, República de Guinea Educatorial:Ministerio de Planificación y Desarrollo Económico y UNICEF, 2001 (and additional analysis).||102,044 +EQUATORIAL GUINEA|Africa|Middle Africa|Upper Middle Income|2004|33334|1,3|2,8|35,0|10,6|8,3|Nutritional status and its correlates in Equatorial Guinean preschool children: Results from a nationally representative survey. Food and Nutrition Bulletin 2008;29:49-58 (and additional analysis).||118,949 +EQUATORIAL GUINEA|Africa|Middle Africa|Upper Middle Income|2011|1094|1,7|3,1|26,2|5,6|9,7|Encuesta demográfica y de salud en Guinea Ecuatorial (EDSGE-I). Demographic and Health Surveys. Guinea Ecuatorial y Calverton, Maryland, USA: MSBS, MEPIP e ICF, 2012.||155,894 +ERITREA|Africa|Eastern Africa|Low Income|1993|||11,8|69,6|36,9||Children and women in Eritrea: 1994. Government of the State of Eritrea/UNICEF Situation Analysis. Asmara, Eritrea, 1994 (and additional analysis).|Converted estimates|536,756 +ERITREA|Africa|Eastern Africa|Low Income|1995-96|2371|5,1|17,0|47,8|39,6|1,3|Eritrea demographic and health survey 1995. Demographic and Health Surveys. Calverton, Maryland: National Statistics Office and Macro International Inc, 1997 (and additional analysis).|Age-adjusted;|516,888 +ERITREA|Africa|Eastern Africa|Low Income|2002|5721|4,8|15,0|43,0|34,3|1,6|Eritrea demographic and health survey 2002. Demographic and Health Surveys. Calverton, Maryland, USA: National Statistics amd Evaluation Office and ORC Macro, 2003 (and additional analysis).||552,486 +ERITREA|Africa|Eastern Africa|Low Income|2010|6634|4,5|15,3|52,0|39,4|2,0|Eritrea population and health survey 2010. Asmara, Eritrea: National Statistics Office and Fafo Institute for Applied International Studies, 2013. (and additional analysis)||715,42 +ESWATINI|Africa|Southern Africa|Lower Middle Income|2000|3406|0,7|1,7|36,5|9,1|14,9|Multiple indicator cluster survey (MICS): Model full report. Maseru, Swaziland: Central Statistical Office, 2002 (and additional analysis)||157,286 +ESWATINI|Africa|Southern Africa|Lower Middle Income|2006-07|3029|1,3|2,9|29,2|6,0|11,1|Swaziland demographic and health survey 2006-07. Demographic and Health Surveys. Mbabane, Swaziland: Central Statistical Office and Macro International Inc., 2008 (and additional analysis).||159,558 +ESWATINI|Africa|Southern Africa|Lower Middle Income|2008|3817|0,3|1,1|40,4|7,3||Swaziland national nutrition survey report (November 2008). Mbabane, Swaziland: Ministry of Health, 2009.||163,95 +ESWATINI|Africa|Southern Africa|Lower Middle Income|2010|2572|0,7|1,1|30,9|6,2|10,7|Swaziland multiple indicator cluster survey 2010 (MICS): Final report. Mbabane, Swaziland, Central Statistical Office and UNICEF, 2011 (and additional analysis).||169,062 +ESWATINI|Africa|Southern Africa|Lower Middle Income|2014|2641|0,4|2,0|25,5|5,8|9,0|Swaziland Multiple Indicator Cluster Survey 2014. Final Report. Mbabane, Swaziland, Central Statistical Office and UNICEF (and additional analysis)||176,87900000000002 +ETHIOPIA|Africa|Eastern Africa|Low Income|1992|20230||9,2|66,9|41,9||Report on the National Rural Nutrition Survey, Core Module. Transitional Government of Ethiopia, Central Statistical Authority. Statistical Bulletin No 113. Addis Ababa, Ethiopia; 1993.|Adjusted NR to NA; converted est. (22/29 regions)|9725,636999999999 +ETHIOPIA|Africa|Eastern Africa|Low Income|2000|10901|3,8|12,4|57,6|42,0|2,0|Ethiopia demographic and health survey 2000. Demographic and Health Surveys. Addis Ababa, Ethiopia and Calverton, Maryland, USA: Central Statistical Authority and ORC Macro, 2001 (and additional analysis).||12409,891000000001 +ETHIOPIA|Africa|Eastern Africa|Low Income|2005|5015|4,7|12,4|50,4|34,4|5,1|Ethiopia demographic and health survey 2005. Demographic and Health Surveys. Addis Ababa, Ethiopia and Calverton, Maryland, USA: General Statistical Agency and ORC Macro, 2006 (and additional analysis).||13485,013 +ETHIOPIA|Africa|Eastern Africa|Low Income|2010-11|11224|2,9|9,8|44,4|29,2|1,8|Ethiopia demographic and health survey 2011. Demographic and Health Surveys. Addis Ababa, Ethiopia and Calverton, Maryland, USA: Central Statistical Agency and ICF International, 2012 (and additional analysis).||14053,5 +ETHIOPIA|Africa|Eastern Africa|Low Income|2014|4921|2,5|8,7|40,4|25,2|2,6|Ethiopia mini demographic and health survey 2014. Addis Ababa, Ethiopia, 2014.||14688,673 +ETHIOPIA|Africa|Eastern Africa|Low Income|2016|10552|3,0|10,0|38,4|23,6|2,9|Ethiopia Demographic and Health Survey 2016. Addis Ababa, Ethiopia, and Rockville, Maryland, USA. CSA and ICF (and additional analysis)||15177,181 +FIJI|Oceania|Melanesia|Upper Middle Income|1993|618||9,8|4,3|6,9|2,2|1993 National nutrition survey - main report. Suva: National Food and Nutrition Committee, 1995 (and additional analysis).|Converted estimates|98,52 +FIJI|Oceania|Melanesia|Upper Middle Income|2004|818|2,0|6,3|7,5|5,3|5,1|2004 Fiji national nutrition survey: Main report. Suva, Fiji, 2007 (and additional analysis).||89,95200000000001 +GABON|Africa|Middle Africa|Upper Middle Income|2000-01|3179|1,5|4,2|25,9|9,0|5,5|Enquête démographique et de santé Gabon 2000. DHS. Calverton, Maryland: Direction Générale de la Statistique et des Etudes Economiques, et Fonds des Nations Unies pour la Population, et ORC Macro, 2001 (and additional analysis).||185,356 +GABON|Africa|Middle Africa|Upper Middle Income|2012|3999|1,3|3,4|17,0|6,4|7,7|Enquête démographique et de santé du Gabon 2012. Demographic and Health Surveys. Calverton, Maryland, et Libreville, Gabon : DGS et ICF International, 2013 (and additional analysis).||247,01 +GAMBIA (THE)|Africa|Western Africa|Low Income|1996|2401|||36,1|23,2||Report of the progress of the mid-decade goals in the Gambia (MICS), 1996. Banjul: The Republic of The Gambia and UNICEF, 1998 (and additional analysis).|Converted estimates|208,08900000000003 +GAMBIA (THE)|Africa|Western Africa|Low Income|2000|2596|2,5|9,1|24,1|15,4|3,0|The Gambia multiple indicator cluster survey report, 2000 (MICS). Banjul, The Gambia, 2002 (and additional analysis).||232,55900000000003 +GAMBIA (THE)|Africa|Western Africa|Low Income|2005-06|6421|1,8|7,4|27,7|15,8|2,7|The Gambia Multiple Indicator Cluster Survey 2005/2006 Report. Banjul, The Gambia: GBoS, 2007 (and additional analysis).||279,808 +GAMBIA (THE)|Africa|Western Africa|Low Income|2010|11480|2,2|9,7|23,4|17,6|1,9|The Gambia multiple indicator cluster survey 2010 (MICS): Final report. Banjul, The Gambia: GBOS, 2012 (and additional analysis)||310,434 +GAMBIA (THE)|Africa|Western Africa|Low Income|2012|7050|1,6|9,6|21,2|18,0|1,1|2012 National Nutrition Survey in the Gambia using the Standardised Monitoring and Assessment of Relief Transition (SMART) methods (and additional analysis)||327,281 +GAMBIA (THE)|Africa|Western Africa|Low Income|2013|3680|4,3|11,0|24,6|16,5|3,2|The Gambia Demographic and Health Survey 2013. Banjul, The Gambia, and Rockville, Maryland, USA: GBOS and ICF International, 2014 (and additional analysis)||335,659 +GEORGIA|Asia|Western Asia|Lower Middle Income|1999|3434||3,1|16,1|2,7|17,9|Georgia multiple indicator cluster survey 1999 (MICS). Tibilisi, Georgia, 2000 (and additional analysis).|Converted estimates|301,226 +GEORGIA|Asia|Western Asia|Lower Middle Income|2005|1924|1,1|3,0|14,6|2,4|20,8|Georgia monitoring the situation of children and women. Mulitple indicator cluster survey 2005 (and additional analysis).||249,646 +GEORGIA|Asia|Western Asia|Lower Middle Income|2009|3020|0,6|1,6|11,3|1,1|19,9|Report of the Georgia national nutrition survey (GNNS) 2009. Tbilisi, Georgia: NCDC&PH and UNICEF, 2010.||273,752 +GERMANY|Europe|Western Europe|High Income|2003-06|4667|0,1|1,0|1,3|1,1|3,5|2003-2005 Ergebnisse des bundesweiten Kinder- und Jugendgesundheitssurveys (KiGGS).||3599,277 +GHANA|Africa|Western Africa|Lower Middle Income|1988|1934|1,6|7,0|42,6|24,8|0,8|Ghana demographic and health survey 1988. Demographic and Health Surveys. Ghana Statistical Service. Accra, Ghana, 1989 (and additional analysis).|Age-adjusted;|2368,05 +GHANA|Africa|Western Africa|Lower Middle Income|1993-94|1970|3,8|10,9|41,2|25,8|2,5|Ghana demographic and health survey 1993. Demographic and Health Surveys. Calverton, Maryland: GSS and MI, 1994 (and additional analysis).|Age-adjusted;|2602,14 +GHANA|Africa|Western Africa|Lower Middle Income|1998-99|2656|2,5|9,9|30,6|20,1|2,7|Ghana demographic and health survey 1998. Demographic and Health Surveys. Calverton, Maryland: GSS and MI, 1999 (and additional analysis).||2916,815 +GHANA|Africa|Western Africa|Lower Middle Income|2003|3356|2,8|8,4|35,4|19,0|4,5|Ghana demographic and health survey 2003. Demographic and Health Surveys. Calverton, Maryland: GSS, NMIMR, and ORC Macro, 2004 (and additional analysis).||3135,8940000000002 +GHANA|Africa|Western Africa|Lower Middle Income|2006|3237|1,8|6,0|27,9|13,9|2,6|Monitoring the situation of children, women and men. Multiple indicator cluster survey 2006 (and additional analysis).||3301,68 +GHANA|Africa|Western Africa|Lower Middle Income|2008|2708|2,4|8,7|28,4|14,4|5,7|Ghana demographic and health survey 2008. Demographic and Health Surveys. Accra, Ghana: GSS, GHS, and ICF Macro, 2009 (and additional analysis).||3455,835 +GHANA|Africa|Western Africa|Lower Middle Income|2011|7374|2,2|6,9|22,8|14,0|2,5|Ghana multiple indicator cluster survey (MICS) with an enhanced malaria module and biomarker 2011: Final report. Accra, Ghana, 2012 (and additional analysis)||3728,445 +GHANA|Africa|Western Africa|Lower Middle Income|2014|2911|0,7|4,7|18,8|11,2|2,6| Ghana Demographic and Health Survey 2014. Rockville, Maryland, USA: GSS, GHS, and ICF International (and additional analysis)||3963,27 +GUATEMALA|Latin America and the Caribbean|Central America|Upper Middle Income|1987|2227|0,4|1,9|66,2|27,9|2,4|Encuesta nacional de salud materno infantil 1987. Demographic and Health Surveys. Ministerio de Salud Publica y Asistencia Social. Guatemala, Central America, 1989 (and additional analysis).|Age-adjusted;|1530,355 +GUATEMALA|Latin America and the Caribbean|Central America|Upper Middle Income|1995|8028|1,5|3,8|55,4|21,7|6,2|Encuesta nacional de salud materno infantil 1995. Demographic and Health Surveys. Ciudad de Guatemala, Guatemala, 1996 (and additional analysis).||1766,975 +GUATEMALA|Latin America and the Caribbean|Central America|Upper Middle Income|1998-99|3762|1,4|2,9|53,1|20,3|6,9|Encuesta nacional de salud materno infantil 1998-1999. Demographic and Health Surveys. Ciudad de Guatemala, Guatemala, 1999 (and additional analysis).||1874,5629999999999 +GUATEMALA|Latin America and the Caribbean|Central America|Upper Middle Income|2000|1684954|1,6|3,7|51,0|18,8|7,3|Guatemala Living Standards Measurement Survey 2000. Washington DC, United States: World Bank (and additional analysis)||1895,158 +GUATEMALA|Latin America and the Caribbean|Central America|Upper Middle Income|2002|5625|0,8|1,9|54,8|18,2|5,2|Guatemala encuesta nacional de salud materno infantil 2002. Ciudad de Guatemala, Republica de Guatemala: Oscar de Leon Palacios, 2003 (and additional analysis).||1931,725 +GUATEMALA|Latin America and the Caribbean|Central America|Upper Middle Income|2008-09|8647|0,2|1,1|48,0|13,0|4,9|Encuesta nacional de salud materno infantil 2008 (ENSMI-2008/09). Ciudad de Guatemala, Guatemala: Ministerio de Salud Pública, MSPAS, INE y CDC, 2010 (and additional analysis).||1956,264 +GUATEMALA|Latin America and the Caribbean|Central America|Upper Middle Income|2014-15|12609|0,1|0,8|46,7|12,4|4,9| Encuesta Nacional de Salud Materno Infantil 2014-2015. Ciudad de Guatemala, Guatemala, 2015 (and additional analysis)||1994,029 +GUINEA|Africa|Western Africa|Low Income|1994-95|3542||14,0|35,3|21,2||Enquête intégrale sur les conditions de vie des ménages avec module budget et consommation (EIBC) 1994-95. Ministère du Plan et de la Coopération, Direction Nationale de la Statistique. Conakry, République de Guinée, 1998.|Converted estimates|1353,171 +GUINEA|Africa|Western Africa|Low Income|1999|3098|4,0|9,7|31,1|20,0|4,4|Enquête démographique et de santé, Guinée 1999. Demographic and Health Surveys. Direction Nationale de la Statistique. Conakry , Guinée, 2000 (and additional analysis).||1524,316 +GUINEA|Africa|Western Africa|Low Income|2005|2903|4,2|11,0|39,2|22,7|5,2|Enquête démographique et de santé, Guinée 2005. Demographic and Health Surveys. Direction Nationale de la Statistique. Calverton, Maryland, U.S.A.: DNS et ORC Macro, 2006 (and additional analysis).||1659,749 +GUINEA|Africa|Western Africa|Low Income|2007-08|11781|2,8|8,3|40,0|20,8||le suivi des principaux indicateurs de survie de l'enfant. Rapport provisoire, Mai 2008 (30/12/09 http://ochaonline.un.org/CoordinationIASC/Securitealimentairenutrition/tabid/5651/language/fr-FR/Default.aspx).| Période de récolte|1720,787 +GUINEA|Africa|Western Africa|Low Income|2011-12|6967|1,1|5,1|34,1|15,8|3,1|Enquête nationale nutrition-santé, basée sur la méthodologie SMART, 2011-12. Rapport final. Conakry, Republique de Guinée, 2012 (and additional analysis).||1839,6589999999999 +GUINEA|Africa|Western Africa|Low Income|2012|3674|4,1|10,0|31,1|18,8|3,8|Enquête démographique et de santé (EDS-IV) et enquête par grappe à indicateurs multiples (MICS). L'EDS-MICS 2012. Conakry, Guinée et Calverton, MD: INS et ICF, 2013 (and additional analysis).||1866,37 +GUINEA|Africa|Western Africa|Low Income|2016|7138|2,9|8,1|32,4|18,3|4,0|Enquête par grappes à indicateurs multiples (MICS, 2016), Rapport final, Conakry, Guinée. 2017 (and additional analysis)||1982,894 +GUINEA-BISSAU|Africa|Western Africa|Low Income|2000|4497|4,8|11,8|33,8|19,8|5,0|Multiple indicator cluster survey Guinea-Bissau, 2000 (MICS). Bissau, Guinea-Bissau: General Direction of Planning, National Institute of Statistics and Census and UNICEF, 2000 (and additional analysis).||213,452 +GUINEA-BISSAU|Africa|Western Africa|Low Income|2006|5282|4,5|8,8|47,7|17,4|16,9|Enquête par grappes à indicateurs multiples, Guinée-Bissau, 2006, Rapport final. Bissau, Guinée-Bissau : Ministère de l`Economie - Secrétariat d`Etat du Plan et à l`Intégration Régionale, 2006 (and additional analysis).||232,97099999999998 +GUINEA-BISSAU|Africa|Western Africa|Low Income|2010|12420|0,9|5,8|32,2|18,1|3,2|Inquérito aos indicadores múltiplos (MICS), inquérito demográfico de saúde reprodutiva - Guiné-Bissau, 2010: Relatório final. Bissau, Guiné-Bissau, 2011.|(pending reanalysis)|255,954 +GUINEA-BISSAU|Africa|Western Africa|Low Income|2014|7460|1,4|6,0|27,6|17,0|2,3|Inquérito aos Indicadores Múltiplos (MICS) 2014, Principais Resultados. Bissau, Guiné-Bissau: Ministério da Economia e Finanças, Direcçao Geral do Plano Instituto Nacional de Estatística (INE), 2015 (and additional analysis)||280,44599999999997 +GUYANA|Latin America and the Caribbean|South America|Upper Middle Income|1993|581||||16,1||Household income and expenditure survey 1993 and Guyana living standards measurement survey. In: Guyana strategies for reducing poverty. Report No. 12861-GUA. Washington: The World Bank, 1994:50-67 (and additional analysis).|Converted estimate|94,65299999999999 +GUYANA|Latin America and the Caribbean|South America|Upper Middle Income|1997|289||13,3|14,0|10,3|1,9|Micronutrient study report - Guyana survey - Vitamin A, beta-carotene, iron and iodine status. PAHO/CFNI/97.J5. Kingston, Jamaica, 1997 (and additional analysis).|Converted estimates|102,931 +GUYANA|Latin America and the Caribbean|South America|Upper Middle Income|2000|2562|4,3|12,1|13,9|11,9|5,5|Guyana multiple indicator cluster survey (MICS). Georgetown, Guyana, 2001 (and additional analysis).||95,93700000000001 +GUYANA|Latin America and the Caribbean|South America|Upper Middle Income|2006-07|2267|2,6|8,3|17,9|10,8|6,8|Guyana multiple indicator cluster survey 2006, final report. Georgetown, Guyana: Bureau of Statistics and UNICEF, 2008 (and additional analysis).||81,19 +GUYANA|Latin America and the Caribbean|South America|Upper Middle Income|2009|1656|1,2|5,6|19,3|11,0|6,7|Guyana demographic and health survey 2009. Demographic and Health Surveys. Georgetown, Guyana: MOH, BOS, and ICF Macro, 2010 (and additional analysis).||75,544 +GUYANA|Latin America and the Caribbean|South America|Upper Middle Income|2014|3134|1,7|6,4|11,3|8,2|5,3|Guyana Multiple Indicator Cluster Survey 2014, Final Report. Georgetown, Guyana: Bureau of Statistics, Ministry of Public Health and UNICEF (and additional analysis)||74,768 +HAITI|Latin America and the Caribbean|Caribbean|Low Income|1990|1843||5,9|40,1|23,7||Haiti's nutrition situation in 1990: A report based on anthropometric data of the 1990 nutrition surveys. Port-au-Prince, Haiti, 1993 (and additional analysis).|Converted estimates|1158,5739999999998 +HAITI|Latin America and the Caribbean|Caribbean|Low Income|1994-95|2914|3,1|9,3|37,1|23,8|4,3|Enquête mortalité, morbidité et utlisation des services (EMMUS-II) Haiti 1994/95. Demographic and Health Surveys. Pétionville, Haiti, 1995 (and additional analysis).||1177,202 +HAITI|Latin America and the Caribbean|Caribbean|Low Income|2000|6263|1,5|5,5|28,8|13,9|3,1|Enquête mortalité, morbidité et utilisation des services, Haiti 2000. Demographic and Health Surveys. Calverton, Maryland: Ministère de la Santé Publique et de la Population, Institut Haitien de l'Enfance et ORC Macro, 2001 (and additional analysis).||1218,649 +HAITI|Latin America and the Caribbean|Caribbean|Low Income|2005-06|2905|3,3|10,2|29,6|18,9|3,9|Enquête mortalité, morbidité et utilisation des services, Haïti, 2005-2006. DHS. Calverton, Maryland, USA: Ministère de la Santé Publique et de la Population, Institut Haïtien de l'Enfance et Macro International Inc., 2007 (and additional analysis).||1227,4289999999999 +HAITI|Latin America and the Caribbean|Caribbean|Low Income|2012|4591|1,3|5,1|22,0|11,6|3,6|Enquête mortalité, morbidité et utilisation des services, Haïti, 2012. Demographic and Health Surveys. Calverton, Maryland, USA : MSPP, IHE et ICF International, 2012 (and additional analysis).||1253,345 +HAITI|Latin America and the Caribbean|Caribbean|Low Income|2016-17|6646|0,8|3,7|21,9|9,5|3,4|Enquête Mortalité, Morbidité et Utilisation des Services (EMMUS-VI 2016-2017) Pétion-Ville, Haïti, et Rockville, Maryland, USA : IHE et ICF (and additional analysis)||1232,271 +HONDURAS|Latin America and the Caribbean|Central America|Lower Middle Income|1987|3244||2,3|43,3|18,1|2,7|Encuesta nacional de nutricion, Honduras, 1987. Cuadros de frequencias por regiones de salud y nacionales. Ministerio de Salud Publica. Tegucigalpa, Republica de Honduras, 1988 (and additional analysis).|Converted estimates|809,829 +HONDURAS|Latin America and the Caribbean|Central America|Lower Middle Income|1991-92|5961||2,1|42,5|15,8||Encuesta nacional de epidemiologia y salud familiar (ENESF), 1991/92. Tegucigalpa, Republica de Honduras, 1993 (and additional analysis).|Converted estimates|892,59 +HONDURAS|Latin America and the Caribbean|Central America|Lower Middle Income|1993-94|1875||2,7|45,7|16,1||National survey of socio-economic indicators 1993/94. Tegucigalpa, Republica de Honduras, 1996 (and additional analysis).|Converted estimates|930,674 +HONDURAS|Latin America and the Caribbean|Central America|Lower Middle Income|1996|1456|0,3|1,6|38,6|17,9|2,8|National micronutrient survey Honduras 1996. Tegucigalpa, Republic of Honduras, 1997 (and additional analysis).|Age-adjusted;|965,578 +HONDURAS|Latin America and the Caribbean|Central America|Lower Middle Income|2001|5663|0,2|1,3|35,5|12,8|3,0|Honduras encuesta nacional de epidemiologia y salud familiar ENESF-2001/encuesta nacional de salud masculina ENSM-2001: Informe final. Tegucigalpa, Honduras, 2002 (and additional analysis).||1009,513 +HONDURAS|Latin America and the Caribbean|Central America|Lower Middle Income|2005-06|9733|0,3|1,4|29,8|8,7|5,8|Encuesta nacional de salud y demografía 2005-2006. Demographic and Health Surveys. Tegucigalpa, Honduras: SS, INE y Macro International, 2006 (and additional analysis).||1030,28 +HONDURAS|Latin America and the Caribbean|Central America|Lower Middle Income|2011-12|10254|0,3|1,4|22,6|7,1|5,2|Encuesta nacional de salud y demografía 2011-2012. Demographic and Health Surveys. Tegucigalpa, Honduras: SS, INE e ICF International, 2013 (and additional analysis).||976,935 +INDIA|Asia|Southern Asia|Lower Middle Income|1988-90|13548||20,3|62,7|55,5||National Nutrition Monitoring Bureau, 1988-90 (8 States pooled data). Hyderabad, India; 1993 (data reanalyzed for WHO).|Adjusted NR to NA; 8 States; converted estimates|120678,709 +INDIA|Asia|Southern Asia|Lower Middle Income|1991-92|2948||20,0|61,9|52,8||National Nutrition Monitoring Bureau, 1991-92 (8 States pooled data). Hyderabad, India; 1993 (data reanalyzed for WHO).|Adjusted NR to NA; 8 States; converted estimates|122660,364 +INDIA|Asia|Southern Asia|Lower Middle Income|1992-93|38418|7,0|19,9|57,7|51,2|2,9|National family health survey, India 1992-93. Demographic and Health Surveys. Bombay, India, 1995 (and additional analysis).|Age-adjusted;|123230,57 +INDIA|Asia|Southern Asia|Lower Middle Income|1996-97|22959||18,4|45,9|38,4|5,9|Diet and nutrition situation in rural India. Indian Journal of Medical Research 1998;108:243-253 (and additional analysis).|Adjusted NR to NA; 11 States; converted estimates|125787,455 +INDIA|Asia|Southern Asia|Lower Middle Income|1998-99|26403|5,7|17,1|54,2|46,3|2,9|National family health survey (NFHS-2) 1998-99. Demographic and Health Surveys. Mumbai, India, 2000 (and additional analysis).|Age-adjusted;|127025,304 +INDIA|Asia|Southern Asia|Lower Middle Income|2005-06|49149|6,8|20,0|47,8|43,5|1,9|National family health survey (NFHS-3), 2005-06: India: Volume I. Demographic and Health Surveys. Mumbai, India: IIPS, 2007 (and additional analysis).||129854,049 +INDIA|Asia|Southern Asia|Lower Middle Income|2013-14|91273|4,6|15,1|38,7|29,4||Rapid survey on children 2013-2014. India factsheet. . http://wcd.nic.in/ accessed 14 August 2014.|(pending reanalysis)|122588,114 +INDIA|Asia|Southern Asia|Lower Middle Income|2015-16|230448|7,7|20,8|37,9|36,3|2,4|National Family Health Survey (NFHS-4), 2015-16: India. Mumbai: IIPS. 2017 (and additional analysis)||121415,293 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|1987|28169||||35,9||National socioeconomic survey 1987 (SUSENAS-1987). Central Bureau of Statistics. Jakarta, Indonesia, 1992 (and additional analysis).|Converted estimate|22820,857999999997 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|1989|14101||||31,0||The effect of economic crisis on the nutritional status of Indonesian pre-school children. Gizi Indonesia 2000;33-41 (and additional analysis), and http://www.gizi.net, accessed 18/12/03.||22413,764 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|1992|33742||||29,8||The effect of economic crisis on the nutritional status of Indonesian pre-school children. Gizi Indonesia 2000;33-41 (and additional analysis), and http://www.gizi.net, accessed 18/12/03.||21964,595 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|1995|9227||14,9|48,1|30,3|6,5|Indonesia multiple indicator cluster survey (MICS) 1995. Jakarta: UNICEF, 1997 (preliminary results provided by the Centers for Disease Control and Prevention; and additional analysis).|Converted estimates|21890,868 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|1998|25505||||25,8||The effect of economic crisis on the nutritional status of Indonesian pre-school children. Gizi Indonesia 2000;33-41 (and additional analysis), and http://www.gizi.net, accessed 18/12/03.||21544,138 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|1999|78849||||22,8||The effect of economic crisis on the nutritional status of Indonesian pre-school children. Gizi Indonesia 2000;33-41 (and additional analysis), and http://www.gizi.net, accessed 18/12/03.||21349,842 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2000|106147|0,9|5,5|42,4|24,8|1,5|Summary: Second Annual Report of the Nutrition and Health Surveillance System in Indonesia with data from the period 2000-2001, http://www.hki.org/research/nutrition_surveillance.html (and additional analysis).||21307,215 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2001|96417|0,8|5,4|41,6|23,4|1,5|Summary: Second Annual Report of the Nutrition and Health Surveillance System in Indonesia with data from the period 2000-2001, http://www.hki.org/research/nutrition_surveillance.html (and additional analysis).||21510,112 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2002|74360||||23,0||Indonesian nutritional status of children 1989-2005: Poverty and household food security, dietary diversity and infection: which is the most important risk? Gizi Indonesia 2005;28: (and additional analysis).||21757,811 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2003|77110||||23,1||National socioeconomic survey 2003 (SUSENAS-2003). Central Bureau of Statistics. Jakarta, Indonesia, 2006 (and additional analysis).||22064,384 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2004|3116|5,1|14,4|28,6|19,7|5,1|National Institute of Health Research and Development, 2005. National Household Health Survey (SKRT) 2004, Volume 2: Community Health Status in Indonesia. Jakarta, Indonesia, 2007 (and additional analysis).||22387,338 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2005|94652||||24,4||National socioeconomic survey 2005 (SUSENAS-2005). Central Bureau of Statistics. Jakarta, Indonesia, 2006 (and additional analysis).||22680,512000000002 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2007|77808|6,8|14,8|40,1|19,6|11,2|"Basic Health Survey, Riskesdas, 2007. Results to be presented at the ICN in Bangkok, October 2009: ""Changes in malnutrition from 1989 to 2007 in Indonesia"" by Ita Atmarita, Ministry of Health."||23122,406000000003 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2010|18768|5,4|12,3|39,2|18,6|12,3|National report on basic health research, Riskesdas, 2010. Jakarta, Indonesia, 2012 (and additional analysis).||23793,077999999998 +INDONESIA|Asia|South-Eastern Asia|Lower Middle Income|2013|75232|6,7|13,5|36,4|19,9|11,5|National report on basic health research, RISKESDAS, 2013. Jakarta, Indonesia, 2014 (and additional analysis).||24249,408 +IRAN (ISLAMIC REPUBLIC OF)|Asia|Southern Asia|Upper Middle Income|1995|11139||8,1|24,4|13,8|5,5|Cluster survey for evaluation of mid decade goal indicators (MICS). Theran, Islamic Republic of Iran, April 1996 (and additional analysis).|Converted estimates|7630,74 +IRAN (ISLAMIC REPUBLIC OF)|Asia|Southern Asia|Upper Middle Income|1998|2536||6,1|20,4|9,5|6,9|The nutritional status of children, October-November 1998 (ANIS). Teheran: Ministry of Health and Medical Education and UNICEF, 2000 (and additional analysis).|Converted estimates|6747,56 +IRAN (ISLAMIC REPUBLIC OF)|Asia|Southern Asia|Upper Middle Income|2004|34200||4,8|7,1|4,6||Current status and the 10 years trend in the malnutrition indexes of children under 5 years in Iran. Iranian Journal of Epidemiology Spring 2008;4:21-8 (and additional analysis).|Converted estimates|5578,539000000001 +IRAN (ISLAMIC REPUBLIC OF)|Asia|Southern Asia|Upper Middle Income|2010-11||1,4|4,0|6,8|4,1||Iran“s Multiple Indicator Demographic and Health Survey - 2010.|(pending reanalysis)|6630,397 +IRAQ|Asia|Western Asia|Upper Middle Income|1991|2565||4,4|27,6|10,4||Infant and child mortality and nutritional status of Iraqi children after the Gulf conflict: Results of a community-based study. Center for Population and Development Studies, Harvard University, Cambridge, MA, USA; 1992 (and additional analysis).|Converted estimates|3066,48 +IRAQ|Asia|Western Asia|Upper Middle Income|2000|14188|2,4|6,6|28,1|12,8|5,5|Multiple indicator cluster survey (MICS) for the year 2000 (detailed report). Baghdad, Republic of Iraq: UNICEF, 2001 (and additional analysis).||3840,776 +IRAQ|Asia|Western Asia|Upper Middle Income|2003|||5,6|33,7|10,1||Baseline food security analysis in Iraq. Baghdad, Iraq: WFP Iraq Country Office, September 2004 (and additional analysis).|Converted estimates|4095,05 +IRAQ|Asia|Western Asia|Upper Middle Income|2004|16464||6,9|20,0|8,0||Iraq living conditions survey 2004. Volume 1: Tabulation report. Baghdad, Iraq: Central Organization for Statistics and Information Technology, Ministry of Planning and Development Cooperation, 2005 (and additional analysis).|Converted estimates|4161,09 +IRAQ|Asia|Western Asia|Upper Middle Income|2006|16263|2,7|5,8|27,5|7,1|15,0|Iraq multiple indicator cluster survey 2006, Final report. Iraq, 2007 (and additional analysis).||4318,21 +IRAQ|Asia|Western Asia|Upper Middle Income|2011|35633|2,7|6,5|22,1|7,2|11,4|Iraq multiple indicator cluster survey (MICS) 2011: Final report. Baghdad, Iraq: The Central Statistics Organization and the Kurdistan Regional Statistics Office, 2012 (and additional analysis)||5018,159000000001 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1989|860||4,4|12,4|6,3||Jamaica Living Standards and Measurement Survey 1989. Kingston: The World Bank, 1990 (and additional analysis).|Converted estimates|296,683 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1991|709|1,2|5,5|11,8|5,6|2,3|Jamaica survey of living conditions - report 1991. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1992 (and additional analysis).||288,856 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1992|1797|0,3|2,7|14,4|5,7|3,1|Jamaica survey of living conditions 1992. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1994 (and additional analysis).||287,545 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1993|910|2,7|4,4|12,6|6,1|4,6|Jamaica survey of living conditions 1993. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1995 (and additional analysis).||288,711 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1994|951|0,8|2,9|12,1|4,6|6,2|Jamaica survey of living conditions, 1994. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1996 (and additional analysis).||290,48 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1995|976|0,8|4,8|9,7|4,8|5,9|Jamaica survey of living conditions, 1995. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1997 (and additional analysis).||291,551 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1996|980|0,1|2,5|11,2|5,6|3,8|Jamaica survey of living conditions, 1996. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1997 (and additional analysis).||293,447 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1997|918|0,3|2,2|8,7|3,5|5,5|Jamaica survey of living conditions, 1997. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1998 (and additional analysis).||294,212 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1998|2321|0,9|2,6|9,5|3,8|4,3|Jamaica survey of living conditions, 1998. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 1999 (and additional analysis).||293,687 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|1999|736|0,9|2,4|5,7|2,1|6,3|Jamaica survey of living conditions, 1999. Kingston: The Planning Institute and the Statistical Institute of Jamaica, 2000 (and additional analysis).||291,936 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2000|732|1,5|3,0|7,2|3,9|7,3|Jamaica survey of living conditions data set 2000. The Planning Institute and the Statistical Institute of Jamaica, 2001 (and additional analysis).||289,019 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2001|582|1,0|3,2|6,6|4,0|5,8|Jamaica survey of living conditions data set 2001. The Planning Institute and the Statistical Institute of Jamaica, 2002 (and additional analysis).||285,733 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2002|3251|0,7|2,4|8,1|2,7|8,5|Jamaica survey of living conditions data set 2002. The Planning Institute and the Statistical Institute of Jamaica, 2003 (and additional analysis).||279,722 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2004|793|1,1|4,5|4,9|3,1|7,5|Jamaica survey of living conditions data set 2004. The Planning Institute and the Statistical Institute of Jamaica, 2005 (and additional analysis).||264,375 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2006|615|0,9|3,7|7,5|4,8|6,1|Jamaica survey of living conditions data set 2006. The Planning Institute and the Statistical Institute of Jamaica, 2013 (and additional analysis).||247,68599999999998 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2007|665|1,2|2,7|5,4|1,8|8,7|Jamaica survey of living conditions data set 2007. The Planning Institute and the Statistical Institute of Jamaica, 2013 (and additional analysis).||241,847 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2008|1581|0,3|2,5|6,9|2,4|7,7|Jamaica survey of living conditions data set 2008. The Planning Institute and the Statistical Institute of Jamaica, 2013 (and additional analysis).||238,482 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2010|592|1,5|5,0|6,0|3,4|4,1|Jamaica survey of living conditions data set 2010. The Planning Institute and the Statistical Institute of Jamaica, 2013 (and additional analysis).||230,567 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2012|1740|0,8|3,0|6,8|2,7|7,8|Jamaica survey of living conditions data set 2012. The Planning Institute and the Statistical Institute of Jamaica, 2015(and additional analysis).||222,66400000000002 +JAMAICA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2014|584|0,5|3,6|6,0|2,2|8,3|Jamaica survey of living conditions data set 2014. The Planning Institute and the Statistical Institute of Jamaica, 2017 (and additional analysis)||208,845 +JAPAN|Asia|Eastern Asia|High Income|2010|6643|0,2|2,3|7,1|3,4|1,5|Updated Japanese growth references for infants and preschool children, based on historical, ethnic and environmental characteristics. Acta Paediatrica 2014;103(6):e251-e261 (and additional analysis).||5554,595 +JORDAN|Asia|Western Asia|Upper Middle Income|1990|6762|1,5|4,1|19,9|5,1|8,4|Jordan population and family health survey 1990. Demographic and Health Surveys. Ministry of Health. Amman, Jordan, 1992 (and additional analysis).||598,145 +JORDAN|Asia|Western Asia|Upper Middle Income|1997|5651|0,6|2,4|11,1|3,8|4,3|Jordan population and family health survey 1997. Demographic and Health Surveys. Calverton, Maryland: DOS and MI, 1998 (and additional analysis).||722,1510000000001 +JORDAN|Asia|Western Asia|Upper Middle Income|2002|4762|0,8|2,5|11,6|3,7|4,4|Jordan population and family health survey 2002. Demographic and Health Surveys. Calverton, Maryland, USA: Department of Statistics and ORC Macro, 2003 (and additional analysis).||754,696 +JORDAN|Asia|Western Asia|Upper Middle Income|2009|4118|0,2|1,6|8,2|1,9|6,6|Jordan population and family health survey 2009. Demographic and Health Surveys. Calverton, Maryland, USA: Department of Statistics and ICF Macro, 2010 (and additional analysis).||922,842 +JORDAN|Asia|Western Asia|Upper Middle Income|2012|5924|0,7|2,4|7,8|3,0|4,7|Jordan population and family health survey 2012. Demographic and Health Surveys. Calverton, Maryland, USA: Department of Statistics and ICF International, 2013 (and additional analysis).||1084,774 +KAZAKHSTAN|Asia|Central Asia|Upper Middle Income|1995|729|1,8|6,4|23,3|4,4|4,1|Kazakhstan demographic and health survey 1995. Demographic and Health Surveys. Almaty, Kazakhstan, 1996 (and additional analysis).|Age-adjusted;|1470,319 +KAZAKHSTAN|Asia|Central Asia|Upper Middle Income|1999|624|1,0|2,5|13,2|3,8|4,9|Kazakhstan demographic and health survey 1999. Demographic and Health Surveys. Calverton, Maryland: Academy of Preventive Medicine [Kazakhstan] and Macro International Inc., 1999 (and additional analysis).||1139,462 +KAZAKHSTAN|Asia|Central Asia|Upper Middle Income|2006|4400|2,3|4,9|17,5|4,9|16,9|Kazakhstan multiple indicator cluster survey 2006. Final report. Astana, Kazakhstan: UNICEF and Agency of the Republic of Kazakhstan on Statistic, 2007 (and additional analysis).||1313,736 +KAZAKHSTAN|Asia|Central Asia|Upper Middle Income|2010-11|5015|1,7|4,1|13,1|3,7|13,3|Multiple indicator cluster survey (MICS) in the Republic of Kazakhstan (RK), 2010-2011. Final report. Astana, Kazakhstan: the Agency of Statistics, RK and the Republican State Enterprise Information Computing Center, 2012 (and additional analysis).||1606,237 +KAZAKHSTAN|Asia|Central Asia|Upper Middle Income|2015|5304|1,1|3,1|8,0|2,0|9,3|2015 Kazakhstan Multiple Indicator Cluster Survey, Final Report. Astana, Kazakhstan: The Statistics Committee of the Ministry of National Economy of the Republic of Kazakhstan, 2016. ||1991,066 +KENYA|Africa|Eastern Africa|Lower Middle Income|1985-89|6957||5,5|37,0|||Fourth Rural Child Nutrition Survey, 1987. Central Bureau of Statistics, Ministry of Planning and National Development. Republic of Kenya, Nairobi; 1991 (and additional analysis).|Adjusted NR to NA; converted estimates|4204,81 +KENYA|Africa|Eastern Africa|Lower Middle Income|1993|5006|2,6|7,1|40,2|19,4|5,8|Kenya demographic and health survey 1993. Demographic and Health Surveys. Central Bureau of Statistics. Nairobi, Kenya, 1994 (and additional analysis).||4565,4259999999995 +KENYA|Africa|Eastern Africa|Lower Middle Income|1994|3712355|2,4|6,8|41,1|17,9|5,1|Fifth child nutrition survey, 1994. Welfare monitoring survey. Nairobi, Kenya, 1995 (and additional analysis)||4598,795999999999 +KENYA|Africa|Eastern Africa|Lower Middle Income|1998|3050|3,1|7,2|37,4|17,5|5,8|Kenya demographic and health survey 1998. Demographic and Health Surveys. Central Bureau of Statistics. Calverton, Maryland: NDPD, CBS, and MI., 1999 (and additional analysis).|Age-adjusted;|5062,827 +KENYA|Africa|Eastern Africa|Lower Middle Income|2000|6418|2,9|7,4|40,8|17,1|8,1|Kenya multiple indicator cluster survey 2000 (MICS). Government of Kenya and Unicef. Nairobi, Kenya, 2002 (and additional analysis).||5422,693 +KENYA|Africa|Eastern Africa|Lower Middle Income|2003|5544|2,4|6,2|35,8|16,4|5,8|Kenya demographic and health survey 2003. Demographic and Health Surveys. Calverton, Maryland: CBS, MOH, and ORC Macro, 2004 (and additional analysis).||5881,097 +KENYA|Africa|Eastern Africa|Lower Middle Income|2005-06|3818246|2,4|6,9|40,2|18,0|7,9|Kenya integrated household budget survey (KIHBS), 2006/06: Revised edition, basic report. Nairobi, Kenya 2006 (and additional analysis).||6079,73 +KENYA|Africa|Eastern Africa|Lower Middle Income|2008-09|5705|2,1|6,9|35,5|16,5|5,0|Kenya demographic and health survey 2008-09. Demographic and Health Surveys. Calverton, Maryland: KNBS and ICF Macro, 2010 (and additional analysis).||6614,54 +KENYA|Africa|Eastern Africa|Lower Middle Income|2014|19250|1,0|4,2|26,2|11,2|4,1|National Council for Population and Development (NCPD). Kenya demographic and health Survey (2014 KDHS): Key indicators. Demongraphic and Health Surveys. Nairobi, Kenya: KNBS, Ministry of Health, NACC, KEMRI, NCPD, 2015 (and additional analysis).||6950,404 +KIRIBATI|Oceania|Micronesia|Lower Middle Income|1985|2941||12,6|34,4|11,3|15,9|National nutrition survey, 1985. Government of Kiribati. South Tarawa, Republic of Kiribati, 1990 (draft version; and additional analysis).|Converted estimates|10,009 +KIRIBATI|Oceania|Micronesia|Lower Middle Income|2009|1045||||14,9||Kiribati demographic and health survey. Noumea, Kiribati: SPC, 2009.||13,196 +KUWAIT|Asia|Western Asia|High Income|1996-97|12376||1,7|5,0|1,5|8,9|Kuwait national nutritional surveillance system. Nutrition unit, Ministry of Health. Al Shaab, Kuwait, 1998 (and additional analysis).|NSS; converted estimate|172,83 +KUWAIT|Asia|Western Asia|High Income|2001|4878|0,4|2,2|4,0|2,2|11,0|Kuwait nutrition surveillance system, 2005 report: 2001-2005 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2006 (and additional analysis).|National Surveillance System|231,22400000000002 +KUWAIT|Asia|Western Asia|High Income|2002|3842|0,5|2,2|3,6|2,1|6,6|Kuwait nutrition surveillance system, 2005 report: 2001-2005 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2006 (and additional analysis).|National Surveillance System|227,484 +KUWAIT|Asia|Western Asia|High Income|2003|4308|0,7|2,6|3,9|2,3|6,8|Kuwait nutrition surveillance system, 2005 report: 2001-2005 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2006 (and additional analysis).|National Surveillance System|218,64 +KUWAIT|Asia|Western Asia|High Income|2004|4381|1,1|3,4|4,1|2,8|7,1|Kuwait nutrition surveillance system, 2005 report: 2001-2005 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2006 (and additional analysis).|National Surveillance System|211,955 +KUWAIT|Asia|Western Asia|High Income|2005|5601|1,0|3,3|4,5|2,7|7,5|Kuwait nutrition surveillance system, 2005 report: 2001-2005 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2006 (and additional analysis).|National Surveillance System|213,65200000000002 +KUWAIT|Asia|Western Asia|High Income|2006|3422|0,6|2,8|4,6|2,7|8,7|Kuwait nutrition surveillance system: 2006-2009 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2010 (and additional analysis).|National Surveillance System|211,59799999999998 +KUWAIT|Asia|Western Asia|High Income|2007|3949|0,8|3,6|5,1|2,9|8,5|Kuwait nutrition surveillance system: 2006-2009 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2010 (and additional analysis).|National Surveillance System|220,34900000000002 +KUWAIT|Asia|Western Asia|High Income|2008|4199|0,5|2,2|5,1|2,3|9,3|Kuwait nutrition surveillance system: 2006-2009 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2010 (and additional analysis).|National Surveillance System|237,334 +KUWAIT|Asia|Western Asia|High Income|2009|4099|0,3|1,8|3,8|1,7|9,0|Kuwait nutrition surveillance system: 2006-2009 trends. Kuwait, State of Kuwait: Administration of Food and Nutrition, Ministry of Health, 2010 (and additional analysis).|National Surveillance System|256,791 +KUWAIT|Asia|Western Asia|High Income|2010|4062|0,6|2,4|4,1|1,7|7,8|Kuwait Nutrition Surveillance System [KNSS] 2010-2012. Kuwait city, Kuwait: Food & Nutrition Administration, 2013 (and additional analysis).||273,83799999999997 +KUWAIT|Asia|Western Asia|High Income|2011|4200|0,4|1,7|4,0|2,1|8,3|Kuwait Nutrition Surveillance System [KNSS] 2010-2012. Kuwait city, Kuwait: Food & Nutrition Administration, 2013 (and additional analysis).||291,37 +KUWAIT|Asia|Western Asia|High Income|2012|3860|0,6|2,4|4,3|2,2|9,5|Kuwait Nutrition Surveillance System [KNSS] 2010-2012. Kuwait city, Kuwait: Food & Nutrition Administration, 2013 (and additional analysis).||302,623 +KUWAIT|Asia|Western Asia|High Income|2013|3571|0,7|2,7|4,8|3,1|7,8|Kuwait Nutrition Surveillance System [KNSS] 2013-2014. Kuwait city, Kuwait: Food & Nutrition Administration, 2015.||307,95 +KUWAIT|Asia|Western Asia|High Income|2014|2864|0,6|2,4|5,8|3,0|8,7|Kuwait Nutrition Surveillance System [KNSS] 2013-2014. Kuwait city, Kuwait: Food & Nutrition Administration, 2015.||309,91200000000003 +KUWAIT|Asia|Western Asia|High Income|2015|3571||3,1|4,9||6,0|The Kuwait Nutrition Surveillance System [KNSS] 2015 Annual Report. Kuwait City. Food & Nutrition Administration|overweight using BMI-for-age z-scores|310,784 +KYRGYZSTAN|Asia|Central Asia|Lower Middle Income|1997|1034|0,8|2,9|36,2|10,4|8,1|Kyrgyz Republic demographic and health survey 1997. Demographic and Health Surveys. Bishkek City, Kyrgyz Republic, 1998 (and additional analysis).|Age-adjusted;|564,401 +KYRGYZSTAN|Asia|Central Asia|Lower Middle Income|2005-06|2944|1,0|3,4|18,1|2,7|10,7|Multiple indicator cluster survey 2006, Kyrkyz Republic. Final report. Bishkek, Kyrkyzstan: National Statistical Committee of the Kyrkyz Republic and United Nations Children's Fund, 2007 (and additional analysis).||495,77099999999996 +KYRGYZSTAN|Asia|Central Asia|Lower Middle Income|2009|1743|0,3|1,3|22,6|4,7|4,4|National survey of the nutritional status of children 6-59 months of age and their mothers, Kyrgyzstan 2009. Bishkek: Ministry of Health, National Statistical Committee, UNICEF, Kyrgyz-Swiss-Swedish Health Project, US CDC, 2010.||573,163 +KYRGYZSTAN|Asia|Central Asia|Lower Middle Income|2012|4421|1,3|2,9|17,9|3,8|8,9|Kyrgyz Republic demographic and health survey 2012. Demographic and Health Surveys. Bishkek, Kyrgyz Republic, and Calverton, Maryland, USA: NSC, MOH, and ICF International, 2013 (and additional analysis).||678,7489999999999 +KYRGYZSTAN|Asia|Central Asia|Lower Middle Income|2014|4441|0,8|2,8|12,9|2,8|7,0|Kyrgyzstan multiple indicator cluster survey 2014: Final Report (MICS). Bishkek, Kyrgyzstan: National Statistical Committee of the Kyrgyz Republic and UNICEF, 2014. ||732,295 +LAO PEOPLE'S DEMOCRATIC REP. (THE)|Asia|South-Eastern Asia|Lower Middle Income|1993|1365||11,8|53,6|39,8||Women and children in the Lao People's Democratic Republic. Results from the LAO social indicator survey (LSIS). Vientiane: Mother and Child Institute, 1994 (and additional analysis).|Converted estimates|819,674 +LAO PEOPLE'S DEMOCRATIC REP. (THE)|Asia|South-Eastern Asia|Lower Middle Income|1994|2950||12,3|52,9|35,9||Diagnostic de la situation nutritionnel et consommationn alimentaire au Laos. Rapport complet de l'étude sur l'état nutritionnel de la population Laotienne. ESNA: TCP/LAO/2354. Rome: Food and Agriculture Organization, 1995 (and additional analysis).|Converted estimates|832,15 +LAO PEOPLE'S DEMOCRATIC REP. (THE)|Asia|South-Eastern Asia|Lower Middle Income|2000|1505|7,6|17,5|48,2|36,4|2,7|Report on national health survey: Health status of the people in Lao PDR. Vientiane, Lao People's Democratic Republic, January 2001 (and additional analysis).||796,669 +LAO PEOPLE'S DEMOCRATIC REP. (THE)|Asia|South-Eastern Asia|Lower Middle Income|2006|3992|1,7|7,4|47,7|31,6|1,3|Lao PDR multiple indicator cluster survey 2006, final report. Vientiane, Lao PDR: Department of Statistics and UNICEF, 2008 (and additional analysis).||755,6510000000001 +LAO PEOPLE'S DEMOCRATIC REP. (THE)|Asia|South-Eastern Asia|Lower Middle Income|2011-12|10814|1,9|6,4|44,2|26,9|2,0|Lao social indicator survey LSIS (MICS/DHS). Vientiane, Lao PDR: MoH and LSB, 2012 (and additional analysis).||789,4630000000001 +LEBANON|Asia|Western Asia|Upper Middle Income|1996|1824|1,6|3,6|17,2|3,5|20,8|Lebanon maternal and child health survey (summary report). PAPCHILD Surveys. Cairo: The League of Arab States, 1998 (and additional analysis).||328,07199999999995 +LEBANON|Asia|Western Asia|Upper Middle Income|2004|1128|2,9|6,6|16,5|4,2|16,7|Lebanon family health survey 2004: Principal report. Tutelian M, Khayyat M , Monem AA, eds. The Pan Arab Project for Family Health, 2006 (additional analysis conducted by PAPFAM).||328,825 +LESOTHO|Africa|Southern Africa|Lower Middle Income|1992|4687||3,2|39,2|13,8||National nutrition survey report, May-June 1992. Maseru, Kingdom of Lesotho, 1992 (and additional analysis).|Converted estimates|257,092 +LESOTHO|Africa|Southern Africa|Lower Middle Income|1993|449||22,4|37,5|18,9||National survey on iodine, vitamin A and iron status of women and children in Lesotho. Maseru, Lesotho, 1994 (and additional analysis).|Age-adjusted; converted estimates|259,601 +LESOTHO|Africa|Southern Africa|Lower Middle Income|2000|3530|3,0|6,8|52,7|14,9|21,0|Kingdom of Lesotho 2000 end decade multiple indicator cluster survey (EMICS). Draft preliminary report. Maseru, Lesotho: Government of Lesotho, Bureau of Statistics and UNICEF, 2002 (and additional analysis).||272,42900000000003 +LESOTHO|Africa|Southern Africa|Lower Middle Income|2004-05|1754|2,2|5,6|44,7|16,6|6,7|Lesotho demographic and health survey 2004. Demographic and Health Surveys. Calverton, Maryland: MOH, BOS, and ORC Macro, 2005 (and additional analysis).||260,186 +LESOTHO|Africa|Southern Africa|Lower Middle Income|2009-10|2138|1,5|3,8|39,3|13,4|7,3|Lesotho demographic and health survey 2009. Demographic and Health Surveys. Maseru, Lesotho: MOHSW and ICF Macro, 2010 (and additional analysis).||254,949 +LESOTHO|Africa|Southern Africa|Lower Middle Income|2014|1914|0,6|2,8|33,4|10,5|7,5|Lesotho demographic and health survey (2014 LDHS): Key indicators. Demographic and Health Surveys. Maseru, Lesotho: Ministry of Health and ICF International, 2015 (and additional analysis).||276,04200000000003 +LIBERIA|Africa|Western Africa|Low Income|1999-00|4702|2,2|7,4|45,3|22,8|4,6|Liberia national nutrition survey 1999-2000. Monrovia, Liberia, 2001 (and additional analysis).||495,149 +LIBERIA|Africa|Western Africa|Low Income|2006-07|5441|3,0|7,9|39,6|20,4|4,2|Liberia demographic and health survey 2007. Demographic and Health Surveys. Monrovia, Liberia: Liberia Institute of Statistics and Geo-Information Services (LISGIS) and Macro International Inc., 2008 (and additional analysis).||598,804 +LIBERIA|Africa|Western Africa|Low Income|2010|6288|0,2|2,8|41,8|14,9||The 2010 State of Food and Nutrition Security in Liberia.|(pending reanalysis)|653,631 +LIBERIA|Africa|Western Africa|Low Income|2013|3625|2,0|5,6|32,1|15,3|3,2|Demographic and health survey 2013. Demographic and Health Surveys. Monrovia, Liberia: Liberia Institute of Statistics and Geo-Information Services (LISGIS) and ICF International, 2014 (and additional analysis).||686,582 +LIBYA|Africa|Northern Africa|Upper Middle Income|1995|4681|1,5|3,6|21,1|4,2|13,4|Libyan maternal and child health survey. PAPCHILD Surveys. Cairo: The League of Arab States, 1997 (and additional analysis).||601,7280000000001 +LIBYA|Africa|Northern Africa|Upper Middle Income|2007|10723|2,9|6,5|21,0|5,6|22,4|National Libyan family health survey. PAPFAM surveys. Cairo: The league of Arab States, 2008 (and additional analysis conducted by PAPFAM).||592,638 +MADAGASCAR|Africa|Eastern Africa|Low Income|1992|4319|1,2|6,4|60,5|35,2|1,6|Enquête nationale démographique et sanitaire 1992. Demographic and Health Surveys. Centre National de Recherches sur l'Environnement. Antananarivo, Madagascar, 1994 (and additional analysis).||2226,883 +MADAGASCAR|Africa|Eastern Africa|Low Income|1993-94|3131||16,4|54,1|40,9||Enquête permanente aupres des menages - rapport principal, décembre 1995. Antananarivo, Madagascar, 1995 (and additional analysis).|Converted estimates|2292,7129999999997 +MADAGASCAR|Africa|Eastern Africa|Low Income|1995|5049||9,0|55,2|30,4||Enquête par grappes a indicateurs multiples [multiple indicators cluster survey (MICS)], Madagascar 1995 (rapport préliminaires). Antananarivo, Madagascar: Institut National de la Statistique et UNICEF, 1996 (and additional analysis).|Converted estimates|2438,716 +MADAGASCAR|Africa|Eastern Africa|Low Income|1997|3331|2,5|8,9|58,2|38,0|2,2|Enquête démographique et de santé, Madagascar 1997. Demographic and Health Surveys. Institut Nacional de la Statistique. Antananarivo, Madgascar, 1998 (and additional analysis).|Age-adjusted;|2611,192 +MADAGASCAR|Africa|Eastern Africa|Low Income|2003-04|5766|5,6|15,2|52,6|36,7|6,2|Enquête Démographique et de Santé de Madagascar 2003-2004. Demographic and Health Surveys. Calverton, Maryland, USA : INSTAT et ORC Macro, 2005 (and additional analysis).||3079,3579999999997 +MADAGASCAR|Africa|Eastern Africa|Low Income|2008-09|5845|||49,4|||Enquête démographique et de santé de Madagascar 2008-2009. Demographic and Health Surveys. Antananarivo, Madagascar: INSTAT et ICF Macro, 2010 (and additional analysis).|Weight data not validated|3352,2009999999996 +MADAGASCAR|Africa|Eastern Africa|Low Income|2012-13|10877|1,3|7,9|48,9|32,9|1,1|Madagascar 2012-13 Millenium Development Goals National Monitoring Survey -ENSOMD (and additional analysis)||3579,718 +MALAWI|Africa|Eastern Africa|Low Income|1992|3419|2,1|6,6|55,4|24,4|9,8|Malawi demographic and health survey 1992. Demographic and Health Surveys. National Statistics Office. Zomba, Malawi, 1993 (and additional analysis).||1843,902 +MALAWI|Africa|Eastern Africa|Low Income|1995|3654||8,5|53,8|26,5||Malawi social indicators survey 1995. MICS surveys. National Statistical Office and the Centre for Social Research. Lilongwe, Malawi, 1996 (and additional analysis).|Converted estimates|1834,6370000000002 +MALAWI|Africa|Eastern Africa|Low Income|1997-98|1038651|4,1|8,7|62,3|24,5|17,3|A relative profile of poverty in Malawi, 1998: A quintile-based poverty analysis of the Malawi integrated household survey, 1997-98. Poverty Monitoring System (and additional analysis).||1958,961 +MALAWI|Africa|Eastern Africa|Low Income|2000|10728|2,9|6,8|54,6|21,5|8,8|Malawi demographic and health survey 2000. Demographic and Health Surveys. Zomba, Malawi and Calverton, Maryland, USA: National Statistical Office and ORC Macro, 2001 (and additional analysis).||2080,159 +MALAWI|Africa|Eastern Africa|Low Income|2004-05|9440|3,2|6,3|52,4|18,6|10,2|Malawi demographic and health survey 2004. Demographic and Health Surveys. Calverton, Maryland: NSO and ORC Macro, 2005 (and additional analysis).||2286,081 +MALAWI|Africa|Eastern Africa|Low Income|2006|22348|1,5|4,2|53,1|15,6|11,3|Malawi multiple indicator cluster survey 2006, Final report. Lilongwe, Malawi: National Statistical Office and UNICEF, 2008. http://www.childinfo.org/mics3_surveys.html accessed 6 February 2009 (and additional analysis).||2415,187 +MALAWI|Africa|Eastern Africa|Low Income|2009|981||1,8|48,8|12,1|4,9|UNICEF and CDC. The national micronutrient survey 2009. Lilongwe, Malawi: Ministry of Health, UNICEF, Irish Aid and CDC, 2011.||2656,238 +MALAWI|Africa|Eastern Africa|Low Income|2010|5167|1,5|4,1|47,3|13,9|9,0|Malawi demographic and health survey 2010. Demographic and Health Surveys. Zomba, Malawi, and Calverton, Maryland, USA: NSO and ICF Macro. 2011 (and additional analysis).||2721,433 +MALAWI|Africa|Eastern Africa|Low Income|2013-14|18523|1,1|3,8|42,4|16,7|5,1|Malawi MDG endline survey 2014. Final Report. Zomba, Malawi: National Statistical Office, 2014 (and additional analysis)||2854,9959999999996 +MALAWI|Africa|Eastern Africa|Low Income|2015-16|5786|0,6|2,8|37,4|11,8|4,6|Malawi Demographic and Health Survey 2015-16. Zomba, Malawi, and Rockville, Maryland, USA. NSO and ICF (and additional analysis)||2887,867 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|1990|316306||||22,1||Annual reports, 1990-1993. Family Health Information System. Information and Documentation Unit. Kuala Lumpur, Malaysia, 1994 (and additional analysis).|NSS; converted estimate|2438,54 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|1991|323299||||23,1||Annual reports, 1990-1993. Family Health Information System. Information and Documentation Unit. Kuala Lumpur, Malaysia, 1994 (and additional analysis).|NSS; converted estimate|2470,317 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|1992|325469||||22,6||Annual reports, 1990-1993. Family Health Information System. Information and Documentation Unit. Kuala Lumpur, Malaysia, 1994 (and additional analysis).|NSS; converted estimate|2501,874 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|1993|313246||||20,5||Annual reports, 1990-1993. Family Health Information System. Information and Documentation Unit. Kuala Lumpur, Malaysia, 1994 (and additional analysis).|NSS; converted estimate|2533,864 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|1994|317551||||19,7||Annual reports, 1994 and 1995. Family Health Information System. Division of Family Health Development. Kuala Lumpur, Malaysia, 1996 (and additional analysis).|NSS; converted estimate|2565,97 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|1995|344736||||17,7||Annual reports, 1994 and 1995. Family Health Information System. Division of Family Health Development. Kuala Lumpur, Malaysia, 1996 (and additional analysis).|NSS; converted estimate|2596,542 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|1999|5108||15,3|20,7|16,7|5,5|A study of malnutrition in under five children in Malaysia. Kuala Lumpur, Malaysia: Ministry of Health, 2000 (and additional analysis).|Converted estimates|2684,1620000000003 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|2006|5546|||17,2|12,9||Nutritional status of children below five years in Malaysia: Anthropometric analyses from the third national health and morbidity survey III (NHMS, 2006). Malaysian Journal of Nutrition 2009;15:121-36.||2479,848 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|2015|2486||8,0|17,7|12,4|7,1|National Health and Morbidity Survey 2015 (NHMS 2015). Vol. II: Non-Communicable Diseases, Risk Factors & Other Health Problems. Kuala Lumpur, Malaysia: IPH, 2015.||2569,345 +MALAYSIA|Asia|South-Eastern Asia|Upper Middle Income|2016|||11,5|20,7|13,7|6,0|National Health and Morbidity Survey 2015 (NHMS 2016)||2612,2470000000003 +MALDIVES|Asia|Southern Asia|Upper Middle Income|1994|1995|3,5|16,1|36,1|32,5|1,2|Nutritional status and child feeding practices of Maldivian children. Department of Public Health. Male, Maldives, 1994.||40,933 +MALDIVES|Asia|Southern Asia|Upper Middle Income|1995|798||18,9|33,0|39,0|2,2|Maldives multiple indicator survey report (MICS). United Nations Children's Fund. Malé, Maldives, June 1996 (and additional analysis).|Converted estimates|39,92 +MALDIVES|Asia|Southern Asia|Upper Middle Income|1997-98|1486|9,2|19,9|43,0|36,7|9,8|Vulnerability and poverty assessment 1998. Male', Republic of Maldives, 1999 (and additional analysis).|Age-adjusted;|36,94 +MALDIVES|Asia|Southern Asia|Upper Middle Income|2001|746|3,5|13,4|31,9|25,7|3,9|Multiple indicator cluster survey (MICS 2) Maldives (draft). Ministry of Health. Male, Republic of Maldives, 2001 (and additional analysis).||31,522 +MALDIVES|Asia|Southern Asia|Upper Middle Income|2009|2840|2,7|10,8|18,6|17,7|6,1|Maldives demographic and health survey 2009. Demographic and Health Surveys. Calverton, Maryland: MOHF and ICF Macro, 2010 (and additional analysis).||31,933000000000003 +MALI|Africa|Western Africa|Low Income|1987|1525|3,2|11,3|35,8|28,6|0,5|Enquête démographique et de santé au Mali, 1987. Demographic and Health Surveys. Bamako, Mali, 1989 (and additional analysis).|Age-adjusted;|1503,1889999999999 +MALI|Africa|Western Africa|Low Income|1995-96|4987|9,8|22,0|39,9|37,7|2,3|Enquête demographique et de santé Mali 1995-1996. Demographic and Health Surveys. Cellule de Planification et de Statistique. Bamako, Mali, 1996 (and additional analysis).|Age-adjusted;|1867,412 +MALI|Africa|Western Africa|Low Income|2001|10568|4,2|12,6|42,5|30,0|3,1|Enquête démographique et de santé au Mali 2001. Demographic and Health Surveys. Calverton, Maryland, USA: CPS/MS, DNSI et ORC Macro, 2002 (and additional analysis).||2143,647 +MALI|Africa|Western Africa|Low Income|2006|12602|6,1|15,4|37,6|27,9|4,7|de l'Économie, de l'Industrie et du Commerce (DNSI/MEIC) et Macro International Inc. Enquête démographique et de santé du Mali 2006. DHS. Calverton, Maryland, USA: CPS/DNSI et Macro International Inc., 2007 (and additional analysis).||2573,9970000000003 +MALI|Africa|Western Africa|Low Income|2009-10|22934|2,2|9,0|27,8|19,1|1,0|Enquête par Grappes à Indicateurs Multiples 2009 - 2010, Rapport final, Bamako Mali, 2011 (and additional analysis)||2931,546 +MALI|Africa|Western Africa|Low Income|2015|14941|3,4|13,5|30,4|25,0|1,9|Enquête par Grappes à Indicateurs Multiples au Mali (MICS-Mali), 2015, Résultats clés. Bamako, Mali, INSTAT (and additional analysis)||3274,1459999999997 +MARSHALL ISLANDS|Oceania|Micronesia|Upper Middle Income|2017|876|1,1|3,5|34,8|11,9|4,1|Republic of the Marshall Islands Integrated Child Health and Nutrition Survey 2017, Final Report. Majuro, Republic of the Marshall Islands: RMI Ministry of Health and Human Services, RMI Economic, Policy Planning and Statistic Office, 2017 (and additional analysis)|oedema not considered|1,0 +MAURITANIA|Africa|Western Africa|Lower Middle Income|1988|931||19,1|40,2|||The socio-economic determinants of nutritional status among children under five in Mauritania. Social Dimensions of Adjustment Surveys. Washington D.C.: The World Bank, 1990 (and additional analysis).|Converted estimates|336,885 +MAURITANIA|Africa|Western Africa|Lower Middle Income|1990|4294|8,0|17,4|54,6|43,1|6,8|Mauritania maternal and child health survey 1990-91 (MMCHS). PAPCHILD Surveys. Nouakchott, Islamic Republic of Mauritania; 1992 (and additional analysis).||353,026 +MAURITANIA|Africa|Western Africa|Lower Middle Income|1995-96|3733||8,7|49,8|20,3||Enquête nationale sur les indicateurs des objectifs à mi-terme en Mauritanie (MICS). Nouakchott, République Islamique de Mauritanie, 1996 (and additional analysis).|Converted estimates|405,332 +MAURITANIA|Africa|Western Africa|Lower Middle Income|2000-01|3824|7,2|15,3|38,6|29,7|3,8|Enquête démographique et de santé Mauritanie 2000-2001. Demographic and Health Surveys. Calverton, Maryland, USA: ONS et ORC Macro, 2001 (and additional analysis).||447,05800000000005 +MAURITANIA|Africa|Western Africa|Lower Middle Income|2007|8107|3,8|13,6|31,5|25,5|2,3|Mauritanie, enquête par grappes à indicateurs multiples 2007. Nouakchott, Mauritania: ONS and UNICEF, 2008 (and additional analysis).||526,951 +MAURITANIA|Africa|Western Africa|Lower Middle Income|2008|6338|1,1|8,1|23,0|15,9|1,0|Enquête rapide nationale sur la nutrition et survie de l'enfant en Mauritanie: Rapport final. Nouakchott, Mauritanie: ANED, ONS et UNICEF, 2008 (and additional analysis).||539,113 +MAURITANIA|Africa|Western Africa|Lower Middle Income|2011|8527|9,0|18,1|29,7|27,7|3,1|Suivi de la situation des femmes et des enfants. Enquête par grappes à indicateurs multiples (MICS) 2011: Rapport final. Nouakchott, Mauritanie: ONS, 2012 (and additional analysis)||581,069 +MAURITANIA|Africa|Western Africa|Lower Middle Income|2012|6569|1,9|11,6|22,0|19,5|1,2|Enquête nutritionnelle nationale utilisant la méthodologie SMART: Résultats préliminaires. Nouakchott, Mauritanie, Juillet 2012 (and additional analysis).||596,372 +MAURITANIA|Africa|Western Africa|Lower Middle Income|2015|9926|3,5|14,8|27,9|24,9|1,3|Mauritanie Enquête par Grappes à Indicateurs Multiples (MICS) 2015 - Rapport Final, Mars 2017 (and additional analysis)||640,1669999999999 +MAURITIUS|Africa|Eastern Africa|Upper Middle Income|1985|2430||18,3|27,3|21,1|8,8|Mauritius national nutrition survey 1985: summary report. Evaluation and Nutrition Unit. Port Louis, Mauritius, 1988 (and additional analysis).|Converted estimates|104,34100000000001 +MAURITIUS|Africa|Eastern Africa|Upper Middle Income|1995|1537||15,7|13,6|13,0|6,5|A survey on nutrition in Mauritius and Rodrigues, 1995 (final report). Port Louis, Mauritius, 1996 (and additional analysis).|Converted estimates|111,01100000000001 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|1988|7422||7,4|28,7|12,4|6,1|Estado nutricional de preescolares y las mujeres en Mexico: resultados de una encuesta probabilistica nacional. Gaceta Medica de Mexico 1990;126:207-226 (and additional analysis).|Converted estimates|11393,073999999999 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|1989|14932|1,7|6,1|26,0|9,6|11,0|Encuesta nacional de alimentacion en el medio rural, 1989 (ENAL). Instituto de la Nutricion 'Salvador Zubiran'. Comision Nacional de Alimentacion. Division de Nutricion, INNSZ. Tlalpan, Mexico, D.F, 1990 (and additional analysis).|Adjusted NR to NA;|11447,713 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|1996|31601||8,5|25,8|10,3||La desnutricion infantil en el medio rural mexicano. Salud Publica de Mexico 1998;40:150-160.|Adjusted NR to NA; converted estimates|11885,226999999999 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|1998-99|10125945|0,7|2,0|21,4|5,6|7,5|Encuesta nacional de nutricion 1999. Tomo 1: Resultados, niños menores de 5 años. Instituto Nacional de Salud Publica. Cuernavaca, Mexico, 2000 (and additional analysis).||11995,837 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|2006|9400075|0,4|2,0|15,5|3,4|7,5|Encuesta nacional de salud y nutrición 2006. Cuernavaca, México: Instituto Nacional de Salud Pública, 2006 (and additional analysis).||11623,607 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|2011-12|10747724|0,4|1,6|13,6|2,8|9,0|Encuesta nacional de salud y nutrición 2012. Resultados nacionales. Cuernavaca, México: Instituto Nacional de Salud Pública, 2012 (and additional analysis).||11459,499 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|2015|7806|0,4|1,0|12,4|3,9|5,2|Encuesta Nacional de Niños, Niñas y Mujeres 2015 - Encuesta de Indicadores Múltiples por Conglomerados 2015, Informe Final. Ciudad de México, México: Instituto Nacional de Salud Pública y UNICEF México (and additional analysis)||11533,065 +MEXICO|Latin America and the Caribbean|Central America|Upper Middle Income|2016|11093877|0,3|2,0|10,0|4,2|5,3|Encuesta nacional de salud y nutrición 2016. Cuernavaca, México: Instituto Nacional de Salud Pública, 2016 (and additional analysis)||11581,28 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|1992|1679||2,4|33,1|11,8||Report of a consultancy on the Mongolian Child Nutrition Survey. Institute of Nutrition. Nakornpathom, Thailand, 1992 (and additional analysis).|Age-adjusted; converted estimates|326,29200000000003 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|1999|4146|1,9|4,3|30,1|10,8|7,0|Report on the 2nd national child and nutrition survey, Mongolia 1999. Institute of Nutrition and Faculty of Medicine, Ramathibodi Hospital, Mahidol University, Thailand, 2000 (and additional analysis).||239,324 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|2000|5918|3,0|7,1|29,8|11,6|12,7|Mongolia child and development survey - 2000 (MICS-2): National report 2001. Ulaanbaatar, Mongolia: National Statistics Office, 2001 (and additional analysis).||233,94 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|2004|1247|0,1|0,6|23,5|4,8|6,1|Nutritional status of Mongolian children and women: 3rd National nutrition survey report. Ulaanbaatar, Mongolia, 2006.||219,17700000000002 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|2005|3357|1,1|2,7|27,5|5,3|14,2|"Mongolia ""Child and Development 2005"" survey (MICS-3), final report. Ulaanbaatar, Mongolia, 2007 (and additional analysis)."||221,60299999999998 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|2010|21390978|0,6|1,9|15,5|4,7|6,7|Population nutrition status. Fourth national survey report. Ulaanbaatar, Mongolia: NTC, 2013 (and additional analysis).||280,317 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|2013|5744|0,4|1,0|10,8|1,6|10,5|Social indicator sample survey 2013 (MICS). Final Report.Ulaanbaatar, Mongolia: National Statistical Office, 2014.||337,111 +MONGOLIA|Asia|Eastern Asia|Lower Middle Income|2016|2243|0,5|1,3|7,3|0,9|11,7|Nutrition Status of the Population of Mongolia: Fifth National Nutrition Survey Report, Ulanbaatar, Mongolia 2017 (and additional analysis)||367,586 +MONTENEGRO|Europe|Southern Europe|Upper Middle Income|2005-06|891|2,2|4,2|7,9|2,2|15,6|Montenegro multiple indicator cluster survey 2005, Final report. Podgorica, Montenegro: MONSTAT, SMMRI and UNICEF, 2006. (and additional analysis).||40,302 +MONTENEGRO|Europe|Southern Europe|Upper Middle Income|2013|1392|1,2|2,8|9,4|1,0|22,3|2013 Montenegro multiple indicator cluster survey and 2013 Montenegro Roma settlements multiple indicator cluster survey, (MICS): Final Report. Podgorica, Montenegro: MONSTAT and UNICEF, 2014 (and additional analysis)||38,514 +MOROCCO|Africa|Northern Africa|Lower Middle Income|1987|4404|1,5|3,9|31,0|10,4|5,6|Enquête national sur la planification familiale, la fécondité et la santé de la population au Maroc (ENPS) 1987. Demographic and Health Surveys. Ministère de la Santé Publique. Rabat, Maroc, 1989 (and additional analysis).||3543,885 +MOROCCO|Africa|Northern Africa|Lower Middle Income|1992|4649|1,1|2,6|30,1|8,1|10,8|Enquête nationale sur la population et la santé (ENPS-II) 1992. Demographic and Health Surveys. Rabat, Royaume du Maroc, 1993 (and additional analysis).||3344,383 +MOROCCO|Africa|Northern Africa|Lower Middle Income|1996-97|3653|2,0|4,7|28,9|7,7|13,7|Enquête de santé materno-infantil sur la population Marocaine 1996-97. Pan Arab project for child development (PAPCHILD). Rabat, Maroc, 2000 (and additional analysis).||3283,03 +MOROCCO|Africa|Northern Africa|Lower Middle Income|2003-04|5602|5,0|10,8|23,1|9,8|13,3|Enquête dur la population et la santé familiale (EPSF) 2003-2004. Demographic and Health Surveys. Calverton, Maryland, USA: Ministère de la Santé et ORC Macro, 2005 (and additional analysis).||3037,949 +MOROCCO|Africa|Northern Africa|Lower Middle Income|2010-11|6873|1,0|2,3|14,9|2,9|10,8|Enquête nationale sur la population et la santé familiale (ENPSF) 2010-2011. Rapport préliminaire. Rabat, Royaume de Maroc: Ministère de la Santé, 2012 (and additional analysis).||3212,909 +MOZAMBIQUE|Africa|Eastern Africa|Low Income|1995|4586||9,6|59,9|23,9||Multiple indicator cluster survey Mozambique - 1995. MICS Surveys. Ministry of Planning and Finance. Maputo, Mozambique, 1996 (and additional analysis).|Converted estimates|2840,304 +MOZAMBIQUE|Africa|Eastern Africa|Low Income|1997|3621|4,3|9,8|48,7|26,3|5,9|Moçambique inquérito demográfico e de saude 1997. Demographic and Health Surveys. Instituto Nacional de Estatistica. Maputo, Moçambique, 1998 (and additional analysis).|Age-adjusted;|3051,434 +MOZAMBIQUE|Africa|Eastern Africa|Low Income|2000-01|1868604|3,6|8,1|50,7|24,5|8,8|Questionario de indicadores basicos de bem-estar (QUIBB): Relatorio final. Maputo, Moçambique: Instituto Nacional de Estadisticas, 2001 (and additional analysis).||3401,7090000000003 +MOZAMBIQUE|Africa|Eastern Africa|Low Income|2003|9052|2,1|5,4|46,9|21,2|6,3|Moçambique inquérito demográfico e de saúde 2003. Demographic and Health Surveys. Calverton, Maryland, USA: Instituto Nacional de Estatística, Ministério da Saúde and ORC Macro, 2005 (and additional analysis).||3613,88 +MOZAMBIQUE|Africa|Eastern Africa|Low Income|2008|10691|1,3|4,2|43,5|18,2|3,6|Mozambique multiple indicator cluster survey 2008 (MICS). Maputo, Mozambique: INE, 2009 (and additional analysis).||4145,28 +MOZAMBIQUE|Africa|Eastern Africa|Low Income|2011|10696|2,4|6,1|42,9|15,6|7,8|Moçambique inquérito demográfico e de Saúde 2011. Demographic and Health Surveys. Calverton, Maryland, USA: MISAU, INE e ICFI, 2013 (and additional analysis).||4443,616 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|1990|5899||||32,5||Ministry of Health. Nutrition Situation of Myanmar Children. Preliminary report of the national nutrition survey 1990. Rangoon, Myanmar, 1991 (and additional analysis).|Age-adjusted; converted estimates|5165,424 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|1991|5540||12,7|53,6|37,0||Nutrition situation of Myanmar children. Report of the National Nutrition Survey 1991. Ragoon, Myanmar, 1994 (and additional analysis).|Age-adjusted; converted estimates|5064,125 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|1994|5994||9,2|58,7|31,2||National nutrition survey, 1994. National Nutrition Centre. Yangon, Myanmar, 1995 (and additional analysis).|Age-adjusted; converted estimates|4912,187 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|1995|19908||||38,7||Monitoring progress toward the goals of the World Summit for Children through multiple indicator cluster survey (MICS). Yangon, Myanmar, 1995 (and additional analysis).|Converted estimate|4896,417 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|1997|4894||9,6|55,4|28,1|9,7|National nutrition survey 1997. National Nutrition Centre. Yangon, Myanmar, 2000 (and additional analysis).|Age-adjusted; converted estimates|4929,849 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|2000|8492|2,9|10,7|40,8|30,0|2,4|Union of Myanmar monitoring national programme of action goals though multiple indicator cluster survey 2000. Yangon, Myanmar, 2001 (and additional analysis).||5057,418 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|2003|8452|2,9|10,7|40,6|29,6|2,4|Multiple indicator cluster survey 2003 (MICS). Yangon, Myanmar, 2004 (and additional analysis).||5298,581 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|2009-10|15430|2,1|7,9|35,1|22,6|2,6|Myanmar multiple indicator cluster survey 2009 - 2010: Final Report (MICS3). Nay Pyi Taw, Myanmar: Ministry of National Planning and Economic Development and Ministry of Health, 2011.||5021,325 +MYANMAR|Asia|South-Eastern Asia|Lower Middle Income|2015-16|4204|1,3|6,6|29,4|18,5|1,5|Myanmar Demographic and Health Survey 2015-16: Final Report. 2016 (and additional analysis)||4537,81 +NAMIBIA|Africa|Southern Africa|Upper Middle Income|1992|2553|3,2|9,6|35,6|21,4|4,5|Namibia demographic and health survey 1992. Demographic and Health Surveys. Windhoek, Republic of Namibia, 1993 (and additional analysis).||249,93599999999998 +NAMIBIA|Africa|Southern Africa|Upper Middle Income|2000|4273|3,0|10,0|29,3|20,2|3,3|Namibia demographic and health survey 2000 (Demographic and Health Surveys). Windhoek, Namibia: MOHSS, 2003 (and additional analysis).||276,686 +NAMIBIA|Africa|Southern Africa|Upper Middle Income|2006-07|5151|2,0|7,6|29,2|17,4|4,7|Namibia demographic and health survey 2006-07. Demographic and Health Surveys. Windhoek, Namibia and Calverton, Maryland, USA: MoHSS and Macro International Inc., 2008 (and additional analysis).||281,507 +NAMIBIA|Africa|Southern Africa|Upper Middle Income|2013|2610|2,8|7,1|22,7|13,2|4,0|The Namibia demographic and health survey 2013. Demographic and Health Surveys. Windhoek, Namibia, and Rockville, Maryland, USA: MoHSS and ICF International, 2014 (and additional analysis).||317,961 +NAURU|Oceania|Micronesia|Upper Middle Income|2007|267|0,2|1,0|24,0|4,8|2,8|Nauru 2007 demographic and health survey. Demographic and Health Surveys. Auckland, New Zealand: NBS, SPC and Macro, 2009 ( http://www.spc.int/prism/country/nr/stats/Publication/DHS/dhs.htm, accessed 10/05/11).||1,0 +NEPAL|Asia|Southern Asia|Low Income|1995|6781||6,0|68,2|42,6||Nepal multiple indicator surveillance: cycle I, Jan to March 1995 health and nutrition - final report (MICS). Kathmandu, Nepal, 1996 (and additional analysis).|Age-adjusted; converted estimates|3350,507 +NEPAL|Asia|Southern Asia|Low Income|1996|3972|2,8|12,6|65,7|47,1|0,7|Nepal family health survey, 1996. Demographic and Health Surveys. Ministry of Health. Kathmandu, Nepal, 1997 (and additional analysis).|Age-adjusted;|3422,0429999999997 +NEPAL|Asia|Southern Asia|Low Income|1997-98|17471|1,4|7,9|61,1|38,2|0,4|Nepal micronutrient status survey 1998. Kathmandu, Nepal: Ministry of Health, Child Health Division, HMG/N, New ERA, Micronutrient Initiative, UNICEF Nepal and WHO, 2000 (and additional analysis).||3523,677 +NEPAL|Asia|Southern Asia|Low Income|2001|6356|2,8|11,3|57,1|42,8|0,7|Nepal demographic and health survey 2001. Demographic and Health Surveys. Calverton, Maryland, USA: Family Health Division, Ministry of Health; New ERA; and ORC Macro, 2002 (and additional analysis).||3585,4829999999997 +NEPAL|Asia|Southern Asia|Low Income|2006|5195|2,7|12,7|49,2|38,5|0,6|Nepal demographic and health survey 2006. Demographic and Health Surveys. Kathmandu, Nepal: Ministry of Health and Population, New ERA, and Macro International Inc., 2007 (and additional analysis).||3384,3559999999998 +NEPAL|Asia|Southern Asia|Low Income|2011|2521|2,9|11,2|40,5|29,1|1,5|Nepal demographic and health survey 2011. Demographic and Health Surveys. Kathmandu, Nepal: Ministry of Health and Population, New ERA, and ICF International, Calverton, Maryland 2012 (and additional analysis).||3101,5359999999996 +NEPAL|Asia|Southern Asia|Low Income|2014|5155|3,2|11,3|37,5|30,1|2,1|Nepal Multiple Indicator Cluster Survey 2014: Final Report (and additional analysis)||2857,447 +NEPAL|Asia|Southern Asia|Low Income|2016-17|2477|1,9|9,6|36,0|27,2|1,2|Nepal Demographic and Health Survey 2016. Kathmandu, Nepal: Ministry of Health, Nepal. 2017 (and additional analysis)||2756,281 +NICARAGUA|Latin America and the Caribbean|Central America|Lower Middle Income|1993|3609|0,9|2,5|29,5|9,6|5,5|Nicaragua 1993 living standards measurement survey (LSMS). Washington, D.C.: The World Bank, 1997 (and additional analysis).||691,541 +NICARAGUA|Latin America and the Caribbean|Central America|Lower Middle Income|1997-98|6837|1,5|3,4|30,5|10,3|6,9|Encuesta nicaragüense de demografia y salud 1998. Demographic and Health Surveys.Instituto Nacional de Estadisticas y Censos. Managua, Nicaragua, 1999 (and additional analysis).||676,9810000000001 +NICARAGUA|Latin America and the Caribbean|Central America|Lower Middle Income|2001|5741|0,9|2,3|25,1|7,7|7,2|Encuesta nicaragüense de demografia y salud 2001. Demographic and Health Surveys. Calverton, Maryland, USA: INEC, MINSA, and ORC Macro, 2002 (and additional analysis).||660,342 +NICARAGUA|Latin America and the Caribbean|Central America|Lower Middle Income|2003-05|1494|0,0|0,3|18,8|4,3|5,2|Sistema integrado de vigilancia de interventiones nutricionales (SIVIN): Informe de progreso, Nicaragua 2003-05. Managua, Nicaragua 2008 (and additional analysis).||641,307 +NICARAGUA|Latin America and the Caribbean|Central America|Lower Middle Income|2006-07|12318|0,5|1,5|23,1|5,7|6,2|Encuesta nicaragüense de demografía y salud ENDESA 2006/07, informe final. Managua, Nicaragua: INIDE y CDC, 2008 (and additional analysis).||632,424 +NICARAGUA|Latin America and the Caribbean|Central America|Lower Middle Income|2011-12|10311|0,7|2,2|17,3|4,6|8,3|Encuesta Nicaragüense de Demografía y Salud 2011/12 - Informe Final (and additional analysis)||625,669 +NIGER (THE)|Africa|Western Africa|Low Income|1985|1672||25,3|43,8|45,0||Enquête nationale sur la morbidité et la mortalité, rapport No 1. Cellule de Planification. Niamey, République de Niger, 1985 (and additional analysis).|Converted estimates|1430,494 +NIGER (THE)|Africa|Western Africa|Low Income|1992|4284|6,7|18,8|45,3|38,7|2,0|Enquête démographique et de santé, Niger 1992. Demographic and Health Surveys. Niamey, Niger, 1993 (and additional analysis).||1726,497 +NIGER (THE)|Africa|Western Africa|Low Income|1998|4204|6,5|19,8|50,7|46,9|1,1|Enquête démographique et de santé, Niger 1998. Demographic and Health Surveys. Calverton, Maryland, U.S.A.: Care International/Niger et Macro International Inc., 1998 (and additional analysis).|Age-adjusted;|2173,154 +NIGER (THE)|Africa|Western Africa|Low Income|2000|4831|6,1|16,2|53,5|43,1|1,7|Enquête à indicateurs multiples de la fin de la décennie (MICS2): draft. Niamey: République du Niger and UNICEF, 2001 (and additional analysis).||2342,97 +NIGER (THE)|Africa|Western Africa|Low Income|2006|4389|4,3|12,5|54,8|39,9|3,5|Enquête démographique et de santé et à indicateurs multiples du Niger 2006. Demographic and Health Surveys adn MICS-3. Calverton, Maryland, USA : INS et Macro International Inc., 2007 (and additional adnalysis).||2949,612 +NIGER (THE)|Africa|Western Africa|Low Income|2012|5822|6,7|18,2|43,5|38,0|3,1|Enquête démographique et de santé et indicateurs multiples du Niger 2012. Demographic and Health Surveys and MICS. Calverton, Maryland, USA: INS et ICF International, 2013 (and additional analysis).||3667,929 +NIGER (THE)|Africa|Western Africa|Low Income|2016|1698329|2,1|10,1|40,6|31,4|1,1|Evaluation Nationale De La Situation Nutritionnelle par La Methodologie SMART Au Niger, November 2016 (and additional analysis)||4217,879 +NIGERIA|Africa|Western Africa|Lower Middle Income|1990|5854|4,4|11,7|48,7|33,1|3,3|Nigerian demographic and health survey 1990. Demographic and Health Surveys. Federal Office of Statistics, Lagos, Nigeria, 1992 (and additional analysis).||16808,703999999998 +NIGERIA|Africa|Western Africa|Lower Middle Income|1993|2664||20,6|43,8|35,1|5,5|National micronutrient survey, 1993. Ibadan, Nigeria, 1996 (and additional analysis).|Converted estimates|17839,139 +NIGERIA|Africa|Western Africa|Lower Middle Income|2003|5219|4,8|11,2|42,5|26,7|6,2|Nigeria demographic and health survey 2003. Demographic and Health Surveys. Calverton, Maryland: National Population Commission and ORC Macro, 2004 (and additional analysis).||23033,519 +NIGERIA|Africa|Western Africa|Lower Middle Income|2007|13323|6,7|13,4|39,2|23,3|13,3|Nigeria multiple indicator cluster survey 2007: Final report (MICS). Abuja, Nigeria: NBS, 2007 (and additional analysis).| High exclusion rate|25765,534 +NIGERIA|Africa|Western Africa|Lower Middle Income|2008|23792|7,7|14,5|40,6|26,7|10,4|Nigeria demographic and health survey 2008. Demographic and Health Surveys. Abuja, Nigeria: National Population Commission and ICF Macro, 2009 (and additional analysis).||26394,363999999998 +NIGERIA|Africa|Western Africa|Lower Middle Income|2011|24173|4,6|11,6|35,8|25,4|2,9|Nigeria multiple indicator cluster survey 2011 (MICS): Monitoring the situation of children and women. Abuja, Nigeria, 2011 (and additional analysis).||28404,179 +NIGERIA|Africa|Western Africa|Lower Middle Income|2013|28947|9,0|18,1|36,5|31,0|5,0|Nigeria demographic and health survey 2013. Demographic and Health Surveys. Abuja, Nigeria, and Rockville, Maryland, USA: NPC and ICF International, 2014 (and additional analysis).||29791,267000000003 +NIGERIA|Africa|Western Africa|Lower Middle Income|2014|19945|2,0|7,9|32,9|19,8|1,8|Summary findings of national nutrition and health survey, 9th feb to 5th May 2014, Nigeria: SMART methods (and additional analysis).||30461,065 +NIGERIA|Africa|Western Africa|Lower Middle Income|2015||1,8|7,2|32,9|19,4|1,6|National Nutrition and Health Surveys (NNHS) - Report on The Nutrition and Health Situation of Nigeria, November 2015|(pending reanalysis)|31109,161 +NIGERIA|Africa|Western Africa|Lower Middle Income|2016-17|27398|2,9|10,8|43,6|31,5|1,5|Multiple Indicator Cluster Survey 2016-17, Final Report. Abuja, Nigeria: National Bureau of Statistics and United Nations Children’s Fund. 2017 (and additional analysis)||31801,515 +NORTH MACEDONIA|Europe|Southern Europe|Upper Middle Income|1999|1117|0,4|1,7|8,0|1,9|9,6|Multiple indicator cluster survey in FYR Macedonia with micronutrient component (MICS). National Institute of Nutrition, Rome, Italy, 2000 (and additional analysis).||140,378 +NORTH MACEDONIA|Europe|Southern Europe|Upper Middle Income|2005|4223|1,7|3,4|11,3|1,8|16,2|Republic of Macedonia - multiple indicator cluster survey 2005-06. Final report. Skopje: State Statistcial Office of the Republic of Macedonia, 2007 (and additional analysis).||124,035 +NORTH MACEDONIA|Europe|Southern Europe|Upper Middle Income|2011|1332|0,2|1,8|4,9|1,3|12,4|Multiple indicator cluster survey 2011 (MICS). Skopje, the former Yugoslav Republic of Macedonia: Ministry of Health, Ministry of Education and Science, Ministry of Labour and Social Policy, 2012 (and additional analysis)||110,93700000000001 +OMAN|Asia|Western Asia|High Income|1991|764||7,8|24,2|18,6|8,4|Ministry of Health. National Nutrition Survey of the Sultanate of Oman. UNICEF Muscat, Oman, 1993 (and additional analysis).|Age-adjusted; converted estimates|323,08 +OMAN|Asia|Western Asia|High Income|1994-95|639|0,8|7,2|21,1|10,4|1,0|National study on the prevalence of vitamin A deficiency (VAD) among children 6 months to 7 years. Muscat, Sultanate of Oman, 1995 (and additional analysis).|Age-adjusted;|316,531 +OMAN|Asia|Western Asia|High Income|1999|14076|1,1|7,3|12,9|11,3|1,6|Implications of the use of the new WHO growth charts on the interpretation of malnutrition and obesity in infants and young children in Oman. Eastern Mediterranean Health Journal 2009;15:890-8 (and additional analysis).||288,705 +OMAN|Asia|Western Asia|High Income|2009|8105|0,8|7,1|9,8|8,6|1,7|Second national PEM survey 2009. Ministry of Health. Muscat, Oman, 2011.||275,056 +OMAN|Asia|Western Asia|High Income|2014||2,4|7,5|14,1|9,7|4,4|Multiple Indicator Cluster Survey 2014, Key Findings. Muscat, Oman, 2016. ||369,95300000000003 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|1985-87|6707||24,0|62,5|44,4|7,8|National nutrition survey 1985-87 report. National Institute of Health, Nutrition Division. Islamabad, Pakistan, 1988 (and additional analysis).|Converted estimates|16239,89 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|1990-91|4588|4,8|12,5|54,5|39,0|5,4|Pakistan demographic and health survey 1990/91. Demographic and Health Surveys. National Institute of Population Studies. Islamabad, Pakistan, 1992 (and additional analysis).||18961,337 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|1990-94|3240|5,0|17,2|42,7|35,3|1,6|National health survey of Pakistan (NHSP, 1990-94): Health profile of the people of Pakistan. Islamabad, Pakistan, 1998 (and additional analysis).||19244,166 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|1995|7368||||34,2||Multiple indicator cluster survey of Pakistan, 1995. MICS surveys. Government of Pakistan. Islamabad, Pakistan, 1996 (and additional analysis).|Converted estimate|19550,139 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|2001|10027|5,9|14,2|41,5|31,3|4,8|National nutrition survey 2001-2002. Islamabad, Pakistan: Planning Commission, Government of Pakistan and UNICEF, 2004 (and additional analysis).||20265,38 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|2011|29525|5,7|14,8|43,0|30,9|6,4|National nutrition survey Pakistan, 2011. Islamabad, Pakistan: Aga Khan University, PMRC, Government of Pakistan and UNICEF, 2012 (and additional analysis).||23272,257999999998 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|2012-13|3838|3,3|10,5|45,0|31,8|4,8|Pakistan demographic and health survey 2012-13. Demographic and Health Surveys. Islamabad, Pakistan, and Calverton, Maryland, USA: NIPS and ICF International, 2013 (and additional analysis).||24171,491 +PAKISTAN|Asia|Southern Asia|Lower Middle Income|2017-18|3622|2,4|7,1|37,6|23,1|2,5|Pakistan Demographic and Health Survey 2017-18. Islamabad, Pakistan, and Rockville, Maryland, USA: NIPS and ICF (and additional analysis)||25224,011000000002 +PANAMA|Latin America and the Caribbean|Central America|High Income|1997|2289|0,4|1,4|21,5|6,3|6,2|Encuesta de niveles de vida. 1997 Panama living standards survey (LSMS). Ciudad de Panama, Republica de Panama, 1998 (and additional analysis).||327,721 +PANAMA|Latin America and the Caribbean|Central America|High Income|2003|313165|0,4|1,6|23,7|5,3|11,1|Situacion nutricional, patron de consumo y acceso a alimentos de la poblacion panameña: Segunda encuesta de niveles de vida - 2003. Panama City, Republica de Panama, 2006 (and additional analysis)||350,213 +PANAMA|Latin America and the Caribbean|Central America|High Income|2008|288853|0,3|1,2|19,0|3,9|9,7|Estado nutricional de niños menores de cinco años: Encuesta de niveles de vida, 2008. Panama City, Republica de Panama, 2009 (and additional analysis)||360,62699999999995 +PAPUA NEW GUINEA|Oceania|Melanesia|Lower Middle Income|1982-83|27510|1,2|5,5|46,0|22,8|3,1|Summary results by environmental zone from the 1982/83 National Nutrition Survey of Papua New Guinea. Papua New Guinea Institute of Medical Research. Goroka, Papua New Guinea, 1992 (and additional analysis).| Adjusted NR to NA; 85% of total population|601,519 +PAPUA NEW GUINEA|Oceania|Melanesia|Lower Middle Income|2005|924|0,8|4,4|43,9|18,1|3,4|Papua New Guinea national micronutrient survey 2005: Final report. Port Moresby, Papua New Guinea, 2009 (and additional analysis).||920,7869999999999 +PAPUA NEW GUINEA|Oceania|Melanesia|Lower Middle Income|2009-11|945911|6,4|14,1|49,5|27,8|13,7|2009-2010 Papua New Guinea household income and expenditure survey: Summary tables. Port Moresby: National Statistical Office, 2013 (and additional analysis).||983,166 +PARAGUAY|Latin America and the Caribbean|South America|Upper Middle Income|1990|3450|0,2|0,6|18,3|2,8|6,3|Encuesta nacional de demografia y salud 1990. Demographic and Health Surveys. Asuncion, Paraguay, 1991 (and additional analysis).||653,506 +PARAGUAY|Latin America and the Caribbean|South America|Upper Middle Income|2005|483612||1,1|17,5|3,4|7,1|Informe final de consultoria: Analisis de la situacion de salud infantil y antropometria en menores de 5 años. Paraguay EPH 2005. Asuncion, Paraguay: PNUD Paraguay, 2006.||669,0369999999999 +PARAGUAY|Latin America and the Caribbean|South America|Upper Middle Income|2011-12|558648|0,4|2,6|10,7|2,6|11,3|Análisis de la situación nutricional de los niños menores de cinco años en Paraguay a partir de la encuesta de ingresos y gastos y de condiciones de vida 2011-2012. Asunción, Paraguay, 2014 (and additional analysis).||683,938 +PARAGUAY|Latin America and the Caribbean|South America|Upper Middle Income|2016|4428|0,4|1,0|5,6|1,3|12,4|Encuesta de Indicadores Multiples por Conglomerados MICS Paraguay 2016 (and additional analysis)||671,653 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|1991-92|7205|0,6|1,9|37,3|8,8|9,3|Encuesta demografica y de salud familiar 1991/1992. Demographic and Health Surveys. Lima, Peru, 1992 (and additional analysis).||3060,35 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|1996|13829|0,7|1,6|31,6|5,7|9,9|Peru demographic and health survey 1996. Demographic and Health Surveys. Instituto Nacional de Estadistica e Informacion. Lima, Peru, 1997 (and additional analysis).||3063,74 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2000|10710|0,4|1,1|31,3|5,2|11,8|Encuesta demografica y de salud familiar 2000. Demographic and Health Surveys. Lima, Peru and Calverton, Maryland, USA: Instituto Nacional de Estadistica e Informacion y ORC Macro, 2001 (and additional analysis).||3009,387 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2005|1912|0,1|1,0|29,2|5,4|9,1|Peru, encuesta demografica y de salud familiar. Informe principal: ENDES continua 2004-2006. Demographic and Health Surveys. Lima, Peru: INEI, USAID and ORC Macro, 2007 (and additional analysis).||2960,998 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2007-08|7911|0,2|0,8|28,0|4,3|10,0|Encuesta demografica y de salud familiar. Informe principal: ENDES continua 2007-2008. Demographic and Health Surveys. Lima, Peru: INEI, USAID y ORC Macro, 2009 (and additional analysis).||2952,039 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2009|9180|0,2|0,6|23,9|4,3|10,3|Encuesta demografica y de salud familiar - ENDES continua 2009. Demographic and Health Surveys. Lima, Peru: INEI, USAID y ORC Macro, 2010 (and additional analysis).||2946,0759999999996 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2010|8726|0,1|0,7|23,3|4,3|8,0|Encuesta demografica y de salud familiar - ENDES continua 2010. Demographic and Health Surveys. Lima, Peru: INEI, USAID y ORC Macro, 2011 (and additional analysis).||2950,506 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2011|8869|0,1|0,4|19,5|4,2|8,8|Encuesta demografica y de salud familiar - ENDES continua 2011. Demographic and Health Surveys. Lima, Peru: INEI, USAID y ORC Macro, 2012 (and additional analysis).||2957,4570000000003 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2012|9190|0,1|0,6|18,4|3,4|7,2|Encuesta demografica y de salud familiar - ENDES continua 2012. Demographic and Health Surveys. Lima, Peru: INEI, USAID y ORC Macro, 2013 (and additional analysis).||2972,6479999999997 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2013|8316|0,2|0,4|17,7|3,6|8,4|Encuesta demografica y de salud familiar – ENDES continua 2013 Nacional y Departmental. Demographic and Health Surveys. Lima, Peru: INEI, 2013 (and additional analysis)||2993,0229999999997 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2014|9164|0,1|0,6|14,8|3,2|8,8|Encuesta demografica y de salud familiar - ENDES continua 2014. Demographic and Health Surveys. Lima, Peru: INEI,2015 (and additional analysis)||3010,6620000000003 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2015|11141|0,1|0,6|14,7|3,4|8,2|Encuesta Demográfica y de Salud Familiar-ENDES 2015 Nacional y Departamental (and additional analysis)||3020,032 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2016|10586|0,1|0,6|13,1|3,2|7,7|Perú Encuesta Demografica y de salud Familiar 2016: nacional y regional, 2017 (and additional analysis)||3032,5820000000003 +PERU|Latin America and the Caribbean|South America|Upper Middle Income|2017|9362|0,1|0,5|12,9|3,2|8,0|Encuesta Demográfica y de Salud Familiar-ENDES 2017 Nacional y Departamental (and additional analysis)||3026,862 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|1987|2250||5,7|44,7|29,3||Third National Nutrition Survey Philippines, 1987. Food and Nutrition Research Institute. Manila, Philippines; 1991 (and additional analysis).|Converted estimates|8882,434000000001 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|1989-90|5629||6,9|43,3|29,9||Regional Updating of Nutritional Status of Filipino Children, 1989-90. Food and Nutrition Research Institute. Manila, Philippines; 1991 (and additional analysis).|Converted estimates|9450,035 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|1992|5858||8,8|40,9|29,8|1,7|The 1992 regional nutrition survey. Food and Nutrition Research Institute. Manila, Philippines; 1994 (and additional analysis).|Converted estimates|9770,793 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|1993|4229||9,1|38,9|26,3||The fourth national nutrition survey: Philippines 1993. Food and Nutrition Institute. Manila, Philippines; 1995 (and additional analysis).|Converted estimates|9868,664 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|1998|24308||8,0|38,3|28,3|1,9|The 5th national nutrition survey. Philippine nutrition: Facts & figures. Taguig, Metro Manila, Philipines: UNICEF, 2001 (and additional analysis).|Converted estimates|10441,046999999999 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|2003|3499|1,6|6,0|33,8|20,7|2,4|Sixth National Nutrition Survey: Philippines, 2003. Food and Nutrition Research Institute, 2004.||11250,61 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|2008|18403|2,0|6,9|32,3|20,7|3,3|7th national nutrition survey. Manila, Philippines: FNRI-DOST, 2010 (and additional analysis).||11155,915 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|2011|17309|2,4|7,3|33,6|20,2|4,3|Philippine Nutrition Facts and Figures 2011. DOST Complex, FNRI Bldg., Bicutan, Taguig City, Metro, Manila, Philippines, 2012 (and additional analysis).||11076,073999999999 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|2013-14|||7,9|30,3|19,9|5,0|8th National nutrition survey Philippines 2013.|(pending reanalysis)|11240,688 +PHILIPPINES (THE)|Asia|South-Eastern Asia|Lower Middle Income|2015|||7,1|33,4|21,5|3,9|Philippines 2015 National Nutrition Survey - Updating Survey Results||11434,444 +POLAND|Europe|Eastern Europe|High Income|2009||||2,9|||Poland European Health Interview Survey 2009||1972,211 +POLAND|Europe|Eastern Europe|High Income|2014||||2,6|||Poland European Health Interview Survey 2014||1950,715 +QATAR|Asia|Western Asia|High Income|1995|1180||2,1|11,6|4,8|10,4|Nutritional assessment in Qatar. Assignment report EM/NUT169/E/R/01.96/27. Alexandria: World Health Organization Regional Office, 1996 (and additional analysis).|Converted estimates|49,998000000000005 +REPUBLIC OF KOREA (THE)|Asia|Eastern Asia|High Income|2003|2040|0,2|0,9|2,5|0,9|6,2|Recent growth of children in the two Koreas: a meta-analysis. Economics and Human Biology 2009;7:109-12.||2685,532 +REPUBLIC OF KOREA (THE)|Asia|Eastern Asia|High Income|2008-11|1783845|0,1|1,2|2,5|0,7|7,3|Data Resource Profile: The Korea National Health and Nutrition Examination Survey (KNHANES). International Journal of Epidemiology 2014;43:69-77 (and additional analysis).| Age-adjusted;|2288,7729999999997 +REPUBLIC OF MOLDOVA (THE)|Europe|Eastern Europe|Lower Middle Income|2005|1581|2,4|5,9|10,7|3,2|8,8|Moldova demographic and health survey 2005. Demographic and Health Surveys. Calverton, Maryland: NCPM of the Ministry of Health and Social Protection and ORC Macro, 2006 (and additional analysis).||205,40099999999998 +REPUBLIC OF MOLDOVA (THE)|Europe|Eastern Europe|Lower Middle Income|2012|1724|0,5|1,9|6,4|2,2|4,9|2012 Republic of Moldova multiple indicator cluster survey. Final report (MICS4). Chisinau, Republic of Moldova, 2014 (and additional analysis)||225,609 +ROMANIA|Europe|Eastern Europe|Upper Middle Income|1991|10957||3,3|11,2|5,0|4,0|Report of Romania national nutrition survey, 1991. Part I: child nutrition section. Atlanta: Division of Nutrition, Centers for Disease Control, 1993 (and additional analysis).|Converted estimates|1792,329 +ROMANIA|Europe|Eastern Europe|Upper Middle Income|1999|21103|0,8|3,6|15,3|3,4|10,1|National nutritional surveillance programme, 1993-2002. Bukarest, Romania, 2003 (and additional analysis).|National surveillance system|1113,677 +ROMANIA|Europe|Eastern Europe|Upper Middle Income|2000|22225|1,1|4,3|12,8|3,7|8,9|National nutritional surveillance programme, 1993-2002. Bukarest, Romania, 2003 (and additional analysis).||1120,087 +ROMANIA|Europe|Eastern Europe|Upper Middle Income|2001|22667|1,0|3,9|14,0|3,8|9,1|National nutritional surveillance programme, 1993-2002. Bukarest, Romania, 2003 (and additional analysis).||1167,846 +ROMANIA|Europe|Eastern Europe|Upper Middle Income|2002|15533|0,7|3,5|12,8|3,5|8,3|National nutritional surveillance programme, 1993-2002. Bukarest, Romania, 2003 (and additional analysis).||1165,17 +RWANDA|Africa|Eastern Africa|Low Income|1992|4498|1,8|5,0|56,8|24,2|4,0|Enquête démographique et de santé, Rwanda 1992. Demographic and Health Surveys. Kigali, Rwanda, 1994 (and additional analysis).||1161,152 +RWANDA|Africa|Eastern Africa|Low Income|1996|1115||11,0|45,4|22,6||National nutrition survey of women and children in Rwanda in 1996. Kigali, République Rwandaise, 1997 (and additional analysis).|Adjusted NR to NA; converted estimates|757,452 +RWANDA|Africa|Eastern Africa|Low Income|2000|6793|3,8|8,7|47,9|20,3|7,1|Enquête démographique et de santé, Rwanda 2000. Demographic and Health Surveys. Kigali, Rwanda et Calverton, Maryland, USA: Ministère de la Santé, Office National de la Population et ORC Macro, 2001 (and additional analysis).||1312,971 +RWANDA|Africa|Eastern Africa|Low Income|2005|3999|1,7|4,9|51,4|17,9|6,7|Rwanda demographic and health survey 2005. Demographic and Health Surveys. Calverton, Maryland, U.S.A.: INSR and ORC Macro, 2006 (and additional analysis).||1454,3029999999999 +RWANDA|Africa|Eastern Africa|Low Income|2010-11|4408|0,9|2,9|44,3|11,7|6,9|Rwanda demographic and health survey 2010. Demographic and Health Surveys. Calverton, Maryland, USA: NISR, MOH, and ICF International, 2012 (and additional analysis).||1641,692 +RWANDA|Africa|Eastern Africa|Low Income|2015|4051|0,4|2,0|36,9|8,9|5,6|Rwanda 2015 Comprehensive Food Security and Vulnerabilty Analysis (and additional analysis)||1734,543 +RWANDA|Africa|Eastern Africa|Low Income|2014-15|3881|0,7|2,3|38,2|9,6|7,9|Rwanda Demographic and Health Survey 2014-15. Kigali, Rwanda: National Institute of Statistics of Rwanda, Ministry of Finance and Economic Planning/Rwanda, Ministry of Health/Rwanda, and ICF International (and additional analysis)||1734,543 +SAINT LUCIA|Latin America and the Caribbean|Caribbean|Upper Middle Income|2012|283|0,7|3,7|2,5|2,8|6,3|Saint Lucia multiple indicator cluster survey 2012: Final report. MICS. Castries, Saint Lucia, 2014 (and additional analysis)||10,895 +SAMOA|Oceania|Polynesia|Upper Middle Income|1999|1107||1,3|6,4|1,7|6,2|Samoa national nutrition survey 1999. Part 3: Child growth, diet, contact with the health system and interview with carers. Technical report. Apia, Samoa: Nutrition Centre, 2003 (and additional analysis).|Converted estimates|25,639 +SAMOA|Oceania|Polynesia|Upper Middle Income|2014|2961|1,3|3,9|4,9|3,2|5,3|Samoa Demographic and Health Survey 2014 (and additional analysis)||24,718000000000004 +SAO TOME AND PRINCIPE|Africa|Middle Africa|Lower Middle Income|1986|2155||6,0|32,0|14,5||Estado nutricional e cobertura vacinal des criancas menoras de 5 anos na. Seccao de Nutricao. Sao Tome, Republica Democratica de Sao Tome e Principe, 1986 (and additional analysis).|Converted estimates|17,67 +SAO TOME AND PRINCIPE|Africa|Middle Africa|Lower Middle Income|2000|1737|1,2|3,9|35,5|10,2|9,2|Enquête de grappes à indicateurs multiples MICS - rapport d'analyse (projet, 14 juillet 2000). Sao Tome, République Démocratique de Sao Tome et Principe, 2000. (and additional analysis).||23,151 +SAO TOME AND PRINCIPE|Africa|Middle Africa|Lower Middle Income|2006|2848||9,6|28,9|8,0|15,4|Democratic Republic of Sao Tome e Principe 2006 multiple indicator cluster survey (MICS3): Final report. Sao Tome: INE and UNICEF, 2007.|Converted estimates|27,579 +SAO TOME AND PRINCIPE|Africa|Middle Africa|Lower Middle Income|2008-09|1751|5,1|11,6|30,6|14,8|11,2|Enquête démographique et de santé à Sao Tomé e Príncipe (EDS-STP) 2008-2009. Rapport préliminaire. Sao Tomé: INE et le Ministre de la Santé, 2009 ( and additional analysis).||28,419 +SAO TOME AND PRINCIPE|Africa|Middle Africa|Lower Middle Income|2014|1939|0,8|4,0|17,2|8,8|2,4|Sao Tome and Principe Multiple Indicator Cluster Survey 2014, Final Report. São Tomé, Sao Tome and Principe, 2016 (and additional analysis)||30,58 +SAUDI ARABIA|Asia|Western Asia|High Income|1994|23821||2,9|21,4|13,5|1,2|Comparison of the growth standards between Saudi and American children aged 0-5 years. Saudi Medical Journal 2003;24:598-602 [Erratum Saudi Medical Journal 2003;24:1032] (and additional analysis).|Converted estimates|2761,921 +SAUDI ARABIA|Asia|Western Asia|High Income|2004-05|15601|4,5|11,8|9,3|5,3|6,1|Growth charts for Saudi children and adolescents. Saudi Medical Journal 2007;28:1555-68 (and additional analysis).||2745,367 +SENEGAL|Africa|Western Africa|Low Income|1986|630|1,2|5,1|26,5|17,0|2,3|Enquête démographique et de santé au Sénégal, 1986. Demographic and Health Surveys. Dakar, Republique du Sénégal, 1987 (and additional analysis).|Age-adjusted;|1285,753 +SENEGAL|Africa|Western Africa|Low Income|1991-92|||9,0|34,4|20,4|4,0|Social Dimensions of Adjustment Household Priority Survey 1991-92. New York: The World Bank, 1993 (and additional analysis).|Age-adjusted; converted estimates|1444,067 +SENEGAL|Africa|Western Africa|Low Income|1992-93|4047|3,0|9,4|29,7|19,0|4,0|Enquête démographique et de santé au Sénégal (EDS-II) 1992/93. Demographic and Health Surveys. Dakar, Sénégal, 1994 (and additional analysis).||1476,981 +SENEGAL|Africa|Western Africa|Low Income|1996|||8,2|28,8|19,6||Evaluation des objectives intermédiares (MICS). Dakar: UNICEF, September 1996 (and additional analysis).|Converted estimates|1573,0729999999999 +SENEGAL|Africa|Western Africa|Low Income|2000|1098683|2,9|10,0|26,0|17,8|3,2|Rapport de l'enquête sur les objectives de la fin de decennie sur l'enfance (MICS-II-2000). Dakar, Senegal, Novembre 2000 (and additional analysis).||1672,115 +SENEGAL|Africa|Western Africa|Low Income|2005|3010|2,3|8,7|19,9|14,5|2,5|Enquête démographique et de santé au Sénégal 2005. Demographic and Health Surveys. Calverton, Maryland, USA : Centre de Recherche pour le Développement Humain [Sénégal] et ORC Macro, 2006 (and additional analysis).||1870,068 +SENEGAL|Africa|Western Africa|Low Income|2010-11|3925|2,3|9,8|26,6|18,4|2,7|Enquête démographique et de santé à indicateurs multiples au Sénégal (EDS-MICS) 2010-2011. Demographic and Health Surveys and MICS. Calverton, Maryland, USA: ANSD et ICF International, 2012 (and additional analysis).||2248,346 +SENEGAL|Africa|Western Africa|Low Income|2012|27528|1,2|8,7|15,5|14,4|0,7|Rapport final SMART 2012. Dakar, Senegal: CLM, 2013 (and additional analysis).||2316,8579999999997 +SENEGAL|Africa|Western Africa|Low Income|2012-13|5961|1,9|9,0|18,7|16,7|1,4|Enquête démographique et de santé continue (EDS-Continue 2012-2013). Demographic and Health Surveys. Calverton, Maryland, USA: ANSD et ICF International., 2013 (and additional analysis).||2380,743 +SENEGAL|Africa|Western Africa|Low Income|2014|5978|0,8|5,9|18,7|12,8|1,3|Sénégal : Enquête Démographique et de Santé Continue (EDS-Continue 2014). Rockville, Maryland, USA : ANSD et ICF International, 2015 (and additional analysis)||2439,437 +SENEGAL|Africa|Western Africa|Low Income|2015|6097|1,5|7,8|20,7|16,1|1,0|Sénégal : Enquête Démographique et de Santé Continue (EDS-Continue 2015). Octobre 2016 (and additional analysis)||2492,79 +SENEGAL|Africa|Western Africa|Low Income|2016|5750|1,2|7,1|17,1|13,8|0,9|Sénégal : Enquête Démographique et de Santé Continue (EDS-Continue) 2016. August 2017 (and additional analysis)||2544,313 +SENEGAL|Africa|Western Africa|Low Income|2017|10911|1,5|9,0|16,5|14,4|0,9|Enquête Démographique et de Santé Continue du Sénégal, Cinquième Phase 2017 : Rapport de synthèse. Rockville, Maryland, USA : ANSD et ICF (and additional analysis)||2583,824 +SERBIA|Europe|Southern Europe|Upper Middle Income|2005-06|3525|1,8|4,5|8,1|1,8|19,3|Republic of Serbia multiple indicator cluster survey 2005, final report. Belgrade, Republic of Serbia: Statistical Office of the Republic of Serbia and Strategic Marketing Research Agency, 2006 (and additional analysis).||533,2130000000001 +SERBIA|Europe|Southern Europe|Upper Middle Income|2010|3004|0,8|3,5|6,6|1,6|15,6|Serbia multiple indicator cluster survey 2010 (MICS). Belgrade, Republic of Serbia: Statistical Office of the Republic of Serbia, 2011 (and additional analysis).||488,31699999999995 +SERBIA|Europe|Southern Europe|Upper Middle Income|2014|2353|1,1|3,9|6,0|1,8|13,9|2014 Serbia multiple indicator cluster survey and 2014 Serbia Roma Settlements multiple indicator cluster survey (MICS). Final Report. Belgrade, Serbia: Statistical Office of the Republic of Serbia and UNICEF, 2014 (and additional analysis)||469,62699999999995 +SEYCHELLES|Africa|Eastern Africa|High Income|1987-88|836||2,7|7,7|5,0|5,8|Nutritional status of Seychellois children (unpublished data). Victoria, Seychelles, 1989 (and additional analysis).|Converted estimates|8,401 +SEYCHELLES|Africa|Eastern Africa|High Income|2012|5283|1,2|4,3|7,9|3,6|10,2|The nutritional status and associated risk factors of 0-5 year old children in Seychelles. 7706 Med Health Project (thesis). Queensland, Australia: Griffith University, 2014.|Health centres (80% coverage)|7,697 +SIERRA LEONE|Africa|Western Africa|Low Income|1989|4424||8,4|41,4|23,7||Ministry of Health. The Republic of Sierra Leone National Nutrition Survey. Freetown, Sierra Leone; 1990.|Converted estimates; rain|769,566 +SIERRA LEONE|Africa|Western Africa|Low Income|1990|4595||10,2|40,9|25,4||Ministry of Health. The Republic of Sierra Leone National Nutrition Survey. Freetown, Sierra Leone; 1990.|Converted estimates; dry|772,2410000000001 +SIERRA LEONE|Africa|Western Africa|Low Income|2000|1977|3,9|11,6|35,5|23,4|4,8|The status of women and children in Sierra Leone. A household survey report (MICS-2). Central Statistics Office, Ministry of Development and Economic Planning, November 2000 (and additional anaysis).||810,096 +SIERRA LEONE|Africa|Western Africa|Low Income|2005|4428|4,2|10,2|45,0|27,2|5,9|Sierra Leone multiple indicator cluster survey 2005: Final Report. Freetown, Sierra Leone: Statistics Sierra Leone and UNICEF-Sierra Leone, 2007 (and additional analysis).||991,441 +SIERRA LEONE|Africa|Western Africa|Low Income|2008|3052|4,6|10,5|37,2|21,5|10,1|Sierra Leone demographic and health survey 2008. Demographic and Health Surveys. Calverton, Maryland, USA: Statistics Sierra Leone (SSL) and ICF Macro, 2009 (and additional analysis).||1066,714 +SIERRA LEONE|Africa|Western Africa|Low Income|2010|8104|4,8|10,0|44,4|22,9|9,4|Sierra Leone multiple indicator cluster survey 2010, Final report (MICS). Freetown, Sierra Leone: Statistics Sierra Leone and UNICEF-Sierra Leone, 2011 (and additional analysis).||1091,253 +SIERRA LEONE|Africa|Western Africa|Low Income|2013|5776|4,4|9,5|37,8|18,2|8,8|Sierra Leone demographic and health survey 2013. Demographic and Health Surveys. Freetown, Sierra Leone and Rockville, Maryland, USA: SSL and ICF International, 2014 (and additional analysis).||1123,225 +SINGAPORE|Asia|South-Eastern Asia|High Income|2000|16220|0,5|3,6|4,4|3,3|2,6|National healthcare group polyclinics' anthropometric growth charts for Singapore preschool children 2000. Singapore Health Booklet, revised edition April 2003 (and additional analysis).||255,543 +SOLOMON ISLANDS|Oceania|Melanesia|Lower Middle Income|1989|3980|2,0|7,4|33,7|16,3|1,9|Solomon Islands national nutrition survey 1989. Honiara, Solomon Islands, 1990 (and additional analysis).||52,056000000000004 +SOLOMON ISLANDS|Oceania|Melanesia|Lower Middle Income|2006-07|2029|1,4|4,3|32,8|11,5|2,5|Solomon Islands 2006-2007 demographic and health survey. DHS. Noumea, New Caledonia: SISO, SPC and Macro International Inc., 2007 (accessed 22/12/09 http://www.spc.int/prism/Country/SB/Stats/Publication/DHS07/report/SI-DHS-REPORT_TOC_Summary.pdf)||75,94800000000001 +SOLOMON ISLANDS|Oceania|Melanesia|Lower Middle Income|2015|3767|3,6|8,5|31,6|16,2|4,5|Solomon Islands Ministry of Health and Medical Services and the Pacific Community. 2017. Solomon Islands Demographic and Health Survey, 2015 (and additional analysis)||82,681 +SOMALIA|Africa|Eastern Africa|Low Income|2000|3582||19,3|29,2|22,8||Somalia end-decade multiple indicator cluster survey. Full technical report. Nairobi: UNICEF Somilia, 2001 (and additional analysis).|Converted estimates|1804,7820000000002 +SOMALIA|Africa|Eastern Africa|Low Income|2006|5696|4,4|13,3|42,0|32,8|4,7|Monitoring the situation of women and children. Somalia multiple indicator cluster survey 2006. New York: UNICEF, 2007 (and additional analysis).||2042,3570000000002 +SOMALIA|Africa|Eastern Africa|Low Income|2009|1137|5,2|15,0|25,3|23,0|3,0|National Micronutrient and Anthropometric Survey Somalia 2009 (and additional analysis).||2221,771 +SOUTH AFRICA|Africa|Southern Africa|Upper Middle Income|1993-94|4089|4,2|9,1|29,7|14,9|13,6|South Africans rich and poor: baseline household statistics. Project for statistics on living standards and development. Cape Town, 1994 (and additional analysis).||5147,3 +SOUTH AFRICA|Africa|Southern Africa|Upper Middle Income|1994-95|9807||3,3|28,7|8,0|10,3|Children aged 6 to 71 months in South Africa, 1994: their anthropometric, vitamin A, iron and immunisation coverage status. Johannesburg, South Africa, 1995 (and additional analysis).|Converted estimates|5131,4529999999995 +SOUTH AFRICA|Africa|Southern Africa|Upper Middle Income|1999|1556||4,5|30,1|9,8|10,4|The National Food Consumption Survey (NFCS): South Africa, 1999. Public Health Nutrition 2005;8:533-43 (and additional analysis).|Age-adjusted; converted estimates|5151,241 +SOUTH AFRICA|Africa|Southern Africa|Upper Middle Income|2003-04|4652|4,3|7,8|35,7|12,1|16,7|South Africa demographic and health survey 2003 (SADHS). Demographic and Health Surveys. Pretoria: Department of Health, 2007 (and additional analysis).||5241,529 +SOUTH AFRICA|Africa|Southern Africa|Upper Middle Income|2008|3151438|2,4|4,8|24,9|8,8|13,3|National income dynamics study (NIDS). Health: Analysis of the NIDS wave 1 dataset. Discussion paper no. 2. South Africa: The Presidency Republic of South Africa and SALDRU, 2009. (and additional analysis)|Age 0-5 months not covered; unadjusted|5333,303000000001 +SOUTH AFRICA|Africa|Southern Africa|Upper Middle Income|2012|4892568|3,1|5,6|27,2|8,5|17,2|South Africa 2012 National Income Dynamics Study Wave 3 (and additional analysis)|Age 0-5 months not covered; unadjusted|5513,938 +SOUTH AFRICA|Africa|Southern Africa|Upper Middle Income|2016|1416|0,6|2,5|27,4|5,9|13,3|South Africa Demographic and Health Survey 2016. Pretoria, South Africa, and Rockville, Maryland, USA: NDoH, Stats SA, SAMRC, and ICF (and additional analysis)||5704,84 +SOUTH SUDAN|Africa|Eastern Africa|Low Income|2006|1329786|12,9|24,6|36,2|32,5|10,9|Sudan household health survey (SHHS) - 2006. Khartoum and Juba: Government of National Unity, Government of Southern Sudan, December 2007 (additional analysis conducted by PAPFAM, June 2013).||1427,444 +SOUTH SUDAN|Africa|Eastern Africa|Low Income|2010|6390|11,9|24,3|31,3|29,1|5,8|South Sudan Household Survey 2010. Final Report (MICS4). Juba, South Sudan, 2013 (and additional analysis)||1657,58 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|1987|1974|1,6|14,9|32,3|32,8|0,3|Sri Lanka demographic and health survey 1987. Demographic and Health Surveys. Colombo, Sri Lanka, 1987 (and additional analysis).|Age-adjusted;|1883,703 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|1993|3067||17,5|29,7|33,8||Sri Lanka demographic and health survey 1993. Colombo, Sri Lanka, 1995 (and additional analysis).|Converted estimates|1723,845 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|1995|2782||15,3|26,1|29,3||Preliminary report on the fourth national nutrition and health survey July - August, 1995. The Ceylon Journal of Medical Science 1997;40:13-24 (and additional analysis).|Converted estimates|1716,6529999999998 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|2000|2513|2,4|15,5|18,4|22,8|1,0|Sri Lanka demographic and health survey 2000. Colombo, Sri Lanka, 2001 (and additional analysis).|Excl. north & east provinces|1641,6070000000002 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|2006-07|6648|2,8|14,7|17,3|21,1|1,6|Sri Lanka demographic and health survey 2006/07: Preliminary report and selected tables from the chapters of the final report (I:\UnitData\SURVEILLANCE\GDCGM\data sets\Sri Lanka\DHS_MoH 2006_07_WHO\DHS_web_links.htm, accessed 03/07/09).||1797,145 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|2009|2589|1,9|11,8|19,2|21,6|0,8|Nutrition and food security survey 2009. Colombo, Sri Lanka: Medical Research Institute, 2010.||1797,296 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|2012|7306|3,0|21,4|14,7|26,3|0,6|National nutrition and micronutrient survey. Part I: Anaemia among children aged 6-59 months and nutritional status of children and adults. Colombo, Sri Lanka, 2013 (and additional analysis).||1743,692 +SRI LANKA|Asia|Southern Asia|Lower Middle Income|2016|7908|3,0|15,1|17,3|20,5|2,0| Sri Lanka 2016 Demographic and Health Survey (SLDHS)|(pending reanalysis)|1601,546 +STATE OF PALESTINE|Asia|Western Asia|Lower Middle Income|1996|4451||3,6|10,6|3,6|4,0|The health survey in the West Bank and Gaza Strip: main findings (MICS). Palestinian Central Bureau of Statistics. Ramallah, Palestine, 1996 (and additional analysis).|Converted estimates|545,313 +STATE OF PALESTINE|Asia|Western Asia|Lower Middle Income|2002|936||9,4|16,1|||Rapid nutritional assessment for West Bank and Gaza Strip. Executive summary. September 2002 Accessed 05.01.10 http://anahri.alquds.edu/index_files/PNACR368.pdf.|Converted estimates|578,268 +STATE OF PALESTINE|Asia|Western Asia|Lower Middle Income|2006-07|9359|0,7|1,8|13,6|2,6|11,4|Palestinian family health survey, 2006: Final report. Ramallah, Palestine, 2007 (and additional analysis)||586,105 +STATE OF PALESTINE|Asia|Western Asia|Lower Middle Income|2010|9157|1,0|3,3|10,9|3,7|5,3|Final report of the Palestinian family survey 2010 (MICS). Ramallah, State of Palestine: Palestinian Central Bureau of Statistics, 2013 (and additional analysis)||627,864 +STATE OF PALESTINE|Asia|Western Asia|Lower Middle Income|2014|7222|0,3|1,2|7,4|1,4|8,2|Palestinian Multiple Indicator Cluster Survey 2014, Final Report, Ramallah, Palestine (and additional analysis)||685,6239999999999 +SUDAN (THE)|Africa|Northern Africa|Lower Middle Income|2006|4151294|5,7|14,5|38,3|27,0|4,2|Sudan household health survey (SHHS) - 2006. Khartoum and Juba: Government of National Unity, Government of Southern Sudan, December 2007 (additional analysis conducted by PAPFAM, June 2013).||5253,891 +SUDAN (THE)|Africa|Northern Africa|Lower Middle Income|2010|12193|5,1|16,3|34,1|30,5|1,5|Sudan household health survey, second round 2010 (and additional analysis)||5529,78 +SUDAN (THE)|Africa|Northern Africa|Lower Middle Income|2014|11718|5,1|16,8|38,2|33,5|3,0|Multiple Indicator Cluster Survey 2014 of Sudan, Final Report. Khartoum, Sudan: UNICEF and Central Bureau of Statistics (CBS), February 2016 (and additional analysis)||5783,861999999999 +SURINAME|Latin America and the Caribbean|South America|Upper Middle Income|1999-00|1768|2,0|7,0|14,1|11,1|2,9|Full report: Suriname multiple indicator cluster survey (MICS) 2000. Paramaribo, Suriname, March 2001 (and additional analysis).||53,393 +SURINAME|Latin America and the Caribbean|South America|Upper Middle Income|2006|1981|1,0|4,9|10,6|7,5|4,0|Suriname multiple indicator cluster survey 2006, Final Report (MICS3). Paramaribo, Suriname, 2009 (and additional analysis).||51,001999999999995 +SURINAME|Latin America and the Caribbean|South America|Upper Middle Income|2010|2871|1,6|5,8|8,8|6,4|4,0|Suriname multiple indicator cluster survey 2010, Final Report (MICS). Paramaribo, Suriname, 2012 (and additional analysis).||50,043 +SYRIAN ARAB REPUBLIC (THE)|Asia|Western Asia|Low Income|1993|4154|4,5|10,0|32,8|11,5|15,0|Syrian maternal and child health survey (SMCHS). PAPCHILD surveys. Cairo: The League of Arab States, 1994 (and additional analysis).||2157,302 +SYRIAN ARAB REPUBLIC (THE)|Asia|Western Asia|Low Income|1995|2425||10,4|26,5|11,3||Multiple indicator cluster survey in the Syrian Arab Republic (MICS). Central Bureau of Statistics. Damascus, The Syrian Arab Republic, 1996.|Converted estimates|2185,908 +SYRIAN ARAB REPUBLIC (THE)|Asia|Western Asia|Low Income|2000|6262||4,9|24,3|6,0||[Multiple Indicator Cluster Survey II (MICS II) concerning Child Health and Welfare. Main report.] Damascus, Syrian Arab Republic: UNICEF, 2002 (and additional analysis).|Converted estimates|2432,026 +SYRIAN ARAB REPUBLIC (THE)|Asia|Western Asia|Low Income|2001|6367|5,4|10,3|31,1|11,1|19,7|The family health survey in the Syrian Arab Republic. Principal Report. Cairo: The League of Arab States, 2002 (and additional analysis).||2498,158 +SYRIAN ARAB REPUBLIC (THE)|Asia|Western Asia|Low Income|2006|10595|4,8|10,3|28,7|10,0|18,7|Syrian Arab Republic multiple indicator cluster survey 2006. February 2008 (and additional analysis).||2532,363 +SYRIAN ARAB REPUBLIC (THE)|Asia|Western Asia|Low Income|2009|14289|5,5|11,5|27,6|10,2|17,9|Family health survey of the Arab Republic of Syria 2009: Principal report (PAPFAM). Cairo: The League of Arab States, 2011 (and additional analysis).||2706,0490000000004 +TAJIKISTAN|Asia|Central Asia|Low Income|1999|3599||11,4|41,5|||National nutrition survey, Tajikistan (September/October 1999). London, UK: Action Against Hunger UK, 2000 (and additional analysis).|Converted estimates|895,515 +TAJIKISTAN|Asia|Central Asia|Low Income|2000|5657||9,4|42,1|||National nutrition survey of Tajikistan (September/October 2000). London, UK: Action Against Hunger UK, 2001 (and additional analysis).|Converted estimates|892,398 +TAJIKISTAN|Asia|Central Asia|Low Income|2001|3704||19,4|43,2|||Representative national nutrition survey Tajikistan (Sughd, RRS, Kouliab and Kurgan Teppe regions), October/November 2001. London, UK: Action Against Hunger UK, 2002 (and additional analysis).|Converted estimates|890,5880000000001 +TAJIKISTAN|Asia|Central Asia|Low Income|2002|4543||6,1|37,1|||National nutrition survey Tajikistan, May/June 2002. Action against Hunger and European Community Humanitarian Office, 2002 (and additional analysis).|Converted estimates|879,315 +TAJIKISTAN|Asia|Central Asia|Low Income|2003|4654||5,9|42,4|||National nutrition and water & sanitation survey, Tajikistan, October 2003. Dushanbe, Tajikistan: Action Against Hunger (lead agency nutrition) and Mercy Corps (lead agency wat/san), 2004 (and additional analysis).|Converted estimates|864,0260000000001 +TAJIKISTAN|Asia|Central Asia|Low Income|2005|4219|3,5|8,7|33,0|14,9|6,7|Tajikistan multiple indicator cluster survey 2005, Final Report. Dushanbe, Tajikistan: State Committee on Statistics of the Republic of Tajikistan, 2007 (and additional analysis).||858,597 +TAJIKISTAN|Asia|Central Asia|Low Income|2007|5157083|3,7|7,5|39,2|15,7|11,9|Tajikistan living standards measurement survey 2007 (TLSS): Indicators at a glance. Dushanbe, Republic of Tajikistan: State Committee on Statistics and UNICEF, 2009 (and additional analysis)||884,118 +TAJIKISTAN|Asia|Central Asia|Low Income|2009|2139|1,3|4,3|28,8|8,3|4,2|Micronutrient status survey in Tajikistan, 2009. Dushanbe, Republic of Tajikistan: Ministry of Health and UNICEF, 2010 (and additional analysis).||965,653 +TAJIKISTAN|Asia|Central Asia|Low Income|2012|5348|4,1|9,9|26,8|13,3|6,7|Tajikistan demographic and health survey 2012. Demographic and Health Surveys. Dushanbe, Tajikistan, and Calverton, Maryland, USA: SA, MOH, and ICF International, 2013 (and additional analysis).||1099,272 +TAJIKISTAN|Asia|Central Asia|Low Income|2017|6716|1,8|5,6|17,5|7,6|3,3|Tajikistan Demographic and Health Survey 2017: Key Indicators. Rockville, Maryland, USA: Statistical Agency under the President of the Republic of Tajikistan(SA), Ministry of Health and Social Protection of Population of the Republic of Tajikistan and ICF (and additional analysis)||1194,242 +THAILAND|Asia|South-Eastern Asia|Upper Middle Income|1987|1843|0,9|5,7|24,6|20,2|1,3|Thailand demographic and health survey 1987. Demographic and Health Surveys. Institute of Population Studies, Chulalongkorn University. Bangkok, Thailand, 1988 (and additional analysis).|Age-adjusted;|5588,076999999999 +THAILAND|Asia|South-Eastern Asia|Upper Middle Income|1993|11748||7,3|21,1|16,3||Random survey on nutritional status of children of ages under five. Thailand Journal of Health Promotion and Environmental Health 1996;19:57-66 (and additional analysis).|Converted estimates|5224,563 +THAILAND|Asia|South-Eastern Asia|Upper Middle Income|1995|4178||6,7|18,1|15,4|4,7|The fourth national nutrition survey of Thailand 1995. Department of Health. Bangkok, Thailand 1998 (and additional analysis).|Converted estimates|5125,727 +THAILAND|Asia|South-Eastern Asia|Upper Middle Income|2005-06|4711296|1,4|4,7|15,7|7,0|8,0|Thailand multiple indicator cluster survey December 2005 - February 2006, Final report. Bangkok, Thailand: National Statistical Office, 2006 (and additional analysis).||4187,655 +THAILAND|Asia|South-Eastern Asia|Upper Middle Income|2012|9203|2,2|6,7|16,4|9,2|10,9|International Health Policy Program (IHPP). Thailand multiple indicator cluster survey 2012. MICS. Bangkok, Thailand: NSO, UNICEF, MOPH, NHSO, THPF, IHPP, 2013 (and additional analysis)||4019,889 +THAILAND|Asia|South-Eastern Asia|Upper Middle Income|2015-16|11189|1,4|5,4|10,5|6,7|8,2|Thailand Multiple Indicator Cluster Survey 2015- 2016, Final Report, NSO and UNICEF, Bangkok, 2016 (and additional analysis0||3767,698 +TIMOR-LESTE|Asia|South-Eastern Asia|Lower Middle Income|2002|4133|4,9|13,7|55,7|40,6|5,7|Multiple indicator cluster survey (MICS - 2002). UNICEF, Dili, Timor-Leste, 2003 (and additional analysis).||182,111 +TIMOR-LESTE|Asia|South-Eastern Asia|Lower Middle Income|2003|5255||14,3|54,8|41,5||Timor Leste 2003 demographic and health survey. Newcastle, NSW, Australia: MOH and University of Newcastle, 2003 (and additional analysis).|Converted estimates|180,672 +TIMOR-LESTE|Asia|South-Eastern Asia|Lower Middle Income|2007-08||7,5|24,5|53,9|48,6||Final statistical abstract: Timor-Leste survey of living standards 2007. http://dne.mof.gov.tl/TLSLS/StatisticalData/6_Health/Main%20Tables/index.htm, accessed 27 March 2012.||173,18599999999998 +TIMOR-LESTE|Asia|South-Eastern Asia|Lower Middle Income|2009-10|9114|7,6|18,9|57,5|44,9|5,8|Timor-Leste demographic and health survey 2009-10. Demographic and Health Surveys. Dili, Timor-Leste: NSD [Timor-Leste] and ICF Macro, 2010 (and additional analysis).||182,28599999999997 +TIMOR-LESTE|Asia|South-Eastern Asia|Lower Middle Income|2013|1451858|2,3|10,5|50,9|37,5|1,4|Timor-Leste food and nutrition survey, Final report 2015. Dili, Timor Leste: Ministry of Health, 2015 (and additional analysis)||200,72799999999998 +TOGO|Africa|Western Africa|Low Income|1988|1667|1,4|5,9|40,7|21,7|2,9|Enquête démographique et de santé au Togo 1988. Demographic and Health Surveys. Direction Generale de la Santé. Lomé, Togo, 1989 (and additional analysis).|Age-adjusted;|660,02 +TOGO|Africa|Western Africa|Low Income|1996|3761|||40,2|16,7||Enquête national sur la situation des enfants au Togo en 1995 (MICS -Togo -96). Lomé, République Togolaise: Ministère du Plan et de l'Amenagement du Territoire et UNICEF, September 1996.|Converted estimates|739,48 +TOGO|Africa|Western Africa|Low Income|1998|3603|3,6|12,4|33,2|23,8|2,3|Enquete démographique et de santé, Togo 1998. Demographic and Health Surveys. Ministère de la Planification et du Développement Economique, Direction de la Statistique. Lomé, Togo, 1999 (and aditional analysis).|Age-adjusted;|774,056 +TOGO|Africa|Western Africa|Low Income|2006|3595|6,7|16,5|29,5|23,3|4,6|Résultats de l'enquête nationale à indicateurs multiples, Togo 2006. Rapport final, aôut 2007 (and additional analysis).||983,2289999999999 +TOGO|Africa|Western Africa|Low Income|2008|3204|0,7|6,0|26,9|20,5||Rapport d'enquête nationale nutrition et survie des enfants de 0 à 59 mois, pratique d'alimentation de nourrisson et du jeune enfants. SMART. Togo, décembre 2008||1033,691 +TOGO|Africa|Western Africa|Low Income|2010|4626|1,3|5,1|29,7|16,8|1,6|Enquête par grappes à indicateurs multiples MICS Togo, 2010: Rapport final. Lomé, Togo: DGSCN, 2010 (and additional analysis).||1076,937 +TOGO|Africa|Western Africa|Low Income|2013-14|3325|1,5|6,6|27,6|16,1|2,0|Enquête démographique et de santé au Togo 2013-2014. Demographic and Health Surveys. Rockville, Maryland, USA : MPDAT, MS et ICF International, 2015 (and additional analysis)||1147,214 +TONGA|Oceania|Polynesia|Upper Middle Income|1986|1094||1,3|2,2|||The 1986 national nutrition survey of the Kingdom of Tonga. Technical report National Food and Nutrition Committee. Nuku'alofa: Government of the Kingdom of Tonga, 1987 (and additional analysis).|Converted estimates|14,519 +TONGA|Oceania|Polynesia|Upper Middle Income|2012|1394|2,1|5,2|8,1|1,9|17,3|Tonga demographic and health survey 2012. Noumea, New Caledonia: Secretariat of the Pacific Community, 2013.||13,517999999999999 +TRINIDAD AND TOBAGO|Latin America and the Caribbean|Caribbean|High Income|1987|826|1,2|4,8|6,3|6,2|3,5|Trinidad and Tobago demographic and health survey 1987. Demographic and Health Surveys. Family Planning Association of Trinidad and Tobago. Port-of-Spain, Trinidad, 1988 (and additional analysis).|Age-adjusted;|153,942 +TRINIDAD AND TOBAGO|Latin America and the Caribbean|Caribbean|High Income|2000|761|0,9|5,2|5,3|4,3|5,0|2000 Multiple indicator cluster survey Trinidad and Tobago: Full report. UNICEF website (and additional analysis).||89,616 +TRINIDAD AND TOBAGO|Latin America and the Caribbean|Caribbean|High Income|2011|1095|2,1|6,4|9,2|4,9|11,4|Trinidad and Tobago Multiple Indicator Cluster Survey 2011, Key Findings & Tables. Port of Spain, Trinidad and Tobago: Ministry of Social Development and Familyvices, Central Statistical Office and UNICEF. 2017 (and additional analysis)||97,60600000000001 +TUNISIA|Africa|Northern Africa|Lower Middle Income|1988|2015|0,6|3,1|18,5|7,9|3,7|Enquête démographique et de santé en Tunisie 1988. Demographic and Health Surveys. Office National de la Famille et de la Population. Tunis, Tunisie, 1989 (and additional analysis).|Age-adjusted;|1070,323 +TUNISIA|Africa|Northern Africa|Lower Middle Income|1996-97|891||7,2|11,9|3,3|1,4|Enquête nationale 1996-1997. Evaluation de l'état nutritionnel de la population Tunisienne: Rapport national. Tunis, Tunisia: Sotepa Grafic, 1998 (and additional analysis).|Converted estimates|897,635 +TUNISIA|Africa|Northern Africa|Lower Middle Income|2000|10553||2,9|16,8|3,5||Tunisia multiple indicator cluster survey II 2000 (MICS II). Tunis, Tunisia: 2000 (and additional analysis).|Converted estimates|840,2610000000001 +TUNISIA|Africa|Northern Africa|Lower Middle Income|2006|2842|1,2|3,4|9,0|3,3|8,8|Enquête sur la santé et le bien être de la mère et l'enfant: MICS 3. Tunis, Tunisia, 2008 (and additional analysis conducted by PAPFAM).||803,193 +TUNISIA|Africa|Northern Africa|Lower Middle Income|2011-12|2677|2,2|3,3|10,1|2,8|14,2|Suivi de la situation des enfants et des femmes en Tunisie- Enquête par grappes à indicateurs multiples 2011-2012: Rapport Final. MICS. Tunis, Tunisie: MDCI, INS, UNICEF, 2013 (and additional analysis)||927,5189999999999 +TURKEY|Asia|Western Asia|Upper Middle Income|1993|3255|1,1|3,9|23,6|8,7|4,9|Turkey demographic and health survey, 1993. Demographic and Health Surveys. Ankara, Turkey, 1994 (and additional analysis).||6445,356 +TURKEY|Asia|Western Asia|Upper Middle Income|1995|2871||||9,0||Multiple indicator cluster survey in Turkey 1995. Ankara: National Bureau of Statistics, 1996 (and additional analysis).|Converted estimate|6438,939 +TURKEY|Asia|Western Asia|Upper Middle Income|1998|2867|0,8|3,0|18,8|7,0|3,8|Turkish demographic and health survey 1998. Demographic and Health Surveys. Hacettepe University, Institute of Population Studies. Ankara, Turkey, 1999 (and additional analysis).||6565,826999999999 +TURKEY|Asia|Western Asia|Upper Middle Income|2003-04|3772|0,4|1,1|15,2|3,5|8,8|Demographic and health survey, 2003. Ankara, Turkey: Hacettepe University Institute of Population Studies, MoH General Directorate of Mother and Child Health and Family Planning, State Planning Organization and the EU, 2004 (and additional analysis)||6580,174 +TURKEY|Asia|Western Asia|Upper Middle Income|2008|2694|0,3|1,0|12,5|1,9|9,7|Turkey Demographic and Health Survey 2008. Ankara, Turkey: Institute of Population Studies, Hacettepe University (and additional analysis)||6382,8240000000005 +TURKEY|Asia|Western Asia|Upper Middle Income|2013-14|2651|0,5|1,9|9,9|2,3|11,1|2013 Turkey demographic and health survey. Ankara, Turkey: Hacettepe University Institute of Population Studies, T.R. Ministry of Development and TÜBYTAK, 2014 (and additional analysis)||6635,619000000001 +TURKMENISTAN|Asia|Central Asia|Upper Middle Income|2000|2928||7,1|28,1|10,5||Turkmenistan demographic and health survey 2000. Demographic and Health Surveys. Calverton, Maryland, USA: GECRCMCH and ORC Macro, 2001(and additional analysis).|Converted estimates|489,648 +TURKMENISTAN|Asia|Central Asia|Upper Middle Income|2006|2040|2,1|7,2|18,9|9,2|4,5|Turkmenistan multiple indicator cluster survey 2006, Final Report. Ashgabat, Turkmenistan: Turkmenmillihasabat, 2006 (and additional analysis).||522,4630000000001 +TURKMENISTAN|Asia|Central Asia|Upper Middle Income|2015-16|3718|1,1|4,2|11,5|3,2|5,9|2015-2016 Turkmenistan Multiple Indicator Cluster Survey, Final Report (and additional analysis)||678,7660000000001 +TUVALU|Oceania|Polynesia|Upper Middle Income|2007|430|0,9|3,3|10,0|1,6|6,3|Tuvalu demographic and health survey. DHS. Noumea, New Caledonia: TCSD, SPC and Macro International Inc, 2007 (accessed 22/12/09 http://www.spc.int/sdp/index.php?option=com_docman&task=cat_view&gid=53&Itemid=42).||1,0 +UGANDA|Africa|Eastern Africa|Low Income|1988-89|3819|0,9|3,1|47,7|19,7|3,6|Uganda demographic and health survey 1988/89. Demographic and Health Surveys. Ministry of Health. Entebbe, Uganda, 1989 (and additional analysis).||3203,494 +UGANDA|Africa|Eastern Africa|Low Income|1995|5012|2,0|5,9|45,7|20,8|5,0|Uganda demographic and health survey 1995. Demographic and Health Surveys. Calverton, Maryland: Statistics Department and Macro International Inc., 1996 (and additional analysis).|Age-adjusted;|4142,0470000000005 +UGANDA|Africa|Eastern Africa|Low Income|2000-01|6315|1,5|5,0|44,9|19,2|4,9|Uganda demographic and health survey 2000-2001. Demographic and Health Surveys. Calverton, Maryland, USA: UBOS and ORC Macro, 2001 (and additional analysis).| (41 out of 45 districts)|4842,238 +UGANDA|Africa|Eastern Africa|Low Income|2006|2742|2,2|6,2|38,3|16,3|4,9|Uganda demographic and health survey 2006. Demographic and Health Surveys. Calverton, Maryland, USA: UBOS and Macro International Inc., 2007 (and additional analysis).||5935,783 +UGANDA|Africa|Eastern Africa|Low Income|2011|2395|1,5|4,6|33,4|14,1|3,8|Uganda demographic and health survey 2011. Demographic and Health Surveys. Kampala, Uganda: UBOS and Calverton, Maryland: ICF International Inc., 2012 (and additional analysis).||6810,5830000000005 +UGANDA|Africa|Eastern Africa|Low Income|2011-12|2966543|0,9|4,7|33,7|12,4|5,8|Uganda National Panel Survey (UNPS) - Wave III. Kampala, Uganda: UBOS, 2013 (and additional analysis).||6985,4 +UGANDA|Africa|Eastern Africa|Low Income|2016|5136|1,3|3,5|28,9|10,4|3,7|Uganda Demographic and Health Survey 2016. Kampala, Uganda and Rockville, Maryland, USA: UBOS and ICF. 2018 (and additional analysis)||7698,908 +UKRAINE|Europe|Eastern Europe|Lower Middle Income|2000|4247|3,8|8,2|22,9|4,1|26,5|2000 Multiple indicator cluster survey (full report). MICS. (and additional analysis).||2160,554 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|1991-92|6400|2,8|7,8|49,9|24,8|5,8|Tanzania demographic and health survey 1991/92. Demographic and Health Surveys. Dar es Salaam, United Republic of Tanzania, 1992 (and additional analysis).||4806,784000000001 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|1996|5561|3,0|8,5|49,6|26,8|4,6|Tanzania demographic and health survey 1996. Demographic and Health Surveys. Calverton, Maryland: Bureau of Statistics and Macro International Inc., 1997 (and additional analysis).||5507,29 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|1999|2648|2,0|5,6|48,3|25,3|3,3|Tanzania reproductive and child health survey 1999. Demographic and Health Surveys. Calverton, Maryland: National Bureau of Statistics [Tanzania] and Macro International Inc., 2000 (and additional analysis).||5829,325 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|2004-05|8168|1,0|3,6|44,4|16,7|4,9|Tanzania demographic and health survey 2004-05. Demographic and Health Surveys. Dar es Salaam, Tanzania: National Bureau of Statistics and ORC Macro, 2005 (and additional analysis).||6855,840999999999 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|2008-09|5211951|0,8|2,9|43,1|16,4|4,6|Tanzania National Panel Survey Report (NPS) –Round 1, 2008 - 2009. Dar es Salaam, Tanzania: NBS, 2009 (and additional analysis)||8005,096 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|2009-10|7676|1,3|4,9|42,1|16,1|5,4|Tanzania demographic and health survey 2010. Demographic and Health Surveys. Dar es Salaam, Tanzania: NBS and ICF Macro, 2011 (and additional analysis).||8225,569 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|2010-11|6497375|1,7|6,3|34,9|14,1|5,2|Tanzania National Panel Survey Report (NPS) - Wave 2, 2010 - 2011. Dar es Salaam, Tanzania: NBS, 2012 (and additional analysis)||8455,923 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|2012-13|6352019|1,5|4,5|37,1|13,1|5,0|Tanzania National Panel Survey Report (NPS) - Wave 3, 2012 - 2013. Dar es Salaam, Tanzania: NBS, 2014 (and additional analysis).||8943,136 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|2014|16867|0,9|3,8|34,7|13,4||Tanzania national nutrition survey 2014: Final report. United Republic of Tanzania, December 2014.|(pending reanalysis)|9186,715 +UNITED REPUBLIC OF TANZANIA (THE)|Africa|Eastern Africa|Low Income|2015-16|9886|1,2|4,5|34,5|13,7|3,7|Tanzania demographic and health survey 2015-16. Demographic and Health Surveys. Dar es Salaam, Tanzania: NBS and ICF International, 2016 (and additional analysis)||9419,084 +UNITED STATES OF AMERICA (THE)|Northern America|Northern America|High Income|1988-94|6662|0,1|0,7|3,2|0,9|5,4|Plan and operation of the third national health and nutrition examination survey, 1988-94 (NHANES III). Vital Health Statistics 1994;32:1-2 (and additional analysis).|(2-60 months)|19555,672 +UNITED STATES OF AMERICA (THE)|Northern America|Northern America|High Income|1999-02|2666|0,0|0,4|3,3|1,1|7,0|Prevalence of overweight and obesity among US children, adolescents, and adults, 1999-2002. JAMA 2004;291:2847-50 (and additional analysis).||19382,292 +UNITED STATES OF AMERICA (THE)|Northern America|Northern America|High Income|2003-06|3092|0,1|0,8|3,2|1,1|8,1|National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, CDC, [2003-06 combined][wwwn.cdc.gov/nchs/nhanes/search/nhanes03_04.aspx and wwwn.cdc.gov/nchs/nhanes/search/nhanes05_06.aspx].||20273,45 +UNITED STATES OF AMERICA (THE)|Northern America|Northern America|High Income|2007-10|2898|0,0|0,5|2,7|0,8|7,8|National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, CDC, [2007-10 combined][wwwn.cdc.gov/nchs/nhanes/search/nhanes07_08.aspx and wwwn.cdc.gov/nchs/nhanes/search/nhanes09_10.aspx].||20913,782 +UNITED STATES OF AMERICA (THE)|Northern America|Northern America|High Income|2011-12|600|0,0|0,5|2,1|0,5|6,0|National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, CDC, [2011-12] [wwwn.cdc.gov/nchs/nhanes/search/nhanes11_12.aspx].||20508,408 +UNITED STATES OF AMERICA (THE)|Northern America|Northern America|High Income|2013-14|||0,3|2,4||8,2|National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, CDC, [2013-14] ||19969,078999999998 +UNITED STATES OF AMERICA (THE)|Northern America|Northern America|High Income|2015-16|||0,4|3,5||9,4|National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, CDC, [2015-16]||19606,548 +URUGUAY|Latin America and the Caribbean|South America|High Income|1987|3471|||21,0|6,5||Uruguay: Situacion alimentario-nutricional, algunos factores condicionantes 1970-87. Document prepared for the ACC/SCN. Montevideo, Uruguay, 1987 (and additional analysis).|Converted estimates|258,579 +URUGUAY|Latin America and the Caribbean|South America|High Income|1999|11413|0,8|2,3|12,8|4,7|9,0|Trends in early growth indices (stunting and overweight) in the first 24 months of life in Uruguay over the past decade. Public Health Nutrition 2013 (in press). Encuesta nacional sobre estado nutricional, prácticas de alimentación y anemia. Montevideo, Uruguay: MSP, MIDES, RUANDI, UNICEF, 2011 (and additional analysis).|Age-adjusted;|274,48400000000004 +URUGUAY|Latin America and the Caribbean|South America|High Income|2002|7091|0,5|2,4|14,7|5,4|10,0|Sistema de vigilancia del estado nutricional (SISVEN), 2002. Programa Nacional de Nutrición. Montevideo, Uruguay, 2007.| National monitoring system|262,51099999999997 +URUGUAY|Latin America and the Caribbean|South America|High Income|2003|2787|0,9|2,8|15,8|5,1|11,5|Trends in early growth indices (stunting and overweight) in the first 24 months of life in Uruguay over the past decade. Public Health Nutrition 2013 (in press). Encuesta nacional sobre estado nutricional, prácticas de alimentación y anemia. Montevideo, Uruguay: MSP, MIDES, RUANDI, UNICEF, 2011 (and additional analysis).|Age-adjusted;|259,86400000000003 +URUGUAY|Latin America and the Caribbean|South America|High Income|2004|7012|0,7|3,0|13,9|6,0|9,4|Sistema de vigilancia del estado nutricional (SISVEN), 2004. Programa Nacional de Nutrición. Montevideo, Uruguay, 2007.|National monitoring system|257,60900000000004 +URUGUAY|Latin America and the Caribbean|South America|High Income|2007|3004|1,0|2,5|10,8|4,2|7,9|Trends in early growth indices (stunting and overweight) in the first 24 months of life in Uruguay over the past decade. Public Health Nutrition 2013 (in press) (and additional analysis)|Age-adjusted;|251,8 +URUGUAY|Latin America and the Caribbean|South America|High Income|2011|2979|0,0|1,3|10,7|4,0|7,2|Trends in early growth indices (stunting and overweight) in the first 24 months of life in Uruguay over the past decade. Public Health Nutrition 2013 (in press) (and additional analysis)|Age-adjusted;|246,171 +UZBEKISTAN|Asia|Central Asia|Lower Middle Income|1996|1148|6,1|10,7|39,5|13,3|15,9|Uzbekistan demographic and health survey 1996. Demographic and Health Surveys. Calverton, Maryland: Institute of Obstetrics and Gynecology and Macro International Inc., 1997 (and additional analysis).|Age-adjusted;|3237,5490000000004 +UZBEKISTAN|Asia|Central Asia|Lower Middle Income|2002|2524|3,9|9,0|24,9|7,4|10,9|Uzbekistan health examination survey 2002. Demographic and Health Surveys. Calverton, Maryland, USA: Analytical and Information Center, State Department of Statistics, and ORC Macro, 2004 (and additional analysis)||2650,155 +UZBEKISTAN|Asia|Central Asia|Lower Middle Income|2006|4883|1,6|4,4|19,6|4,4|12,2|Uzbekistan multiple indicator cluster survey 2006, Final report. Tashkent, Uzbekistan: UNICEF, 2007 (and additional analysis).||2606,1679999999997 +VANUATU|Oceania|Melanesia|Lower Middle Income|1996|1297||6,8|25,7|10,6||Report of the second national nutrition survey 1996. Government of the Republic of Vanuatu, Department of Health and AusAID, 1998 (and additional analysis).|Converted estimates|26,796999999999997 +VANUATU|Oceania|Melanesia|Lower Middle Income|2007|1342|1,9|5,9|25,7|11,5|4,7|Vanuatu multiple indicator cluster survey 2007 (MICS). Final Report. Port Vila, Vanuatu: Ministry of Health, Government of Vanuatu, 2008 (and additional analysis).||30,912 +VANUATU|Oceania|Melanesia|Lower Middle Income|2013|1241|1,1|4,4|28,5|10,7|4,6|Vanuatu demographic and health survey 2013. Port Vila, Vanuatu, 2014.|(pending reanalysis)|35,244 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1987|18023||2,2|7,0|3,9|9,0|Proyecto Venezuela 1987. Caracas: Centro de estudios sobre crecimiento y desarrollo de la poblacion venezolana, 1995 (and additional analysis).|Converted estimates|2605,928 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1990|180709||5,7|18,6|6,7|4,0|Resultados de la evalucion antropométrica del componente menores de 5 anos del Sistema de Vigilancia Alimentaria y Nutricional (SISVAN): Venezuela 1990-1993. Caracas: Instituto Nacional de Nutricion, 1996 (and additional analysis).|Converted estimates|2764,28 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1991|261095||4,5|18,2|5,4|4,3|Resultados de la evalucion antropométrica del componente menores de 5 anos del Sistema de Vigilancia Alimentaria y Nutricional (SISVAN): Venezuela 1990-1993. Caracas: Instituto Nacional de Nutricion, 1996 (and additional analysis).|Converted estimates|2807,3779999999997 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1992|257491||4,3|18,3|4,5|4,9|Resultados de la evalucion antropométrica del componente menores de 5 anos del Sistema de Vigilancia Alimentaria y Nutricional (SISVAN): Venezuela 1990-1993. Caracas: Instituto Nacional de Nutricion, 1996 (and additional analysis).|Converted estimates|2822,53 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1993|256344||4,0|17,4|4,0|4,9|Resultados de la evalucion antropométrica del componente menores de 5 anos del Sistema de Vigilancia Alimentaria y Nutricional (SISVAN): Venezuela 1990-1993. Caracas: Instituto Nacional de Nutricion, 1996 (and additional analysis).|Converted estimates|2817,672 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1994|235552||3,8|17,9|3,9|5,0|Clasificacion antropometrica nutricional, Venezuela 1994. INN-SISVAN componente menores de 5 anos. Caracas: Instituto Nacional de Nutricion, 1996 (and additional analysis).|Converted estimates|2807,8340000000003 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1995|341155||3,8|18,9|4,1|4,7|Evaluacion antropometrica nutricional de los menores de cinco anos, para comparacion internacional: Venezuela 1995-1997. Caracas: Instituto Nacional de Nutricion, 1998 (and additional analysis).|Converted estimates|2803,4840000000004 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1996|344701||3,8|19,3|4,4|4,7|Evaluacion antropometrica nutricional de los menores de cinco anos, para comparacion internacional: Venezuela 1995-1997. Caracas: Instituto Nacional de Nutricion, 1998 (and additional analysis).|Converted estimates|2786,423 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1997|291749||3,8|19,9|4,5|5,0|Evaluacion antropometrica nutricional de los menores de cinco anos, para comparacion internacional: Venezuela 1995-1997. Caracas: Instituto Nacional de Nutricion, 1998 (and additional analysis).|Converted estimates|2785,99 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1998|299531||4,4|19,2|4,6|4,9|Evaluacion antropometrica nutricional de los menores de cinco años, para comparacion internacional. Venezuela 1990-1998. Caracas: Instituto Nacional de Nutricion, 1999 (and additional analysis).|Converted estimates|2797,808 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|1999|377496||4,0|18,3|4,1|5,2|Evaluacion antropometrica nutricional de los menores de cinco anos, para comparacion internacional. Venezuela 1990-1999. Caracas: Instituto Nacional de Nutricion, 2000 (and additional analysis).|Converted estimates|2812,4629999999997 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2000|321257||3,9|17,4|3,9|5,3|Evaluacion antropometrica nutricional de los menores de cinco años, para comparacion internacional. Venezuela 2000. Caracas: Instituto Nacional de Nutrition, 2001(and additional analysis).|Converted estimates|2823,4120000000003 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2001|||4,4|17,3|4,0|5,4|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2840,423 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2002|||4,8|17,6|4,2|5,4|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2854,1440000000002 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2003|||5,2|17,7|4,6|5,3|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2864,68 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2004|||5,2|17,1|4,5|5,2|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2874,7529999999997 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2005|||4,8|16,2|4,1|5,5|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2886,49 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2006|||4,8|16,2|3,9|6,1|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2906,309 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2007|242775||5,0|15,6|3,7|6,1|Sistema de vigilancia alimentaria y nutricional Venezuela 2007. Caracas, Venezuela: Instituto Nacional de Nutrición, 2009 (y análisis adicional).|Converted estimates|2921,0209999999997 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2008|||4,5|14,6|3,2|6,3|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2932,204 +VENEZUELA (BOLIVARIAN REPUBLIC OF)|Latin America and the Caribbean|South America|Upper Middle Income|2009|||4,1|13,4|2,9|6,4|Ficha técnica: Evaluación antropométrica nutricional en menores de 5 años según criterios internacionales. Caracas, Venezuela: Gobierno Bolivariano de Venezuela, Ministerio del Poder Popular para la Salud, INN, 2012 (and additional analysis).|Converted estimates|2941,185 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|1987-89|7044||11,1|61,3|40,7||Report on re-analyzed data collected by the General Nutrition Survey 1987-89. Department of Planning. Hanoi, Viet Nam, 1991 (and additional analysis).|Converted estimates|9040,48 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|1992-93|2833|1,3|6,7|61,4|36,9|2,8|Viet Nam living standards survey 1992-93 (VNLSS). Washington, D.C.: The World Bank, 1998 (and additional analysis).||9409,280999999999 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|1994|37764||13,5|52,5|40,6||Viet Nam: Xerophthalmia free; 1994 national Vitamin A deficiency and protein-energy malnutrition prevalence survey. Consultancy report 5-17 March 1995. National Institute of Nutrition. Hanoi, Viet Nam, 1995 (and additional analysis).|Converted estimates|9363,981 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|1998|12919||11,9|42,1|35,8|1,4|National protein energy malnutrition survey, Viet Nam 1998. National Institute of Nutrition, Hanoi, Viet Nam and Centre for Clinical Epidemiology & Biostatistics, Newcastle, Australia, 1999 (and additional analysis).|Converted estimates|8106,876 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|1999|1540|2,8|11,0|43,7|31,1|1,8|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|7619,840999999999 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2000|3041|1,0|6,1|43,2|26,7|2,6|Multiple indicator cluster survey Viet Nam, 2000. New York: UNICEF, 2004. Standard tables (and additional analysis).||7244,526999999999 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2002|1529|2,4|8,9|37,5|23,4|2,6|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|6553,569 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2003|1457|2,8|10,9|35,4|24,6|2,2|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|6587,677 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2004|1500|2,8|11,3|33,7|23,8|2,7|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|6691,533 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2005|1493|2,8|10,7|33,2|22,7|2,6|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|6760,019 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2006|1531|2,5|9,9|31,8|22,1|3,1|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|6988,751 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2007|1507|2,4|10,1|32,2|22,6|2,9|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|7108,596 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2008|1484|2,5|9,7|30,5|20,2|3,0|Annual national nutrition monitoring. Nutrition Surveillance Department. Hanoi, Vietnam: National Institute of Nutrition, 2009 (and additional analysis).|Surveillance data - weighted|7149,052 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2009-10|94256|3,8|7,1|29,3|17,5||General nutrition survey 2009-2010. Hanoi, Viet Nam: Medical Publishing House, 2010.||7277,420999999999 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2010-11|3607|1,5|4,4|22,7|12,0|4,4|Viet Nam multiple indicator cluster survey 2011 (MICS), final report. Ha Noi, Viet Nam, 2011 (and additional analysis).||7418,376 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2013|99421|1,6|6,6|25,9|15,3|4,6|Nutrition surveillance profiles 2013. Hanoi, Viet Nam, 2014.|Surveillance data (updated report 13/5/2014)|7629,968000000001 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2014|98424|4,8|6,8|24,9|14,5|3,5|Nutrition surveillance profiles 2014. Hanoi, Viet Nam, 2016.|Surveillance data (updated report 11/1/2014)|7705,15 +VIET NAM|Asia|South-Eastern Asia|Lower Middle Income|2015|98447|1,4|6,4|24,6|14,1|5,3|Nutrition surveillance profiles 2015. Hanoi, Viet Nam, 2017.||7752,861 +YEMEN|Asia|Western Asia|Low Income|1991-92|3885|5,5|14,3|52,4|29,6|8,1|Yemen maternal and child health survey (YDMCHS). PAPCHILD Surveys. Sana, Republic of Yemen, 1992 (and additional analysis).||2715,5240000000003 +YEMEN|Asia|Western Asia|Low Income|1996|3833||17,4|50,4|34,2|6,9|Yemen multiple indicator cluster survey (March 1996): Final results. Ministry of Planning and Development. Sanaa, Republic of Yemen, 1996 (and additional analysis).|Converted estimates|3152,9590000000003 +YEMEN|Asia|Western Asia|Low Income|1997|8222|6,8|16,5|55,2|43,0|3,7|Yemen demographic and maternal and child health survey 1997. Demographic and Health Surveys. Central Statistical Organization. Sana'a, Yemen, 1998 (and additional analysis).||3174,3059999999996 +YEMEN|Asia|Western Asia|Low Income|2003|12364|6,3|15,2|57,7|43,1|5,0|The Yemen family health survey: Principal report. Pan Arab Project for Family Health. Cairo, Egypt: The Republic of Yemen Ministry of Health & Population, Central Statistical Organization an League of Arab States, 2004 (and additional analysis).||3227,6040000000003 +YEMEN|Asia|Western Asia|Low Income|2011|3769453|3,4|13,3|46,6|35,5|1,5|The state of food security and nutrition in Yemen. Comprehensive food security survey 2011. Sana'a, Republic of Yemen, 2013 (and additional analysis).||3751,3759999999997 +YEMEN|Asia|Western Asia|Low Income|2013|14624|5,4|16,4|46,4|39,9|2,5|Yemen National Health and Demographic Survey 2013. Rockville, Maryland, USA: MOPHP, CSO, PAPFAM, and ICF International, 2014 (and additional analysis)||3895,949 +ZAMBIA|Africa|Eastern Africa|Lower Middle Income|1992|5057|2,2|6,3|46,3|21,2|4,7|Zambia demographic and health survey 1992. Demographic and Health Surveys. Central Statistical Office. Lusaka, Zambia, 1993 (and additional analysis).||1557,0720000000001 +ZAMBIA|Africa|Eastern Africa|Lower Middle Income|1995||||58,1|||Zambia's children in 1995: Key results of a survey to monitor progress towards goals for children (MICS2). Lusaka, Zambia: Government of the Republic of the Zambia, 1997 (and additional analysis).|Converted estimate|1670,747 +ZAMBIA|Africa|Eastern Africa|Lower Middle Income|1996-97|5612|1,7|5,4|48,6|19,6|6,2|Zambia demographic and health survey 1996. Demographic and Health Surveys. Calverton, Maryland: Central Statistical Office and Macro International Inc., 1997 (and additional analysis).||1722,2179999999998 +ZAMBIA|Africa|Eastern Africa|Lower Middle Income|1999|1105300|1,8|5,0|59,2|19,6|14,0|Zambia 1999 multiple indicator cluster survey report: Report on the monitoring of the end of decade goals. Lusaka, Zambia, 2000 (and additional analysis).||1888,128 +ZAMBIA|Africa|Eastern Africa|Lower Middle Income|2001-02|6023|2,3|6,2|52,5|23,2|5,9|Zambia demographic and health survey 2001-2002. Demographic and Health Surveys. Calverton, Maryland, USA: Central Statistical Office, Central Board of Health, and ORC Macro, 2003 (and additional analysis).||2079,324 +ZAMBIA|Africa|Eastern Africa|Lower Middle Income|2007|5933|2,3|5,6|45,8|14,9|8,4|Zambia demographic and health survey 2007. Demographic and Health Surveys. Calverton, Maryland, USA: CSO and Macro International Inc., 2009 (and additional analysis).||2342,367 +ZAMBIA|Africa|Eastern Africa|Lower Middle Income|2013-14|12877|2,5|6,2|40,0|14,9|6,2|Zambia demographic and health Survey 2013-14. Demographic and Health Surveys. Rockville, Maryland, USA: Central Statistical Office, Ministry of Health, and ICF International, 2014 (and additional analysis)||2626,277 +ZIMBABWE|Africa|Eastern Africa|Low Income|1987|419964||||10,5||Report of the nutrition component of the national health information system. Harare, Zimbabwe, 1987 (and additional analysis).|Converted estimate|1702,055 +ZIMBABWE|Africa|Eastern Africa|Low Income|1988|2470|0,4|1,7|31,0|8,0|5,4|Zimbabwe demographic and health survey, 1988. Demographic and Health Surveys. Harare, Zimbabwe, 1989 (and additional analysis).||1718,519 +ZIMBABWE|Africa|Eastern Africa|Low Income|1994|2070|1,7|5,3|28,5|11,8|6,4|Zimbabwe demographic and health survey 1994. Demographic and Health Surveys. Calverton, Maryland: Central Statistical Office and Macro International Inc., 1995 (and additional analysis).|Age-adjusted;|1776,085 +ZIMBABWE|Africa|Eastern Africa|Low Income|1999|3181|4,1|8,3|33,8|11,5|10,5|Zimbabwe demographic and health survey 1999. Demographic and Health Surveys. Calverton, Maryland: Central Statistical Office and Macro International Inc., 2000 (and additional analysis).||1817,125 +ZIMBABWE|Africa|Eastern Africa|Low Income|2005-06|5273|2,9|7,3|35,3|14,0|8,8|Zimbabwe demographic and health survey 2005-06. Demographic and Health Surveys. Calverton, Maryland: CSO and Macro International Inc., 2007 (and additional analysis).||1950,476 +ZIMBABWE|Africa|Eastern Africa|Low Income|2009|6196|1,9|3,8|35,1|12,6|3,5|Zimbabwe multiple indicator monitoring survey (MIMS), 2009. Report August 2010. Harare, Zimbabwe: ZIMSTAT, 2010 (and additional analysis).||2160,621 +ZIMBABWE|Africa|Eastern Africa|Low Income|2010-11|5414|0,8|3,2|32,2|10,2|5,8|Zimbabwe demographic and health survey 2010-11. Demographic and Health Surveys. Calverton, Maryland: ZIMSTAT and ICF International Inc., 2012 (and additional analysis).||2225,702 +ZIMBABWE|Africa|Eastern Africa|Low Income|2014|9591|0,9|3,4|27,6|11,3|3,6|Zimbabwe Multiple Indicator Cluster Survey 2014, Final Report. Harare, Zimbabwe (and additional analysis)||2466,295 +ZIMBABWE|Africa|Eastern Africa|Low Income|2015|6380|1,1|3,3|27,1|8,5|5,6|Zimbabwe Demographic and Health Survey 2015, November 2016 (and additional analysis)||2505,484