diff --git a/.DS_Store b/.DS_Store index eeb51de..e4e1975 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/module-1/.DS_Store b/module-1/.DS_Store index dc90db0..8ca7067 100644 Binary files a/module-1/.DS_Store and b/module-1/.DS_Store differ diff --git a/module-1/Untitled.ipynb b/module-1/Untitled.ipynb new file mode 100644 index 0000000..b7292ce --- /dev/null +++ b/module-1/Untitled.ipynb @@ -0,0 +1,391 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "from bs4 import BeautifulSoup as bs" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "url = 'https://es.wikipedia.org/wiki/Videoconsola'\n", + "res=requests.get(url)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "data=res.text\n", + "soup=bs(data, 'html.parser')" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
Fabricante\n", + "Consola\n", + "Lanzamiento\n", + "Unidades vendidas\n", + "
Nintendo\n", + "Nintendo DS\n", + "2 de diciembre de 2004\n", + "32,990,000[19]​\n", + "
Nintendo\n", + "Game Boy and Game Boy Color\n", + "21 de abril de 1989\n", + "32,470,000[19]​\n", + "
Nintendo\n", + "Nintendo 3DS\n", + "26 de febrero de 2011\n", + "24,700,000[19]​\n", + "
Sony\n", + "PlayStation 2\n", + "4 de marzo de 2000\n", + "21,454,325[49]​\n", + "
Nintendo\n", + "Famicom (NES)\n", + "15 de julio de 1983\n", + "19,350,000[19]​\n", + "
Nintendo\n", + "Super Famicom (Super NES)\n", + "21 de noviembre de 1990\n", + "17,170,000[19]​\n", + "
Nintendo\n", + "Game Boy Advance\n", + "21 de febrero de 2001\n", + "16,960,000[19]​\n", + "
Sony\n", + "PlayStation Portable\n", + "12 de diciembre de 2004\n", + "16,867,853[50]​\n", + "
Nintendo\n", + "Wii\n", + "2 de diciembre de 2006\n", + "12,750,000[19]​\n", + "
Nintendo\n", + "Nintendo Switch\n", + "3 de marzo de 2017\n", + "Más de 10,000,000\n", + "
NEC\n", + "PC Engine (TurboGrafx-16)\n", + "30 de octubre de 1987\n", + "8,000,000[51]​\n", + "
Sony\n", + "PlayStation 4\n", + "22 de febrero de 2014\n", + "8,506,964[52]​\n", + "
Sony\n", + "PlayStation Vita\n", + "17 de diciembre de 2011\n", + "5,643,626[52]​\n", + "
Nintendo\n", + "Nintendo 64\n", + "23 de junio de 1996\n", + "5,540,000[19]​\n", + "
Sega\n", + "Sega Saturn\n", + "22 de noviembre de 1994\n", + "5,000,000[cita requerida]\n", + "
Nintendo\n", + "Nintendo Switch\n", + "3 de marzo de 2017\n", + "4,380,000[19]​\n", + "
Nintendo\n", + "Nintendo GameCube\n", + "14 de septiembre de 2001\n", + "4,040,000[19]​\n", + "
Sega\n", + "Mega Drive\n", + "29 de octubre de 1988\n", + "3,580,000[53]​\n", + "
Nintendo\n", + "Wii U\n", + "8 de diciembre de 2012\n", + "3,340,000[19]​\n", + "
Sega\n", + "Dreamcast\n", + "27 de noviembre de 1998\n", + "2,320,000[54]​\n", + "
Microsoft\n", + "Xbox 360\n", + "10 de diciembre de 2005\n", + "1,448,665[50]​\n", + "
Sega\n", + "Sega Mark III (Master System)\n", + "20 de octubre de 1985\n", + "1,000,000[55]​\n", + "
Microsoft\n", + "Xbox One\n", + "4 de septiembre de 2014\n", + "87,592[52]​\n", + "
" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tables=soup.find_all('table')\n", + "japon=soup.find_all('table')[-5]\n", + "japon" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Nintendo'" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "elem=ultima.find_all('a')[0].text\n", + "elem" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'NoneType' object has no attribute 'text'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;31m# print(fila)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfila\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m>\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m fabricante={'Consola': fila[0].find('a').text.strip(),\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0;34m'Lanzamiento'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfila\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m 'Unidades vendidas':(fila[3].text),}\n", + "\u001b[0;31mAttributeError\u001b[0m: 'NoneType' object has no attribute 'text'" + ] + } + ], + "source": [ + "ventas_japon=[]\n", + "\n", + "for f in japon.find_all('tr'): # lista de filas de la tabla\n", + " fila=[e for e in f.find_all('td')] # elementos dentro de la fila\n", + "# print(fila)\n", + " if len(fila)>0:\n", + " fabricante={'Consola': fila[0].find('a').text.strip(),\n", + " 'Lanzamiento':(fila[1].text),\n", + " 'Unidades vendidas':(fila[3].text),}\n", + " ventas_japon.append(fabricante)\n", + " \n", + "ventas_japon" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Game Boy\n" + ] + } + ], + "source": [ + "print(fila[1].find('a')) " + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[Nintendo\n", + ", Game Boy and Game Boy Color\n", + ", 21 de abril de 1989\n", + ", 32,470,000[19]​\n", + "]\n" + ] + } + ], + "source": [ + "print(fila)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.7.7" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/module-1/lab-advanced-regex/your-code/main.ipynb b/module-1/lab-advanced-regex/your-code/main.ipynb index b898da5..15ca20b 100755 --- a/module-1/lab-advanced-regex/your-code/main.ipynb +++ b/module-1/lab-advanced-regex/your-code/main.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -36,10 +36,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['i', 'i', 'o', 'i', 'o', 'e', 'a', 'e', 'e', 'e', 'i', 'a', 'o', 'o', 'u', 'e', 'o', 'o', 'e', 'i', 'i']\n" + ] + } + ], + "source": [ + "res=re.findall('[aeiou]', text)\n", + "print (res)\n" + ] }, { "cell_type": "markdown", @@ -50,7 +61,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -59,10 +70,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['puppy', 'puppies', 'puppy']\n" + ] + } + ], + "source": [ + "res=re.findall('puppy|puppies', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -73,7 +95,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -82,10 +104,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['ran', 'run']\n" + ] + } + ], + "source": [ + "res=re.findall('run|ran', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -96,10 +129,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['ran', 'relay', 'race', 'run']\n" + ] + } + ], + "source": [ + "res=re.findall('r[a-z]+', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -110,7 +154,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -119,10 +163,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is a sentence with special characters in it.\n" + ] + } + ], + "source": [ + "res=re.sub('!', 'i', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -133,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -142,10 +197,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['sentence', 'words', 'varying', 'lengths']\n" + ] + } + ], + "source": [ + "res=re.findall('\\w{5,}', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -156,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -165,10 +231,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['bet', 'robot', 'beat', 'bot', 'bat', 'but', 'bit']\n" + ] + } + ], + "source": [ + "res=re.findall('\\w*b\\w*t', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -179,7 +256,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -188,10 +265,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['peaks', 'people', 'realize', 'breathtaking', 'Nearly']\n" + ] + } + ], + "source": [ + "res=re.findall('\\w+ea\\w+|\\w+eo\\w+', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -202,7 +290,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -211,10 +299,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Teddy', 'Roosevelt', 'Abraham', 'Lincoln']\n" + ] + } + ], + "source": [ + "res=re.findall('[A-Z]\\w+', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -225,10 +324,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Teddy Roosevelt', 'Abraham Lincoln']\n" + ] + } + ], + "source": [ + "res=re.findall('[A-Z]\\w+\\s+[A-Z]\\w+', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -241,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -250,10 +360,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['I will bet you $50 I can get the bartender to give me a free drink.', 'I am in!']\n" + ] + } + ], + "source": [ + "res=re.findall('\\\"(.*?)\\\"', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -264,7 +385,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -273,10 +394,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['30', '30', '14', '16', '10']\n" + ] + } + ], + "source": [ + "res=re.findall('\\d+', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -287,7 +419,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -299,10 +431,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['876-93-2289', '098-32-5295']\n" + ] + } + ], + "source": [ + "res=re.findall('\\d+-\\d+-\\d+', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -313,10 +456,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['(847)789-0984', '(987)222-0901']\n" + ] + } + ], + "source": [ + "res=re.findall('\\(\\d+\\)\\d+-\\d+', text)\n", + "print (res)" + ] }, { "cell_type": "markdown", @@ -325,6 +479,24 @@ "### 15. Use a regular expression to find and extract all the formatted numbers (both social security and phone) from the text below." ] }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['876-93-2289', '(847)789-0984', '098-32-5295', '(987)222-0901']\n" + ] + } + ], + "source": [ + "res=re.findall('\\d+-\\d+-\\d+|\\(\\d+\\)\\d+-\\d+', text)\n", + "print (res)" + ] + }, { "cell_type": "code", "execution_count": null, @@ -349,7 +521,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.0" + "version": "3.7.7" } }, "nbformat": 4, diff --git a/module-1/lab-bash/.DS_Store b/module-1/lab-bash/.DS_Store index e95cef0..db26e10 100644 Binary files a/module-1/lab-bash/.DS_Store and b/module-1/lab-bash/.DS_Store differ diff --git a/module-1/lab-data-vikings/vikingsClases2.py b/module-1/lab-data-vikings/vikingsClases2.py new file mode 100644 index 0000000..805c93c --- /dev/null +++ b/module-1/lab-data-vikings/vikingsClases2.py @@ -0,0 +1,84 @@ +import random +​ +# Soldier +​ +​ +class Soldier: + def __init__(self, health, strength): + self.health=health + self.strength=strength + def attack (self): + + return self.strength + def receiveDamage(self,thedamage): + self.health=self.health-thedamage +​ +vikingArmy.append(int(viking)) + +​ +# Viking +​ +​ +class Viking(Soldier): + def __init__(self,name, health, strength): + self.name=name + self.health=health + self.strength=strength + def receiveDamage (self,thedamage): + self.health=self.health-thedamage + if self.health >= 1: + return str(self.name) + " has received " + str(thedamage) + " points of damage" + elif self.health == 0: + return str(self.name) + " has died in act of combat" + def battleCry(self): + return "Odin Owns You All!" +​ +​ +​ + +​ +# Saxon +​ +​ +class Saxon(Soldier): + def __init__(self,health, strength): + self.health=health + self.strength=strength + def receiveDamage (self,thedamage): + self.health=self.health-thedamage + if self.health >= 1: + return "A Saxon has received " + str(thedamage) + " points of damage" + elif self.health == 0: + return "A Saxon has died in combat" + +​ +# War +​ +​ +class War(): + def __init__(self): + vikingArmy=0 + saxonArmy=0 + + def addViking(self,viking): + vikingArmy+=viking + def addSaxon(self,saxon): + saxonArmy+=saxon + def vikingAttack(self): + saxran=random.choice(saxonArmy) + saxran1=Saxon(saxran) + strenvik=Viking() + strenvik.strength() + saxran1.receiveDamage(strenvik.strength()) + +​ +​ + +​ +​ +​ +​ + +​ + +Collapse diff --git a/module-1/lab-resolving-git-conflicts/.DS_Store b/module-1/lab-resolving-git-conflicts/.DS_Store index 045803a..e320aa4 100644 Binary files a/module-1/lab-resolving-git-conflicts/.DS_Store and b/module-1/lab-resolving-git-conflicts/.DS_Store differ diff --git a/module-1/lab-resolving-git-conflicts/your-code/about-me.md b/module-1/lab-resolving-git-conflicts/your-code/about-me.md index 30a999d..e8767e6 100755 --- a/module-1/lab-resolving-git-conflicts/your-code/about-me.md +++ b/module-1/lab-resolving-git-conflicts/your-code/about-me.md @@ -5,3 +5,5 @@ Ut porttitor iaculis tellus bibendum euismod. Morbi porta, ante nec tempus porta Suspendisse ut malesuada ex. Nulla ultricies nisl et nisi rhoncus sollicitudin. Vestibulum maximus iaculis ligula, nec commodo nunc ullamcorper nec. Duis quis condimentum sapien. Cras vestibulum interdum felis eu auctor. Quisque semper, magna at dapibus faucibus, felis risus semper ligula, id aliquam lectus ligula vel nisi. In hac habitasse platea dictumst. Donec arcu sapien, suscipit ac dictum et, imperdiet id tortor. Maecenas ornare sodales interdum. Mauris dictum felis eu eros vestibulum cursus. Phasellus accumsan, turpis ut malesuada sollicitudin, augue leo venenatis ante, vel convallis tellus diam sit amet lacus. Aenean eu mauris eros. Praesent ante lacus, gravida sit amet tellus nec, laoreet ultrices lacus. Integer commodo semper vestibulum. Fusce felis massa, consectetur facilisis rutrum nec, pulvinar et nisi. Morbi fermentum ultricies tortor, vehicula ultrices eros elementum a. Duis ornare aliquam facilisis. Proin aliquam tincidunt odio vitae dignissim. Sed malesuada lacinia massa, nec blandit urna auctor elementum. Duis auctor non tortor in consequat. Mauris id vestibulum risus. In eget erat sed lacus efficitur viverra sed eu est. Aliquam interdum consequat molestie. Aliquam metus nisi, blandit non semper ut, blandit vel leo. Cras dictum turpis erat, sed iaculis ligula facilisis dapibus. Aliquam posuere dignissim fermentum. Praesent at neque sit amet lectus ornare iaculis. Curabitur id urna quis lorem varius ultrices eu sit amet sapien. Curabitur maximus volutpat suscipit. Proin imperdiet elementum lacus a eleifend. Sed tempor lacus posuere diam vehicula iaculis. + +I also like ferrets diff --git a/module-1/pandas-project/.DS_Store b/module-1/pandas-project/.DS_Store index 75fc8fe..78b0611 100644 Binary files a/module-1/pandas-project/.DS_Store and b/module-1/pandas-project/.DS_Store differ diff --git a/module-1/python-project/.DS_Store b/module-1/python-project/.DS_Store new file mode 100644 index 0000000..e73d7cc Binary files /dev/null and b/module-1/python-project/.DS_Store differ diff --git a/module-1/python-project/your-code/Horcado-jp-pt.py b/module-1/python-project/your-code/Horcado-jp-pt.py new file mode 100644 index 0000000..d0b4170 --- /dev/null +++ b/module-1/python-project/your-code/Horcado-jp-pt.py @@ -0,0 +1,214 @@ +# Importa random para escoger una palabra al aleatorea. +import random +import sys +sys.getdefaultencoding() +'utf-8' +# Mis graficos mejorados de ASCII a Emoji porque pues millenial. +# Los apostrofes son para imprimir la etapa del juego. +HORCADOEMOJI = [''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 🏾🏾 + 🏿🏿 + 🏾🏾 + 🏿🏿 +👼🟫👼🟫👼🟫👼''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😓 🏾🏾 + 🏿🏿 + 🏾🏾 + 🏿🏿 +🟫👽🟫👽🟫👽🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😰 🏾🏾 + 🟡 🏿🏿 + 🏾🏾 + 🏿🏿 +👹🟫👹🟫👹🟫👹''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😭 🏾🏾 +🤚🟡 🏿🏿 + 🏾🏾 + 🏿🏿 +🟫👻🟫👻🟫👻🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😰 🏾🏾 +🤚🟡🤚 🏿🏿 + 🏾🏾 + 🏿🏿 +🟫😈🟫😈🟫😈🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😬 🏾🏾 +🤚🟡🤚 🏿🏿 +🦶 🏾🏾 + 🏿🏿 +🧨🧨🧨🧨🧨🟫🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏾💀 + 🔽 💀🏿 + 💀 🏾💀 + 💀🏿 + 🏾💀 +🔥🔥🔥🔥🔥💀🏿'''] +# diccionario con 4 catergorias. Me gustaría cambiarlo por algo mas interesante +palabras = {'Animales':'hormiga chango tejon murcielago oso castor camello \ + gato ostra cobra tigre coyote cuervo venado perro \ + burro pato aguila huron zorro rana cabra ganso hacon \ + leon lagartija llama topo simio alce raton mula nutria \ + buho panda cotorro paloma piton conejo carnero rata \ + rinoceronte salmon foca tiburon chivo zorrillo vibora \ + araña cisne guajolote ballena lobo wombat zebra'.split(), + 'Formas':'cuadro triangulo rectangulo circulo elipse rombo \ + trapezoide pentagon hexagono septagono octogono'.split(), + '果物・くだもの':'りんご オレンジ ライム レモン なし スイカ ぶどう グレープフルーツ \ + cereza platano mango fresa'.split(), + '色・いろ':'あか オレンジ きいろ みどり あおい むらさき しろ \ + くろ ちゃいろ'.split(), + 'Colores':'rojo naranja amarillo verde azul morado blanco \ + negro cafe'.split()} +# Esta función genera una palabra aleatorea del diccionario: palabraKey +# despues obtiene el index de la palabra seleccionada +# regresa tanto la palabra como su index +def palabraAletorea(DictPalabras): + palabraKey = random.choice(list(DictPalabras.keys())) + palabraIndex = random.randint(0, len(DictPalabras[palabraKey]) - 1) + return [DictPalabras[palabraKey][palabraIndex], palabraKey] + +# Visualización del tablero del juego, donde imprime tanto los graficos de Emoji +# y el estado del juego segun las letras equivocadas, correctas, y por adivinar +def tablero(HORCADOEMOJI, letrasequivocadas, letrascorrectas, palabrasecreta): + print(HORCADOEMOJI[len(letrasequivocadas)]) + print() + + print('Equivocaciones:', end=' ') + for palabra in letrasequivocadas: + print(palabra, end=' ') + print() + + vacios = '_' * len(palabrasecreta) + + for i in range(len(palabrasecreta)): + if palabrasecreta[i] in letrascorrectas: + vacios = vacios[:i] + palabrasecreta[i] + vacios[i+1:] + + for palabra in vacios: + print(palabra, end=' ') + print() + +# Esta función funciona como input del juego. Toma una palabra y la convierte +# en minusculas y comprueba que solo sea una letra. También comprueba que +# si la letra ya fue usada o no. También comprueba que esa letra esta en el +# abecedario y que no sea un número. +def adivina(adivinadas): + while True: + print('Venga, adivina una letra, sin miedo:👾👾👾') + adivinar = str(input()) + adivinar = adivinar.lower() + if len(adivinar) != 1: + print('Vamos alegre, te dije solo UNA letra...UNA, ONE, HITOTSU, Uma') + elif adivinar in adivinadas: + print('Perooo que pashaaaaaa!!!!, esa letra ya la escogiste.🔡') + elif adivinar not in 'abcdefghijklmnñopqrstuvwxyz': + print('Vamos alegre, que te digo una LETRA, 🔤') + else: + return adivinar + +# Esta función es para darle continuidad al juego, que realmente con cualquier +# letra que no sea s el programa termina. +def playAgain(): + print('¿Te gustaría jugar nuevamente? (si[S] or no[N])') + return input().lower().startswith('s') + +# Mi super banner con ASCII art pense hacer las graficas con la misma tematica +# para las etapas del horcado pero escogí Emoji. Para la version 2.0 +print(""" +╔╗▒╔╗▒▒▒▒▒▒▒▒▒▒▒▒╔╗▒▒▒ +║║▒║║▒▒▒▒▒▒▒▒▒▒▒▒║║▒▒▒ +║╚═╝╠══╦═╦══╦══╦═╝╠══╗ +║╔═╗║╔╗║╔╣╔═╣╔╗║╔╗║╔╗║ +║║▒║║╚╝║║║╚═╣╔╗║╚╝║╚╝║ +╚╝▒╚╩══╩╝╚══╩╝╚╩══╩══╝ +\n +╔╦╗▒▒╔╗▒▒▒╔╗▒▒▒▒▒▒▒▒▒▒▒▒▒╔╗╔╦╗▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ +║╔╬═╗║╚╦═╗║╠╦═╗╔═╦╦═╗▒╔╦╗║╚╝╠╬╦╦═╗╔═╦═╗╔═╦╦═╗▒ +║╚╣╬╚╣╔╣╬╚╣═╣╬╚╣║║║╬╚╗║║║║╔╗║║╔╣╬╚╣╬║╬╚╣║║║╬╚╗ +╚╩╩══╩═╩══╩╩╩══╩╩═╩══╝╠╗║╚╝╚╩╩╝╚══╬╗╠══╩╩═╩══╝ +▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╚═╝▒▒▒▒▒▒▒▒▒╚═╝▒▒▒▒▒▒▒▒▒ + +\n +╔╗▒▒▒▒╔═╗▒▒╔╦╗▒▒▒▒▒╔══╗▒▒▒▒▒▒▒╔╗▒ +║╚╦╦╦╗║╔╬═╦╝╠╬═╦╦═╗║═╦╬═╦╦╦╦╦═╣╚╗ +║╬║║╠╣║╚╣╬║╬║║║║║╬║║╔╝║╩╣╔╣╔╣╩╣╔╣ +╚═╬╗╠╝╚═╩═╩═╩╩╩═╬╗║╚╝▒╚═╩╝╚╝╚═╩═╝ +▒▒╚═╝▒▒▒▒▒▒▒▒▒▒▒╚═╝▒▒▒▒▒▒▒▒▒▒▒▒▒▒ +\n +Tu aventura aprendiendo Japonés comienza aprendiendo los dos alfabetos básicos:\n +Hiragana (ひらがな) y Katakana (カタカナ)\ +Para perfeccionar tu lectura y rápidez usaremos el viejo juego del horcado.\n +Venga, que con un par de juegos por día veráz resultados muy buenos. \ + + +""") + +# reset para cuando el juego comienza nuevamente +letrasequivocadas = '' +letrascorrectas = '' +palabrasecreta, secretoKey = palabraAletorea(palabras) +finJuego = False + +# Mientras el juego esta activo: Imprime la categoria del diccionario así como +# la funcion del tablero que hace la Visualización del estado del juego. Llama +# a la función que controla el input del jugador junto con sus comprobaciones. +# Con esto actualiza las letras correctas y vuelve a llamar la función. +# Tiene una variable para controlar si hayo todas las letras y finaliza el juego +# sino actualiza las letras equivocadas. Si el numero de letras equivocadas es +# igual a la longitud del emoji imprime el tablero eso quiero decir que fallo +# 6 veces y termina el juego con un status de los aciertos y equivocaciones +# y le muestra al jugador la palabra correcta. +# En este punto se llama a la funcion del fin del juego y se hace reset a todas +# las variables para el siguiente juego. + +#TL;DR Basicamente el curpo y cerebro del juego. +while True: + print('La categoria es: ' + secretoKey) + print('La palabra es: ' + palabrasecreta) + tablero(HORCADOEMOJI, letrasequivocadas, letrascorrectas, palabrasecreta) + adivinar = adivina(letrasequivocadas + letrascorrectas) + + if adivinar in palabrasecreta: + letrascorrectas = letrascorrectas + adivinar + encontroTodasLetras = True + for i in range(len(palabrasecreta)): + if palabrasecreta[i] not in letrascorrectas: + encontroTodasLetras = False + break + if encontroTodasLetras: + print('Siiiii! La palabra secreta es: "' + palabrasecreta + '"! Haz ganado!') + finJuego = True + else: + letrasequivocadas = letrasequivocadas + adivinar + if len(letrasequivocadas) == len(HORCADOEMOJI) - 1: + tablero(HORCADOEMOJI, letrasequivocadas, letrascorrectas, palabrasecreta) + print('Se te han acabado las oportunidades para adivinar!\nDespues de ' + str(len(letrasequivocadas)) + ' equivocacione(s) y ' + str(len(letrascorrectas)) + ' intentos correctos, la palabra era: "' + palabrasecreta + '"') + finJuego = True + + if finJuego: + if playAgain(): + letrasequivocadas = '' + letrascorrectas = '' + finJuego = False + palabrasecreta, secretoKey = palabraAletorea(palabras) + else: + break diff --git a/module-1/python-project/your-code/Horcado.py b/module-1/python-project/your-code/Horcado.py new file mode 100644 index 0000000..3469e99 --- /dev/null +++ b/module-1/python-project/your-code/Horcado.py @@ -0,0 +1,196 @@ +# Importa random para escoger una palabra al aleatorea. +import random +# Mis graficos mejorados de ASCII a Emoji porque pues millenial. +# Los apostrofes son para imprimir la etapa del juego. +HORCADOEMOJI = [''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 🏾🏾 + 🏿🏿 + 🏾🏾 + 🏿🏿 +👼🟫👼🟫👼🟫👼''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😓 🏾🏾 + 🏿🏿 + 🏾🏾 + 🏿🏿 +🟫👽🟫👽🟫👽🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😰 🏾🏾 + 🟡 🏿🏿 + 🏾🏾 + 🏿🏿 +👹🟫👹🟫👹🟫👹''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😭 🏾🏾 +🤚🟡 🏿🏿 + 🏾🏾 + 🏿🏿 +🟫👻🟫👻🟫👻🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😰 🏾🏾 +🤚🟡🤚 🏿🏿 + 🏾🏾 + 🏿🏿 +🟫😈🟫😈🟫😈🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏿🏿 + 😬 🏾🏾 +🤚🟡🤚 🏿🏿 +🦶 🏾🏾 + 🏿🏿 +🧨🧨🧨🧨🧨🟫🟫''', ''' + + ➕➖➖➖➖➕ + 🔽 🏾💀 + 🔽 💀🏿 + 💀 🏾💀 + 💀🏿 + 🏾💀 +🔥🔥🔥🔥🔥💀🏿'''] +# diccionario con 4 catergorias. Me gustaría cambiarlo por algo mas interesante +palabras = {'Animales':'hormiga chango tejon murcielago oso castor camello \ + gato ostra cobra tigre coyote cuervo venado perro \ + burro pato aguila huron zorro rana cabra ganso hacon \ + leon lagartija llama topo simio alce raton mula nutria \ + buho panda cotorro paloma piton conejo carnero rata \ + rinoceronte salmon foca tiburon chivo zorrillo vibora \ + araña cisne guajolote ballena lobo wombat zebra'.split(), + 'Formas':'cuadro triangulo rectangulo circulo elipse rombo \ + trapezoide pentagon hexagono septagono octogono'.split(), + 'Frutas':'manzana naranja limon lima pera sandia uva toronja \ + cereza platano mango fresa'.split(), + 'Colores':'rojo naranja amarillo verde azul indigo violeta blanco \ + negro marron'.split()} +# Esta función genera una palabra aleatorea del diccionario: palabraKey +# despues obtiene el index de la palabra seleccionada +# regresa tanto la palabra como su index +def palabraAletorea(DictPalabras): + palabraKey = random.choice(list(DictPalabras.keys())) + palabraIndex = random.randint(0, len(DictPalabras[palabraKey]) - 1) + return [DictPalabras[palabraKey][palabraIndex], palabraKey] + +# Visualización del tablero del juego, donde imprime tanto los graficos de Emoji +# y el estado del juego segun las letras equivocadas, correctas, y por adivinar +def tablero(HORCADOEMOJI, letrasequivocadas, letrascorrectas, palabrasecreta): + print(HORCADOEMOJI[len(letrasequivocadas)]) + print() + + print('Equivocaciones:', end=' ') + for palabra in letrasequivocadas: + print(palabra, end=' ') + print() + + vacios = '_' * len(palabrasecreta) + + for i in range(len(palabrasecreta)): + if palabrasecreta[i] in letrascorrectas: + vacios = vacios[:i] + palabrasecreta[i] + vacios[i+1:] + + for palabra in vacios: + print(palabra, end=' ') + print() + +# Esta función funciona como input del juego. Toma una palabra y la convierte +# en minusculas y comprueba que solo sea una letra. También comprueba que +# si la letra ya fue usada o no. También comprueba que esa letra esta en el +# abecedario y que no sea un número. +def adivina(adivinadas): + while True: + print('Venga, adivina una letra, sin miedo:👾👾👾') + adivinar = input() + adivinar = adivinar.lower() + if len(adivinar) != 1: + print('Vamos alegre, te dije solo UNA letra...UNA, ONE, HITOTSU, Uma') + elif adivinar in adivinadas: + print('Perooo que pashaaaaaa!!!!, esa letra ya la escogiste.🔡') + elif adivinar not in 'abcdefghijklmnñopqrstuvwxyz': + print('Vamos alegre, que te digo una LETRA, 🔤') + else: + return adivinar + +# Esta función es para darle continuidad al juego, que realmente con cualquier +# letra que no sea s el programa termina. +def playAgain(): + print('¿Te gustaría jugar nuevamente? (si[S] or no[N])') + return input().lower().startswith('s') + +# Mi super banner con ASCII art pense hacer las graficas con la misma tematica +# para las etapas del horcado pero escogí Emoji. Para la version 2.0 +print(""" +╔╗▒╔╗▒▒▒▒▒▒▒▒▒▒▒▒╔╗▒▒▒ +║║▒║║▒▒▒▒▒▒▒▒▒▒▒▒║║▒▒▒ +║╚═╝╠══╦═╦══╦══╦═╝╠══╗ +║╔═╗║╔╗║╔╣╔═╣╔╗║╔╗║╔╗║ +║║▒║║╚╝║║║╚═╣╔╗║╚╝║╚╝║ +╚╝▒╚╩══╩╝╚══╩╝╚╩══╩══╝ +\n +╔╗▒▒▒▒╔═╗▒▒╔╦╗▒▒▒▒▒╔══╗▒▒▒▒▒▒▒╔╗▒ +║╚╦╦╦╗║╔╬═╦╝╠╬═╦╦═╗║═╦╬═╦╦╦╦╦═╣╚╗ +║╬║║╠╣║╚╣╬║╬║║║║║╬║║╔╝║╩╣╔╣╔╣╩╣╔╣ +╚═╬╗╠╝╚═╩═╩═╩╩╩═╬╗║╚╝▒╚═╩╝╚╝╚═╩═╝ +▒▒╚═╝▒▒▒▒▒▒▒▒▒▒▒╚═╝▒▒▒▒▒▒▒▒▒▒▒▒▒▒ + + +""") + +# reset para cuando el juego comienza nuevamente +letrasequivocadas = '' +letrascorrectas = '' +palabrasecreta, secretoKey = palabraAletorea(palabras) +finJuego = False + +# Mientras el juego esta activo: Imprime la categoria del diccionario así como +# la funcion del tablero que hace la Visualización del estado del juego. Llama +# a la función que controla el input del jugador junto con sus comprobaciones. +# Con esto actualiza las letras correctas y vuelve a llamar la función. +# Tiene una variable para controlar si hayo todas las letras y finaliza el juego +# sino actualiza las letras equivocadas. Si el numero de letras equivocadas es +# igual a la longitud del emoji imprime el tablero eso quiero decir que fallo +# 6 veces y termina el juego con un status de los aciertos y equivocaciones +# y le muestra al jugador la palabra correcta. +# En este punto se llama a la funcion del fin del juego y se hace reset a todas +# las variables para el siguiente juego. + +#TL;DR Basicamente el curpo y cerebro del juego. +while True: + print('La categoria es: ' + secretoKey) + tablero(HORCADOEMOJI, letrasequivocadas, letrascorrectas, palabrasecreta) + adivinar = adivina(letrasequivocadas + letrascorrectas) + + if adivinar in palabrasecreta: + letrascorrectas = letrascorrectas + adivinar + encontroTodasLetras = True + for i in range(len(palabrasecreta)): + if palabrasecreta[i] not in letrascorrectas: + encontroTodasLetras = False + break + if encontroTodasLetras: + print('Siiiii! La palabra secreta es: "' + palabrasecreta + '"! Haz ganado!') + finJuego = True + else: + letrasequivocadas = letrasequivocadas + adivinar + if len(letrasequivocadas) == len(HORCADOEMOJI) - 1: + tablero(HORCADOEMOJI, letrasequivocadas, letrascorrectas, palabrasecreta) + print('Se te han acabado las oportunidades para adivinar!\nDespues de ' + str(len(letrasequivocadas)) + ' equivocacione(s) y ' + str(len(letrascorrectas)) + ' intentos correctos, la palabra era: "' + palabrasecreta + '"') + finJuego = True + + if finJuego: + if playAgain(): + letrasequivocadas = '' + letrascorrectas = '' + finJuego = False + palabrasecreta, secretoKey = palabraAletorea(palabras) + else: + break diff --git a/module-1/python-project/your-code/READme.txt b/module-1/python-project/your-code/READme.txt new file mode 100644 index 0000000..cc37614 --- /dev/null +++ b/module-1/python-project/your-code/READme.txt @@ -0,0 +1,53 @@ +╔╗▒╔╗▒▒▒▒▒▒▒▒▒▒▒▒╔╗▒▒▒ +║║▒║║▒▒▒▒▒▒▒▒▒▒▒▒║║▒▒▒ +║╚═╝╠══╦═╦══╦══╦═╝╠══╗ +║╔═╗║╔╗║╔╣╔═╣╔╗║╔╗║╔╗║ +║║▒║║╚╝║║║╚═╣╔╗║╚╝║╚╝║ +╚╝▒╚╩══╩╝╚══╩╝╚╩══╩══╝ + +╔╗▒▒▒▒╔═╗▒▒╔╦╗▒▒▒▒▒╔══╗▒▒▒▒▒▒▒╔╗▒ +║╚╦╦╦╗║╔╬═╦╝╠╬═╦╦═╗║═╦╬═╦╦╦╦╦═╣╚╗ +║╬║║╠╣║╚╣╬║╬║║║║║╬║║╔╝║╩╣╔╣╔╣╩╣╔╣ +╚═╬╗╠╝╚═╩═╩═╩╩╩═╬╗║╚╝▒╚═╩╝╚╝╚═╩═╝ +▒▒╚═╝▒▒▒▒▒▒▒▒▒▒▒╚═╝▒▒▒▒▒▒▒▒▒▒▒▒▒▒ + + + +Introducción: + +Bienvenido a mi tercer juego simple: HORCADO +Es un juego que me recuerda mi niñez por dos motivos: +1. Lo jugué en papel +2. Fue uno de los primeros juegos que pude disfrutar en una vieja PC + +El juego es muy sencillo con un toque de nostalgia y modernidad al estilo emoji, +algo así como 8 bits meets 32 bits. + +Instrucciones: +- Arranque +Para iniciar el juego simplemente en la terminal ve al directorio donde tienes el +archivo: horcado.py y escribe el siguiente comando o copia y pega en tu terminal: + +python3 horcado.py + +|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾| +| python3 horcado.py | +|____________________| + +- Modo de juego +Una vez que el juego inicia, verás las instrucciones en pantalla que te irán guiando. +Simplemente escribe una letra a la vez para adivinar la palabra dentro de la categoría que el juego te indica. +Tendrás 6 oportunidades para adivinar sino tu personaje morirá. + +Al finalizar el juego, se te preguntara si quieres continuar o no. Mas categorías en la próxima version !!!! + +Espero que disfrutes del juego y te traiga buenos recuerdos. + + +|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾| +| CODING FERRET | +|___________________| +(\__/) || +(•ㅅ•) || +/   づ +Soy un hurón, no un conejo o(>ω<)o diff --git a/module-1/web-project/.DS_Store b/module-1/web-project/.DS_Store index 36d1bcc..c78b8b9 100644 Binary files a/module-1/web-project/.DS_Store and b/module-1/web-project/.DS_Store differ diff --git a/module-1/web-scrapping-class-ex.ipynb b/module-1/web-scrapping-class-ex.ipynb new file mode 100644 index 0000000..b7292ce --- /dev/null +++ b/module-1/web-scrapping-class-ex.ipynb @@ -0,0 +1,391 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "from bs4 import BeautifulSoup as bs" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "url = 'https://es.wikipedia.org/wiki/Videoconsola'\n", + "res=requests.get(url)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "data=res.text\n", + "soup=bs(data, 'html.parser')" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
Fabricante\n", + "Consola\n", + "Lanzamiento\n", + "Unidades vendidas\n", + "
Nintendo\n", + "Nintendo DS\n", + "2 de diciembre de 2004\n", + "32,990,000[19]​\n", + "
Nintendo\n", + "Game Boy and Game Boy Color\n", + "21 de abril de 1989\n", + "32,470,000[19]​\n", + "
Nintendo\n", + "Nintendo 3DS\n", + "26 de febrero de 2011\n", + "24,700,000[19]​\n", + "
Sony\n", + "PlayStation 2\n", + "4 de marzo de 2000\n", + "21,454,325[49]​\n", + "
Nintendo\n", + "Famicom (NES)\n", + "15 de julio de 1983\n", + "19,350,000[19]​\n", + "
Nintendo\n", + "Super Famicom (Super NES)\n", + "21 de noviembre de 1990\n", + "17,170,000[19]​\n", + "
Nintendo\n", + "Game Boy Advance\n", + "21 de febrero de 2001\n", + "16,960,000[19]​\n", + "
Sony\n", + "PlayStation Portable\n", + "12 de diciembre de 2004\n", + "16,867,853[50]​\n", + "
Nintendo\n", + "Wii\n", + "2 de diciembre de 2006\n", + "12,750,000[19]​\n", + "
Nintendo\n", + "Nintendo Switch\n", + "3 de marzo de 2017\n", + "Más de 10,000,000\n", + "
NEC\n", + "PC Engine (TurboGrafx-16)\n", + "30 de octubre de 1987\n", + "8,000,000[51]​\n", + "
Sony\n", + "PlayStation 4\n", + "22 de febrero de 2014\n", + "8,506,964[52]​\n", + "
Sony\n", + "PlayStation Vita\n", + "17 de diciembre de 2011\n", + "5,643,626[52]​\n", + "
Nintendo\n", + "Nintendo 64\n", + "23 de junio de 1996\n", + "5,540,000[19]​\n", + "
Sega\n", + "Sega Saturn\n", + "22 de noviembre de 1994\n", + "5,000,000[cita requerida]\n", + "
Nintendo\n", + "Nintendo Switch\n", + "3 de marzo de 2017\n", + "4,380,000[19]​\n", + "
Nintendo\n", + "Nintendo GameCube\n", + "14 de septiembre de 2001\n", + "4,040,000[19]​\n", + "
Sega\n", + "Mega Drive\n", + "29 de octubre de 1988\n", + "3,580,000[53]​\n", + "
Nintendo\n", + "Wii U\n", + "8 de diciembre de 2012\n", + "3,340,000[19]​\n", + "
Sega\n", + "Dreamcast\n", + "27 de noviembre de 1998\n", + "2,320,000[54]​\n", + "
Microsoft\n", + "Xbox 360\n", + "10 de diciembre de 2005\n", + "1,448,665[50]​\n", + "
Sega\n", + "Sega Mark III (Master System)\n", + "20 de octubre de 1985\n", + "1,000,000[55]​\n", + "
Microsoft\n", + "Xbox One\n", + "4 de septiembre de 2014\n", + "87,592[52]​\n", + "
" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tables=soup.find_all('table')\n", + "japon=soup.find_all('table')[-5]\n", + "japon" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Nintendo'" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "elem=ultima.find_all('a')[0].text\n", + "elem" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'NoneType' object has no attribute 'text'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;31m# print(fila)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfila\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m>\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m fabricante={'Consola': fila[0].find('a').text.strip(),\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0;34m'Lanzamiento'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfila\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m 'Unidades vendidas':(fila[3].text),}\n", + "\u001b[0;31mAttributeError\u001b[0m: 'NoneType' object has no attribute 'text'" + ] + } + ], + "source": [ + "ventas_japon=[]\n", + "\n", + "for f in japon.find_all('tr'): # lista de filas de la tabla\n", + " fila=[e for e in f.find_all('td')] # elementos dentro de la fila\n", + "# print(fila)\n", + " if len(fila)>0:\n", + " fabricante={'Consola': fila[0].find('a').text.strip(),\n", + " 'Lanzamiento':(fila[1].text),\n", + " 'Unidades vendidas':(fila[3].text),}\n", + " ventas_japon.append(fabricante)\n", + " \n", + "ventas_japon" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Game Boy\n" + ] + } + ], + "source": [ + "print(fila[1].find('a')) " + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[Nintendo\n", + ", Game Boy and Game Boy Color\n", + ", 21 de abril de 1989\n", + ", 32,470,000[19]​\n", + "]\n" + ] + } + ], + "source": [ + "print(fila)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.7.7" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/module-2/.DS_Store b/module-2/.DS_Store index b08810b..8c1ae77 100644 Binary files a/module-2/.DS_Store and b/module-2/.DS_Store differ diff --git a/module-2/lab-ufo/.ipynb_checkpoints/ufos-checkpoint.ipynb b/module-2/lab-ufo/.ipynb_checkpoints/ufos-checkpoint.ipynb index f539d1a..a8925eb 100644 --- a/module-2/lab-ufo/.ipynb_checkpoints/ufos-checkpoint.ipynb +++ b/module-2/lab-ufo/.ipynb_checkpoints/ufos-checkpoint.ipynb @@ -18,39 +18,415 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ - "# Import libraries" + "import pandas as pd\n", + "import numpy as np\n", + "import folium\n", + "from folium.plugins import HeatMapWithTime as HMWT\n", + "from folium.plugins import HeatMap as HM" ] }, { "cell_type": "code", - "execution_count": null, + "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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Unnamed: 0datetimecitystatecountryshapedurationtotal_timecommentsdate_postedlatitudelongitudeyeardistance
0010/10/1949 20:30san marcostxuscylinder2700.045 minutesThis event took place in early fall around 194...4/27/200429.883056-97.94111120041242.667772
3310/10/1956 21:00ednatxuscircle20.01/2 hourMy older brother and twin sister were leaving ...1/17/200428.978333-96.64583320041211.971352
4410/10/1960 20:00kaneohehiuslight900.015 minutesAS a Marine 1st Lt. flying an FJ4B fighter/att...1/22/200421.418056-157.80361120046960.923396
5510/10/1961 19:00bristoltnussphere300.05 minutesMy father is now 89 my brother 52 the girl wit...4/27/200736.595000-82.1888892007427.334113
7710/10/1965 23:45norwalkctusdisk1200.020 minutesA bright orange color changing to reddish colo...10/2/199941.117500-73.40833319991295.827792
\n", + "
" + ], + "text/plain": [ + " Unnamed: 0 datetime city state country shape duration \\\n", + "0 0 10/10/1949 20:30 san marcos tx us cylinder 2700.0 \n", + "3 3 10/10/1956 21:00 edna tx us circle 20.0 \n", + "4 4 10/10/1960 20:00 kaneohe hi us light 900.0 \n", + "5 5 10/10/1961 19:00 bristol tn us sphere 300.0 \n", + "7 7 10/10/1965 23:45 norwalk ct us disk 1200.0 \n", + "\n", + " total_time comments date_posted \\\n", + "0 45 minutes This event took place in early fall around 194... 4/27/2004 \n", + "3 1/2 hour My older brother and twin sister were leaving ... 1/17/2004 \n", + "4 15 minutes AS a Marine 1st Lt. flying an FJ4B fighter/att... 1/22/2004 \n", + "5 5 minutes My father is now 89 my brother 52 the girl wit... 4/27/2007 \n", + "7 20 minutes A bright orange color changing to reddish colo... 10/2/1999 \n", + "\n", + " latitude longitude year distance \n", + "0 29.883056 -97.941111 2004 1242.667772 \n", + "3 28.978333 -96.645833 2004 1211.971352 \n", + "4 21.418056 -157.803611 2004 6960.923396 \n", + "5 36.595000 -82.188889 2007 427.334113 \n", + "7 41.117500 -73.408333 1999 1295.827792 " + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ufo = pd.read_csv(\"ufo.csv\")\n", + "ufo =df.dropna()\n", + "ufo.head(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ - "# Import data" + "ufo1=ufo.loc[ufo['country'] == 'us']" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ - "# Select data" + "ufo2=ufo1.loc[ufo1['year'] >= 2004]" ] }, { "cell_type": "code", - "execution_count": null, + "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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Unnamed: 0datetimecitystatecountryshapedurationtotal_timecommentsdate_postedlatitudelongitudeyeardistance
0010/10/1949 20:30san marcostxuscylinder2700.045 minutesThis event took place in early fall around 194...4/27/200429.883056-97.94111120041242.667772
3310/10/1956 21:00ednatxuscircle20.01/2 hourMy older brother and twin sister were leaving ...1/17/200428.978333-96.64583320041211.971352
4410/10/1960 20:00kaneohehiuslight900.015 minutesAS a Marine 1st Lt. flying an FJ4B fighter/att...1/22/200421.418056-157.80361120046960.923396
5510/10/1961 19:00bristoltnussphere300.05 minutesMy father is now 89 my brother 52 the girl wit...4/27/200736.595000-82.1888892007427.334113
8910/10/1966 21:00live oakflusdisk120.0several minutesSaucer zaps energy from powerline as my pregna...5/11/200530.294722-82.9841672005749.440164
\n", + "
" + ], + "text/plain": [ + " Unnamed: 0 datetime city state country shape duration \\\n", + "0 0 10/10/1949 20:30 san marcos tx us cylinder 2700.0 \n", + "3 3 10/10/1956 21:00 edna tx us circle 20.0 \n", + "4 4 10/10/1960 20:00 kaneohe hi us light 900.0 \n", + "5 5 10/10/1961 19:00 bristol tn us sphere 300.0 \n", + "8 9 10/10/1966 21:00 live oak fl us disk 120.0 \n", + "\n", + " total_time comments \\\n", + "0 45 minutes This event took place in early fall around 194... \n", + "3 1/2 hour My older brother and twin sister were leaving ... \n", + "4 15 minutes AS a Marine 1st Lt. flying an FJ4B fighter/att... \n", + "5 5 minutes My father is now 89 my brother 52 the girl wit... \n", + "8 several minutes Saucer zaps energy from powerline as my pregna... \n", + "\n", + " date_posted latitude longitude year distance \n", + "0 4/27/2004 29.883056 -97.941111 2004 1242.667772 \n", + "3 1/17/2004 28.978333 -96.645833 2004 1211.971352 \n", + "4 1/22/2004 21.418056 -157.803611 2004 6960.923396 \n", + "5 4/27/2007 36.595000 -82.188889 2007 427.334113 \n", + "8 5/11/2005 30.294722 -82.984167 2005 749.440164 " + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ufo2.head(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ - "# Find the city" + "def generateBaseMap(default_location=[36.1627, -86.7816], default_zoom_start=6):\n", + " \n", + " base_map = folium.Map(location=default_location, \n", + " control_scale=True, \n", + " zoom_start=default_zoom_start)\n", + " \n", + " return base_map" ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "base_map = generateBaseMap() # crea mapa\n", + "\n", + "HM(data=ufo2[['latitude', 'longitude']]).add_to(base_map) # pon los datos en heatmap\n", + "\n", + "base_map.save('base_map.html') # guarda\n", + "\n", + "base_map # representa" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -69,7 +445,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.7.7" } }, "nbformat": 4, diff --git a/module-2/lab-ufo/base_map.html b/module-2/lab-ufo/base_map.html new file mode 100644 index 0000000..ae06c80 --- /dev/null +++ b/module-2/lab-ufo/base_map.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/module-2/lab-ufo/ufos.ipynb b/module-2/lab-ufo/ufos.ipynb index f539d1a..a8925eb 100644 --- a/module-2/lab-ufo/ufos.ipynb +++ b/module-2/lab-ufo/ufos.ipynb @@ -18,39 +18,415 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ - "# Import libraries" + "import pandas as pd\n", + "import numpy as np\n", + "import folium\n", + "from folium.plugins import HeatMapWithTime as HMWT\n", + "from folium.plugins import HeatMap as HM" ] }, { "cell_type": "code", - "execution_count": null, + "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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Unnamed: 0datetimecitystatecountryshapedurationtotal_timecommentsdate_postedlatitudelongitudeyeardistance
0010/10/1949 20:30san marcostxuscylinder2700.045 minutesThis event took place in early fall around 194...4/27/200429.883056-97.94111120041242.667772
3310/10/1956 21:00ednatxuscircle20.01/2 hourMy older brother and twin sister were leaving ...1/17/200428.978333-96.64583320041211.971352
4410/10/1960 20:00kaneohehiuslight900.015 minutesAS a Marine 1st Lt. flying an FJ4B fighter/att...1/22/200421.418056-157.80361120046960.923396
5510/10/1961 19:00bristoltnussphere300.05 minutesMy father is now 89 my brother 52 the girl wit...4/27/200736.595000-82.1888892007427.334113
7710/10/1965 23:45norwalkctusdisk1200.020 minutesA bright orange color changing to reddish colo...10/2/199941.117500-73.40833319991295.827792
\n", + "
" + ], + "text/plain": [ + " Unnamed: 0 datetime city state country shape duration \\\n", + "0 0 10/10/1949 20:30 san marcos tx us cylinder 2700.0 \n", + "3 3 10/10/1956 21:00 edna tx us circle 20.0 \n", + "4 4 10/10/1960 20:00 kaneohe hi us light 900.0 \n", + "5 5 10/10/1961 19:00 bristol tn us sphere 300.0 \n", + "7 7 10/10/1965 23:45 norwalk ct us disk 1200.0 \n", + "\n", + " total_time comments date_posted \\\n", + "0 45 minutes This event took place in early fall around 194... 4/27/2004 \n", + "3 1/2 hour My older brother and twin sister were leaving ... 1/17/2004 \n", + "4 15 minutes AS a Marine 1st Lt. flying an FJ4B fighter/att... 1/22/2004 \n", + "5 5 minutes My father is now 89 my brother 52 the girl wit... 4/27/2007 \n", + "7 20 minutes A bright orange color changing to reddish colo... 10/2/1999 \n", + "\n", + " latitude longitude year distance \n", + "0 29.883056 -97.941111 2004 1242.667772 \n", + "3 28.978333 -96.645833 2004 1211.971352 \n", + "4 21.418056 -157.803611 2004 6960.923396 \n", + "5 36.595000 -82.188889 2007 427.334113 \n", + "7 41.117500 -73.408333 1999 1295.827792 " + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ufo = pd.read_csv(\"ufo.csv\")\n", + "ufo =df.dropna()\n", + "ufo.head(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ - "# Import data" + "ufo1=ufo.loc[ufo['country'] == 'us']" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ - "# Select data" + "ufo2=ufo1.loc[ufo1['year'] >= 2004]" ] }, { "cell_type": "code", - "execution_count": null, + "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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Unnamed: 0datetimecitystatecountryshapedurationtotal_timecommentsdate_postedlatitudelongitudeyeardistance
0010/10/1949 20:30san marcostxuscylinder2700.045 minutesThis event took place in early fall around 194...4/27/200429.883056-97.94111120041242.667772
3310/10/1956 21:00ednatxuscircle20.01/2 hourMy older brother and twin sister were leaving ...1/17/200428.978333-96.64583320041211.971352
4410/10/1960 20:00kaneohehiuslight900.015 minutesAS a Marine 1st Lt. flying an FJ4B fighter/att...1/22/200421.418056-157.80361120046960.923396
5510/10/1961 19:00bristoltnussphere300.05 minutesMy father is now 89 my brother 52 the girl wit...4/27/200736.595000-82.1888892007427.334113
8910/10/1966 21:00live oakflusdisk120.0several minutesSaucer zaps energy from powerline as my pregna...5/11/200530.294722-82.9841672005749.440164
\n", + "
" + ], + "text/plain": [ + " Unnamed: 0 datetime city state country shape duration \\\n", + "0 0 10/10/1949 20:30 san marcos tx us cylinder 2700.0 \n", + "3 3 10/10/1956 21:00 edna tx us circle 20.0 \n", + "4 4 10/10/1960 20:00 kaneohe hi us light 900.0 \n", + "5 5 10/10/1961 19:00 bristol tn us sphere 300.0 \n", + "8 9 10/10/1966 21:00 live oak fl us disk 120.0 \n", + "\n", + " total_time comments \\\n", + "0 45 minutes This event took place in early fall around 194... \n", + "3 1/2 hour My older brother and twin sister were leaving ... \n", + "4 15 minutes AS a Marine 1st Lt. flying an FJ4B fighter/att... \n", + "5 5 minutes My father is now 89 my brother 52 the girl wit... \n", + "8 several minutes Saucer zaps energy from powerline as my pregna... \n", + "\n", + " date_posted latitude longitude year distance \n", + "0 4/27/2004 29.883056 -97.941111 2004 1242.667772 \n", + "3 1/17/2004 28.978333 -96.645833 2004 1211.971352 \n", + "4 1/22/2004 21.418056 -157.803611 2004 6960.923396 \n", + "5 4/27/2007 36.595000 -82.188889 2007 427.334113 \n", + "8 5/11/2005 30.294722 -82.984167 2005 749.440164 " + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ufo2.head(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ - "# Find the city" + "def generateBaseMap(default_location=[36.1627, -86.7816], default_zoom_start=6):\n", + " \n", + " base_map = folium.Map(location=default_location, \n", + " control_scale=True, \n", + " zoom_start=default_zoom_start)\n", + " \n", + " return base_map" ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "base_map = generateBaseMap() # crea mapa\n", + "\n", + "HM(data=ufo2[['latitude', 'longitude']]).add_to(base_map) # pon los datos en heatmap\n", + "\n", + "base_map.save('base_map.html') # guarda\n", + "\n", + "base_map # representa" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -69,7 +445,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.7.7" } }, "nbformat": 4, diff --git a/module-2/python-bi-project/.DS_Store b/module-2/python-bi-project/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/module-2/python-bi-project/.DS_Store differ diff --git a/module-2/python-bi-project/.ipynb_checkpoints/1. Mongo query's - Funnel -checkpoint.ipynb b/module-2/python-bi-project/.ipynb_checkpoints/1. Mongo query's - Funnel -checkpoint.ipynb new file mode 100644 index 0000000..e0cb925 --- /dev/null +++ b/module-2/python-bi-project/.ipynb_checkpoints/1. Mongo query's - Funnel -checkpoint.ipynb @@ -0,0 +1,2655 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python-bi-project" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Mongo query's - Funnel " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Testing Area & Steps Definition" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from pymongo import MongoClient\n", + "import pymongo\n", + "import pandas as pd\n", + "cliente=pymongo.MongoClient()\n", + "db=cliente.Companies\n", + "from pandas.io.json import json_normalize" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Companies', 'admin', 'config', 'local']" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cliente.list_database_names()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "colec=db.Companies" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Companies']" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "db.list_collection_names()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "#list(colec.find().limit(2))" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# 1.testing query\n", + "seattle = list(colec.find({'$and':[{'offices.city': 'Seattle'},{'offices.state_code': 'WA'}]},\\\n", + " {'name':1, 'offices.city':1, '_id':0, 'offices.latitude':1, 'offices.longitude':1}))\n", + "\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'name': 'Wetpaint',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603122,\n", + " 'longitude': -122.333253},\n", + " {'city': 'New York', 'latitude': 40.7237306, 'longitude': -73.9964312}]},\n", + " {'name': 'Google',\n", + " 'offices': [{'city': 'Mountain View',\n", + " 'latitude': 37.421972,\n", + " 'longitude': -122.084143},\n", + " {'city': 'Ann Arbor', 'latitude': 42.280988, 'longitude': -83.748882},\n", + " {'city': 'Atlanta', 'latitude': 33.781466, 'longitude': -84.387519},\n", + " {'city': 'Austin', 'latitude': 30.351416, 'longitude': -97.751382},\n", + " {'city': 'Boulder', 'latitude': 40.021416, 'longitude': -105.260931},\n", + " {'city': 'Cambridge', 'latitude': 42.36305, 'longitude': -71.087478},\n", + " {'city': 'Chicago', 'latitude': 41.889474, 'longitude': -87.628912},\n", + " {'city': 'Coppell', 'latitude': 32.981465, 'longitude': -97.018196},\n", + " {'city': 'Dallas', 'latitude': 32.809161, 'longitude': -96.807693},\n", + " {'city': 'Denver', 'latitude': 39.62919, 'longitude': -104.898419},\n", + " {'city': 'Birmingham', 'latitude': 42.547807, 'longitude': -83.215498},\n", + " {'city': 'Irvine', 'latitude': 33.658331, 'longitude': -117.861817},\n", + " {'city': 'Kirkland', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': 40.74222, 'longitude': -74.004489},\n", + " {'city': 'Tempe', 'latitude': 33.411898, 'longitude': -111.926263},\n", + " {'city': 'Pittsburgh', 'latitude': 40.444528, 'longitude': -79.946269},\n", + " {'city': 'San Francisco', 'latitude': 37.789803, 'longitude': -122.389757},\n", + " {'city': 'Santa Monica', 'latitude': 34.019282, 'longitude': -118.494288},\n", + " {'city': 'Seattle', 'latitude': 47.675326, 'longitude': -122.351397},\n", + " {'city': 'Seattle', 'latitude': 47.649701, 'longitude': -122.350592},\n", + " {'city': 'Washington', 'latitude': 38.901113, 'longitude': -77.027101},\n", + " {'city': 'Melbourne', 'latitude': -37.879234, 'longitude': 145.073608},\n", + " {'city': 'Sydney', 'latitude': -34.822723, 'longitude': 138.612396},\n", + " {'city': 'Beijing', 'latitude': None, 'longitude': None},\n", + " {'city': 'Guangzhou', 'latitude': None, 'longitude': None},\n", + " {'city': 'Shanghai', 'latitude': None, 'longitude': None},\n", + " {'city': 'Central', 'latitude': None, 'longitude': None},\n", + " {'city': 'Bangalore', 'latitude': None, 'longitude': None},\n", + " {'city': 'Gurgaon', 'latitude': None, 'longitude': None},\n", + " {'city': 'New Delhi', 'latitude': 28.86999, 'longitude': 77.122261},\n", + " {'city': 'Hyderabad', 'latitude': None, 'longitude': None},\n", + " {'city': 'Mumbai', 'latitude': None, 'longitude': None},\n", + " {'city': 'Tokyo', 'latitude': None, 'longitude': None},\n", + " {'city': 'Osaka', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seoul', 'latitude': None, 'longitude': None},\n", + " {'city': 'Singapore', 'latitude': None, 'longitude': None},\n", + " {'city': 'Taipei', 'latitude': None, 'longitude': None},\n", + " {'city': '', 'latitude': 56.171882, 'longitude': 10.187799},\n", + " {'city': '', 'latitude': None, 'longitude': None},\n", + " {'city': 'Helsinki', 'latitude': None, 'longitude': None},\n", + " {'city': 'Paris', 'latitude': 48.869606, 'longitude': 2.332749},\n", + " {'city': 'Hamburg', 'latitude': 53.554052, 'longitude': 9.985266},\n", + " {'city': 'Dublin', 'latitude': 53.339914, 'longitude': -6.234424},\n", + " {'city': 'Milan', 'latitude': 45.46381, 'longitude': 9.195978},\n", + " {'city': 'Amsterdam', 'latitude': 52.337495, 'longitude': 4.871464},\n", + " {'city': 'Oslo', 'latitude': 59.915848, 'longitude': 10.741047},\n", + " {'city': 'Trondheim', 'latitude': 63.435324, 'longitude': 10.412428},\n", + " {'city': 'Kraków', 'latitude': 50.063281, 'longitude': 19.929806},\n", + " {'city': 'Wroclaw', 'latitude': 51.116574, 'longitude': 17.041942},\n", + " {'city': 'Moscow', 'latitude': None, 'longitude': None},\n", + " {'city': 'St. Petersburg', 'latitude': None, 'longitude': None},\n", + " {'city': 'Madrid', 'latitude': None, 'longitude': None},\n", + " {'city': 'Luleå', 'latitude': 65.617491, 'longitude': 22.126255},\n", + " {'city': 'Stockholm', 'latitude': 59.332344, 'longitude': 18.060162},\n", + " {'city': 'Zürich', 'latitude': 47.36554, 'longitude': 8.524864},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Manchester', 'latitude': 53.473606, 'longitude': -2.250166},\n", + " {'city': 'Montreal', 'latitude': 45.498588, 'longitude': -73.567044},\n", + " {'city': 'Toronto', 'latitude': None, 'longitude': None},\n", + " {'city': 'Waterloo', 'latitude': 43.474704, 'longitude': -80.546381},\n", + " {'city': 'Buenos Aires', 'latitude': None, 'longitude': None},\n", + " {'city': 'Sao Paulo', 'latitude': -23.590463, 'longitude': -46.681494},\n", + " {'city': 'Mexico', 'latitude': 19.507519, 'longitude': -99.030156},\n", + " {'city': 'Haifa', 'latitude': None, 'longitude': None},\n", + " {'city': 'Tel-Aviv', 'latitude': None, 'longitude': None},\n", + " {'city': 'Istanbul', 'latitude': None, 'longitude': None},\n", + " {'city': 'Dubai', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Jobster',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.617682,\n", + " 'longitude': -122.357242}]},\n", + " {'name': 'ZenZui',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Yapta',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.599925,\n", + " 'longitude': -122.334264},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Farecast',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620982,\n", + " 'longitude': -122.359397}]},\n", + " {'name': 'TripHub',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.614653,\n", + " 'longitude': -122.338793}]},\n", + " {'name': 'Newsvine',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.618599,\n", + " 'longitude': -122.358484}]},\n", + " {'name': 'iLike',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.615313,\n", + " 'longitude': -122.323408}]},\n", + " {'name': 'Redfin',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603122,\n", + " 'longitude': -122.333253}]},\n", + " {'name': 'Wishpot',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'PayScale',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5999337,\n", + " 'longitude': -122.3276962}]},\n", + " {'name': 'Amazon',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5923,\n", + " 'longitude': -122.317295}]},\n", + " {'name': 'BuddyTV',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.61968,\n", + " 'longitude': -122.356756}]},\n", + " {'name': 'Brightcove',\n", + " 'offices': [{'city': 'Cambridge',\n", + " 'latitude': 42.362993,\n", + " 'longitude': -71.086596},\n", + " {'city': 'Tokyo', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Hamburg', 'latitude': None, 'longitude': None},\n", + " {'city': 'Barcelona', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'BillMonk',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Shock Treatment Management',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.610332,\n", + " 'longitude': -122.339859}]},\n", + " {'name': 'dpreview',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 55.378051,\n", + " 'longitude': -3.435973}]},\n", + " {'name': 'GoChongo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 37.09024,\n", + " 'longitude': -95.712891}]},\n", + " {'name': 'Ripl',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Marchex',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611201,\n", + " 'longitude': -122.336825}]},\n", + " {'name': 'EyeJot',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5999337,\n", + " 'longitude': -122.3276962}]},\n", + " {'name': 'MediaPops',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611012,\n", + " 'longitude': -122.333523}]},\n", + " {'name': 'FlowPlay',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6015315,\n", + " 'longitude': -122.335943}]},\n", + " {'name': 'Avvo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6104101,\n", + " 'longitude': -122.3396627}]},\n", + " {'name': 'Zillow',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6011125,\n", + " 'longitude': -122.3293984}]},\n", + " {'name': 'Moz',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'DocuSign',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603015,\n", + " 'longitude': -122.335668}]},\n", + " {'name': 'Tioti',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.733603,\n", + " 'longitude': -122.355579},\n", + " {'city': 'London', 'latitude': 51.524323, 'longitude': -0.081169}]},\n", + " {'name': 'AdReady',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649027,\n", + " 'longitude': -122.346299}]},\n", + " {'name': 'Treemo Labs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Picnik',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.610571,\n", + " 'longitude': -122.341769}]},\n", + " {'name': 'GridNetworks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.602873,\n", + " 'longitude': -122.336132}]},\n", + " {'name': 'Pelago',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.607065,\n", + " 'longitude': -122.335373}]},\n", + " {'name': 'Faves',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603327,\n", + " 'longitude': -122.334983}]},\n", + " {'name': 'Chintano',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649788,\n", + " 'longitude': -122.34988}]},\n", + " {'name': 'Jackson Fish Market',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6018824,\n", + " 'longitude': -122.3355636}]},\n", + " {'name': 'RealSelf',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'RescueTime',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603577,\n", + " 'longitude': -122.335333}]},\n", + " {'name': 'Zoji',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Hark',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Snapvine',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.598968,\n", + " 'longitude': -122.332904}]},\n", + " {'name': 'Jott',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6139472,\n", + " 'longitude': -122.327807}]},\n", + " {'name': 'Delve Networks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.600818,\n", + " 'longitude': -122.334117}]},\n", + " {'name': 'Livemocha',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6399006,\n", + " 'longitude': -122.1914274}]},\n", + " {'name': 'CleverSet',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.605711,\n", + " 'longitude': -122.33872}]},\n", + " {'name': 'LiquidPlanner',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'PopShops',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6064,\n", + " 'longitude': -122.3308}]},\n", + " {'name': 'eNotes',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.615313,\n", + " 'longitude': -122.323408}]},\n", + " {'name': 'Mergelab',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.599136,\n", + " 'longitude': -122.334393}]},\n", + " {'name': 'Survey Analytics',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.650674,\n", + " 'longitude': -122.349863}]},\n", + " {'name': 'Openomy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634444,\n", + " 'longitude': -122.3419}]},\n", + " {'name': 'ClayValet',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'TalentSpring',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.680496,\n", + " 'longitude': -122.120938}]},\n", + " {'name': 'Movaya',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.66274,\n", + " 'longitude': -122.300863}]},\n", + " {'name': 'LyfeSystems',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634444,\n", + " 'longitude': -122.3419}]},\n", + " {'name': 'Escapia',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.613896,\n", + " 'longitude': -122.3413},\n", + " {'city': 'Austin', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Shelfari',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Askablogr',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'EVO Media Group',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.613896,\n", + " 'longitude': -122.3413}]},\n", + " {'name': 'Evri',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'PI Corporation',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.602416,\n", + " 'longitude': -122.332614}]},\n", + " {'name': 'SportsUltra',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.693994,\n", + " 'longitude': -122.349701}]},\n", + " {'name': 'politicsultra',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.693994,\n", + " 'longitude': -122.349701}]},\n", + " {'name': 'Vendaria',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603602,\n", + " 'longitude': -122.336791}]},\n", + " {'name': 'aQuantive',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6435828,\n", + " 'longitude': -122.1285846}]},\n", + " {'name': 'Bookgoo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'CarDomain Network',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634741,\n", + " 'longitude': -122.340435}]},\n", + " {'name': 'Pirillo Open Source CMS Project',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'RichRelevance',\n", + " 'offices': [{'city': 'San Francisco',\n", + " 'latitude': 37.7938969,\n", + " 'longitude': -122.4000965},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'Reading, Berkshire', 'latitude': None, 'longitude': None},\n", + " {'city': 'Boulder', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Reach Machines',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.618579,\n", + " 'longitude': -122.348937}]},\n", + " {'name': 'Seattle Software',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.625511,\n", + " 'longitude': -122.344966}]},\n", + " {'name': 'Mojiva',\n", + " 'offices': [{'city': 'New York',\n", + " 'latitude': 40.7185614,\n", + " 'longitude': -73.998662},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'Los Angeles', 'latitude': None, 'longitude': None},\n", + " {'city': 'Chicago', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'AdXpose',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.635354,\n", + " 'longitude': -122.340459}]},\n", + " {'name': 'Daptiv',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.604279,\n", + " 'longitude': -122.337437}]},\n", + " {'name': 'IndieShares',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.661375,\n", + " 'longitude': -122.331217}]},\n", + " {'name': 'TeachStreet',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6171788,\n", + " 'longitude': -122.3370801}]},\n", + " {'name': 'Estately',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.273017,\n", + " 'longitude': -120.882482}]},\n", + " {'name': 'Luminotes',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.683612,\n", + " 'longitude': -122.278022}]},\n", + " {'name': 'Blue Nile',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Conenza',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603176,\n", + " 'longitude': -122.3333044}]},\n", + " {'name': 'Elite Renting',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.619767,\n", + " 'longitude': -122.33651}]},\n", + " {'name': 'Lookfab',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.615417,\n", + " 'longitude': -122.294485}]},\n", + " {'name': 'Simple Spark',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Propertyqube',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 40.757929,\n", + " 'longitude': -73.985506}]},\n", + " {'name': 'IndieFlix',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634731,\n", + " 'longitude': -122.27962}]},\n", + " {'name': 'M:Metrics',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': \"Maitre'D POS\",\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.70903,\n", + " 'longitude': -122.320556}]},\n", + " {'name': 'WRLDs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.739569,\n", + " 'longitude': -122.344948}]},\n", + " {'name': 'CultureMob',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603357,\n", + " 'longitude': -122.33501}]},\n", + " {'name': 'Trusera',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.617122,\n", + " 'longitude': -122.305994}]},\n", + " {'name': 'Bevy',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Gimigo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 44.859587,\n", + " 'longitude': -93.226503}]},\n", + " {'name': 'thePlatform',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.617838,\n", + " 'longitude': -122.356027}]},\n", + " {'name': 'Rhapsody',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Sao Paulo', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Jetrecord',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 40.179731,\n", + " 'longitude': -105.20545}]},\n", + " {'name': 'Fixie',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042792,\n", + " 'longitude': -122.3374372}]},\n", + " {'name': 'Urbanspoon',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6420401,\n", + " 'longitude': -122.3263922}]},\n", + " {'name': 'RedMonk',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.59921,\n", + " 'longitude': -122.334357}]},\n", + " {'name': 'FriendlyFavor',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.618598,\n", + " 'longitude': -122.357028}]},\n", + " {'name': 'Jootware',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6141,\n", + " 'longitude': -122.33763}]},\n", + " {'name': 'DatStat',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6490908,\n", + " 'longitude': -122.3466877}]},\n", + " {'name': 'Konamoxt',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.670294,\n", + " 'longitude': -122.348306}]},\n", + " {'name': 'Local Marketers',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5989681,\n", + " 'longitude': -122.3329036}]},\n", + " {'name': 'Varolii',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.604242,\n", + " 'longitude': -122.334448}]},\n", + " {'name': 'Onehub',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.580235,\n", + " 'longitude': -122.145038}]},\n", + " {'name': 'Swype',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6495905,\n", + " 'longitude': -122.3497956}]},\n", + " {'name': 'Foodista',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6254784,\n", + " 'longitude': -122.3564234}]},\n", + " {'name': 'Divvy Systems',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.61321,\n", + " 'longitude': -122.342169}]},\n", + " {'name': 'Varolii',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.604242,\n", + " 'longitude': -122.334448}]},\n", + " {'name': 'Onehub',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.580235,\n", + " 'longitude': -122.145038}]},\n", + " {'name': 'Swype',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6495905,\n", + " 'longitude': -122.3497956}]},\n", + " {'name': 'Foodista',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6254784,\n", + " 'longitude': -122.3564234}]},\n", + " {'name': 'Divvy Systems',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.61321,\n", + " 'longitude': -122.342169}]},\n", + " {'name': 'perceptu',\n", + " 'offices': [{'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Pathable',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.657435,\n", + " 'longitude': -122.324861}]},\n", + " {'name': 'IMDB',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'F5 Networks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.622263,\n", + " 'longitude': -122.363276},\n", + " {'city': 'Liberty Lake', 'latitude': 47.667105, 'longitude': -117.111222},\n", + " {'city': 'New York', 'latitude': 40.75304, 'longitude': -73.998135},\n", + " {'city': 'San Jose', 'latitude': 37.381844, 'longitude': -121.924439},\n", + " {'city': 'Lowell', 'latitude': 42.619502, 'longitude': -71.322888},\n", + " {'city': 'Sao Paulo', 'latitude': -23.620738, 'longitude': -46.698267}]},\n", + " {'name': 'Artefact',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611718,\n", + " 'longitude': -122.345874}]},\n", + " {'name': 'Groupon',\n", + " 'offices': [{'city': 'Chicago',\n", + " 'latitude': 41.8965162,\n", + " 'longitude': -87.643622},\n", + " {'city': 'Palo Alto', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'findwell',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.627368,\n", + " 'longitude': -122.34229}]},\n", + " {'name': 'Fansoft Media',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 43.079324,\n", + " 'longitude': -89.367591}]},\n", + " {'name': 'Cooler Planet',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5127049,\n", + " 'longitude': -122.255536}]},\n", + " {'name': 'Trailfire',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Entellium',\n", + " 'offices': [{'city': 'Kuala Lumpur',\n", + " 'latitude': 3.15021,\n", + " 'longitude': 101.707703},\n", + " {'city': 'Seattle', 'latitude': 47.620973, 'longitude': -122.347276}]},\n", + " {'name': 'Edoceo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.547269,\n", + " 'longitude': -122.333709}]},\n", + " {'name': 'Lizardtech',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Go2Net',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'SeaMobile',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Mcneel',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6512967,\n", + " 'longitude': -122.3440227}]},\n", + " {'name': 'Athleon',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5999007,\n", + " 'longitude': -122.3302395}]},\n", + " {'name': 'Twenty20',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6307952,\n", + " 'longitude': -122.3423291}]},\n", + " {'name': 'Brain Fingerprinting Laboratories',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.66274,\n", + " 'longitude': -122.300863}]},\n", + " {'name': 'Decho',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6024156,\n", + " 'longitude': -122.3326145}]},\n", + " {'name': 'Datacastle',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.651315,\n", + " 'longitude': -122.3498959}]},\n", + " {'name': 'NewBay',\n", + " 'offices': [{'city': 'Dublin 2', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Attenex',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Tadlock Enterprises',\n", + " 'offices': [{'city': 'Los Angeles', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Random Computers',\n", + " 'offices': [{'city': 'Spokane',\n", + " 'latitude': 47.6572277,\n", + " 'longitude': -117.4180439},\n", + " {'city': 'Seattle', 'latitude': 47.611215, 'longitude': -122.3408776}]},\n", + " {'name': 'Valu Valu',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6254784,\n", + " 'longitude': -122.3564234}]},\n", + " {'name': 'Foundry Interactive',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6606589,\n", + " 'longitude': -122.344595}]},\n", + " {'name': 'Produxs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5753035,\n", + " 'longitude': -122.3342499}]},\n", + " {'name': 'Tableau Software',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6504518,\n", + " 'longitude': -122.3545086}]},\n", + " {'name': 'Social1000',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 61.216583,\n", + " 'longitude': -149.899597}]},\n", + " {'name': 'able2know',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5990906,\n", + " 'longitude': -122.335109}]},\n", + " {'name': 'BlueKai',\n", + " 'offices': [{'city': 'Cupertino', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': 40.760955, 'longitude': -73.968441},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'AllRecipes',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Vantos',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6018054,\n", + " 'longitude': -122.3342382}]},\n", + " {'name': 'Implied Solutions',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042663,\n", + " 'longitude': -122.3328401}]},\n", + " {'name': 'IMedExchange',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6136485,\n", + " 'longitude': -122.3371174}]},\n", + " {'name': 'Immunex',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Toodledo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.68932,\n", + " 'longitude': -122.379259}]},\n", + " {'name': 'ScreenLife',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5991987,\n", + " 'longitude': -122.3338691}]},\n", + " {'name': 'Internap',\n", + " 'offices': [{'city': 'Houston', 'latitude': None, 'longitude': None},\n", + " {'city': 'Atlanta', 'latitude': None, 'longitude': None},\n", + " {'city': 'Cambridge', 'latitude': None, 'longitude': None},\n", + " {'city': 'Chicago', 'latitude': None, 'longitude': None},\n", + " {'city': 'Dallas', 'latitude': None, 'longitude': None},\n", + " {'city': 'Denver', 'latitude': None, 'longitude': None},\n", + " {'city': 'Costa Mesa', 'latitude': None, 'longitude': None},\n", + " {'city': 'Ft. Lauderdale', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Jose', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'Herndon', 'latitude': None, 'longitude': None},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Paris', 'latitude': None, 'longitude': None},\n", + " {'city': 'Tokyo', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Spring Mobile Solutions',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6154389,\n", + " 'longitude': -122.3479567},\n", + " {'city': 'São Paulo', 'latitude': -23.5965303, 'longitude': -46.6864531}]},\n", + " {'name': 'SourceLabs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5990443,\n", + " 'longitude': -122.3342758}]},\n", + " {'name': 'Airbiquity',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042933,\n", + " 'longitude': -122.3374506}]},\n", + " {'name': 'Fremont Forward',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6600087,\n", + " 'longitude': -122.3425575}]},\n", + " {'name': 'Pikaba',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'ActiveRain',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Good Technology',\n", + " 'offices': [{'city': 'Sunnyvale',\n", + " 'latitude': 37.518539,\n", + " 'longitude': -122.254275},\n", + " {'city': 'Chicago', 'latitude': 41.8812179, 'longitude': -87.637522},\n", + " {'city': 'New York', 'latitude': 40.7511339, 'longitude': -73.978807},\n", + " {'city': 'Seattle', 'latitude': 47.6246175, 'longitude': -122.35931},\n", + " {'city': 'London', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Speakeasy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6057109,\n", + " 'longitude': -122.3387201}]},\n", + " {'name': 'Lakefront Software',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649043,\n", + " 'longitude': -122.275618}]},\n", + " {'name': 'SynapticMash',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6098932,\n", + " 'longitude': -122.3379255}]},\n", + " {'name': 'Teen Togs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5405059,\n", + " 'longitude': -122.3045438}]},\n", + " {'name': 'Hidden City Games',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6026054,\n", + " 'longitude': -122.2848651}]},\n", + " {'name': 'OnRequest Images',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6075374,\n", + " 'longitude': -122.3403478}]},\n", + " {'name': 'Medio',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611827,\n", + " 'longitude': -122.331308}]},\n", + " {'name': 'Mixpo',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'OpenMarket',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'FrugalMechanic',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620973,\n", + " 'longitude': -122.347276}]},\n", + " {'name': 'Vorsite',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6057109,\n", + " 'longitude': -122.3387201}]},\n", + " {'name': 'PhotoWorks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6028733,\n", + " 'longitude': -122.3361327}]},\n", + " {'name': 'SlideME',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5992095,\n", + " 'longitude': -122.3343564}]},\n", + " {'name': 'Skytap',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.544341,\n", + " 'longitude': -122.334732}]},\n", + " {'name': 'L4 Mobile',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.676762,\n", + " 'longitude': -122.2049192}]},\n", + " {'name': 'Kashless',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6257402,\n", + " 'longitude': -122.3581623}]},\n", + " {'name': 'Optify',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603364,\n", + " 'longitude': -122.333359}]},\n", + " {'name': 'Twibs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.718192,\n", + " 'longitude': -122.284674}]},\n", + " {'name': 'Verdiem',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Clustrix',\n", + " 'offices': [{'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'NetMotion Wireless',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649392,\n", + " 'longitude': -122.3486837}]},\n", + " {'name': 'Tamarac',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Z2Live',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6103008,\n", + " 'longitude': -122.3399782}]},\n", + " {'name': 'LookStat',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6447802,\n", + " 'longitude': -122.325878}]},\n", + " {'name': 'Adapx',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603873,\n", + " 'longitude': -122.3339579}]},\n", + " {'name': 'ExtraHop Networks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6209107,\n", + " 'longitude': -122.361239}]},\n", + " {'name': 'Next Door Media',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6913332,\n", + " 'longitude': -122.3824321}]},\n", + " {'name': 'Altus Alliance',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603176,\n", + " 'longitude': -122.3333044}]},\n", + " {'name': 'LexBlog',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Ingeniux',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6146338,\n", + " 'longitude': -122.3408187}]},\n", + " {'name': 'Startup Weekend',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Banyan Branch',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'Santa Monica', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Ratio Interactive',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5998944,\n", + " 'longitude': -122.3328866}]},\n", + " {'name': 'GroupieGuide',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042792,\n", + " 'longitude': -122.3374372}]},\n", + " {'name': 'Zooppa',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'OffiSync',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Symform',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6452085,\n", + " 'longitude': -122.3477735}]},\n", + " {'name': 'Gist',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6008183,\n", + " 'longitude': -122.334117}]},\n", + " {'name': 'AppStoreHQ',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6447802,\n", + " 'longitude': -122.325878}]},\n", + " {'name': 'FireRock Research',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6051695,\n", + " 'longitude': -122.3305597}]},\n", + " {'name': 'Eco-Rate',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.715013,\n", + " 'longitude': -122.320283}]},\n", + " {'name': 'Glympse',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6220245,\n", + " 'longitude': -122.3350847}]},\n", + " {'name': 'DomainTools',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Flaggpole',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620973,\n", + " 'longitude': -122.347276}]},\n", + " {'name': 'Beacon Law Advisors',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Rosetta Biosoftware',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6220596,\n", + " 'longitude': -122.3371699}]},\n", + " {'name': 'NanoString Technologies',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6234781,\n", + " 'longitude': -122.3343544}]},\n", + " {'name': 'Optimum Energy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.598657,\n", + " 'longitude': -122.334614},\n", + " {'city': 'San Diego', 'latitude': 32.8386414, 'longitude': -117.098216},\n", + " {'city': 'New York', 'latitude': 40.7518919, 'longitude': -73.9875922}]},\n", + " {'name': 'EnerG2',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042663,\n", + " 'longitude': -122.3328401}]},\n", + " {'name': 'iCopyright',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'SEM Wisdom',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5888393,\n", + " 'longitude': -122.2901035}]},\n", + " {'name': 'Principle Power',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5992095,\n", + " 'longitude': -122.3343564}]},\n", + " {'name': 'PopCap Games',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6161693,\n", + " 'longitude': -122.3451897}]},\n", + " {'name': 'AltaRock Energy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6859295,\n", + " 'longitude': -122.3373282},\n", + " {'city': 'Seattle', 'latitude': 47.620973, 'longitude': -122.347276}]},\n", + " {'name': 'Calistoga Pharmaceuticals',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Vigilos',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6113314,\n", + " 'longitude': -122.3430581}]}]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(seattle)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "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", + "
nameoffices
0Wetpaint[{'city': 'Seattle', 'latitude': 47.603122, 'l...
1Google[{'city': 'Mountain View', 'latitude': 37.4219...
2Jobster[{'city': 'Seattle', 'latitude': 47.617682, 'l...
3ZenZui[{'city': 'Seattle', 'latitude': 47.620716, 'l...
4Yapta[{'city': 'Seattle', 'latitude': 47.599925, 'l...
.........
212Principle Power[{'city': 'Seattle', 'latitude': 47.5992095, '...
213PopCap Games[{'city': 'Seattle', 'latitude': 47.6161693, '...
214AltaRock Energy[{'city': 'Seattle', 'latitude': 47.6859295, '...
215Calistoga Pharmaceuticals[{'city': 'Seattle', 'latitude': None, 'longit...
216Vigilos[{'city': 'Seattle', 'latitude': 47.6113314, '...
\n", + "

217 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " name \\\n", + "0 Wetpaint \n", + "1 Google \n", + "2 Jobster \n", + "3 ZenZui \n", + "4 Yapta \n", + ".. ... \n", + "212 Principle Power \n", + "213 PopCap Games \n", + "214 AltaRock Energy \n", + "215 Calistoga Pharmaceuticals \n", + "216 Vigilos \n", + "\n", + " offices \n", + "0 [{'city': 'Seattle', 'latitude': 47.603122, 'l... \n", + "1 [{'city': 'Mountain View', 'latitude': 37.4219... \n", + "2 [{'city': 'Seattle', 'latitude': 47.617682, 'l... \n", + "3 [{'city': 'Seattle', 'latitude': 47.620716, 'l... \n", + "4 [{'city': 'Seattle', 'latitude': 47.599925, 'l... \n", + ".. ... \n", + "212 [{'city': 'Seattle', 'latitude': 47.5992095, '... \n", + "213 [{'city': 'Seattle', 'latitude': 47.6161693, '... \n", + "214 [{'city': 'Seattle', 'latitude': 47.6859295, '... \n", + "215 [{'city': 'Seattle', 'latitude': None, 'longit... \n", + "216 [{'city': 'Seattle', 'latitude': 47.6113314, '... \n", + "\n", + "[217 rows x 2 columns]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# 2.queary to dataframe\n", + "dfs=pd.DataFrame(list(seattle))\n", + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "#dfs.iloc[1]['offices'] #testing" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "#dfs.info() #testing" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "#data=dfs[(dfs[\"name\"]==\"Google\")] #testing\n" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "#data #testing" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "#3. asigning name to multiple adddresses \n", + "new_df = pd.DataFrame(index=[], columns=dfs.columns)\n", + "for _, i in dfs.iterrows():\n", + " flattened_d = [dict(i.to_dict(), offices=c) for c in i.offices]\n", + " new_df = new_df.append(flattened_d )" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "#4. reseting index, preparing to merge\n", + "new_df = new_df.reset_index(drop=True) " + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "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", + "
nameoffices
0Wetpaint{'city': 'Seattle', 'latitude': 47.603122, 'lo...
1Wetpaint{'city': 'New York', 'latitude': 40.7237306, '...
2Google{'city': 'Mountain View', 'latitude': 37.42197...
3Google{'city': 'Ann Arbor', 'latitude': 42.280988, '...
4Google{'city': 'Atlanta', 'latitude': 33.781466, 'lo...
.........
341PopCap Games{'city': 'Seattle', 'latitude': 47.6161693, 'l...
342AltaRock Energy{'city': 'Seattle', 'latitude': 47.6859295, 'l...
343AltaRock Energy{'city': 'Seattle', 'latitude': 47.620973, 'lo...
344Calistoga Pharmaceuticals{'city': 'Seattle', 'latitude': None, 'longitu...
345Vigilos{'city': 'Seattle', 'latitude': 47.6113314, 'l...
\n", + "

346 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " name \\\n", + "0 Wetpaint \n", + "1 Wetpaint \n", + "2 Google \n", + "3 Google \n", + "4 Google \n", + ".. ... \n", + "341 PopCap Games \n", + "342 AltaRock Energy \n", + "343 AltaRock Energy \n", + "344 Calistoga Pharmaceuticals \n", + "345 Vigilos \n", + "\n", + " offices \n", + "0 {'city': 'Seattle', 'latitude': 47.603122, 'lo... \n", + "1 {'city': 'New York', 'latitude': 40.7237306, '... \n", + "2 {'city': 'Mountain View', 'latitude': 37.42197... \n", + "3 {'city': 'Ann Arbor', 'latitude': 42.280988, '... \n", + "4 {'city': 'Atlanta', 'latitude': 33.781466, 'lo... \n", + ".. ... \n", + "341 {'city': 'Seattle', 'latitude': 47.6161693, 'l... \n", + "342 {'city': 'Seattle', 'latitude': 47.6859295, 'l... \n", + "343 {'city': 'Seattle', 'latitude': 47.620973, 'lo... \n", + "344 {'city': 'Seattle', 'latitude': None, 'longitu... \n", + "345 {'city': 'Seattle', 'latitude': 47.6113314, 'l... \n", + "\n", + "[346 rows x 2 columns]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#5. checking\n", + "new_df" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:2: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", + " \n" + ] + } + ], + "source": [ + "#6. normalizing the office column\n", + "new_new = json_normalize(new_df['offices']) " + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "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", + "
citylatitudelongitude
0Seattle47.603122-122.333253
1New York40.723731-73.996431
2Mountain View37.421972-122.084143
3Ann Arbor42.280988-83.748882
4Atlanta33.781466-84.387519
............
341Seattle47.616169-122.345190
342Seattle47.685930-122.337328
343Seattle47.620973-122.347276
344SeattleNaNNaN
345Seattle47.611331-122.343058
\n", + "

346 rows × 3 columns

\n", + "
" + ], + "text/plain": [ + " city latitude longitude\n", + "0 Seattle 47.603122 -122.333253\n", + "1 New York 40.723731 -73.996431\n", + "2 Mountain View 37.421972 -122.084143\n", + "3 Ann Arbor 42.280988 -83.748882\n", + "4 Atlanta 33.781466 -84.387519\n", + ".. ... ... ...\n", + "341 Seattle 47.616169 -122.345190\n", + "342 Seattle 47.685930 -122.337328\n", + "343 Seattle 47.620973 -122.347276\n", + "344 Seattle NaN NaN\n", + "345 Seattle 47.611331 -122.343058\n", + "\n", + "[346 rows x 3 columns]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#7. checking\n", + "new_new" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "#8. merging\n", + "df=pd.concat([new_df, new_new], axis=1).drop(columns=['offices'])" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "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", + "
namecitylatitudelongitude
0WetpaintSeattle47.603122-122.333253
1WetpaintNew York40.723731-73.996431
2GoogleMountain View37.421972-122.084143
3GoogleAnn Arbor42.280988-83.748882
4GoogleAtlanta33.781466-84.387519
...............
341PopCap GamesSeattle47.616169-122.345190
342AltaRock EnergySeattle47.685930-122.337328
343AltaRock EnergySeattle47.620973-122.347276
344Calistoga PharmaceuticalsSeattleNaNNaN
345VigilosSeattle47.611331-122.343058
\n", + "

346 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " name city latitude longitude\n", + "0 Wetpaint Seattle 47.603122 -122.333253\n", + "1 Wetpaint New York 40.723731 -73.996431\n", + "2 Google Mountain View 37.421972 -122.084143\n", + "3 Google Ann Arbor 42.280988 -83.748882\n", + "4 Google Atlanta 33.781466 -84.387519\n", + ".. ... ... ... ...\n", + "341 PopCap Games Seattle 47.616169 -122.345190\n", + "342 AltaRock Energy Seattle 47.685930 -122.337328\n", + "343 AltaRock Energy Seattle 47.620973 -122.347276\n", + "344 Calistoga Pharmaceuticals Seattle NaN NaN\n", + "345 Vigilos Seattle 47.611331 -122.343058\n", + "\n", + "[346 rows x 4 columns]" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 117, + "metadata": {}, + "outputs": [], + "source": [ + "#end of testing " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Funnel - Initial Query" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "#1 seattle and surrondings\n", + "seattleq = list(colec.find({\n", + " '$and':[\n", + " {'$or':[{'offices.city': 'Seattle'},\\\n", + " {'offices.city': 'Belleuve'},\\\n", + " {'offices.city': 'Redmond'},\\\n", + " {'offices.state_code': 'WA'}]},\\\n", + " {'number_of_employees':{'$gt':5}},\\\n", + " {'deadpooled_year': None }]},\\\n", + " {'name':1, 'offices.city':1, '_id':0, 'founded_year':1,'number_of_employees':1,\\\n", + " 'offices.latitude':1, 'offices.longitude':1}))\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "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", + "
namenumber_of_employeesfounded_yearoffices
0Google280001998.0[{'city': 'Mountain View', 'latitude': 37.4219...
1Farecast262003.0[{'city': 'Seattle', 'latitude': 47.620982, 'l...
2Newsvine82005.0[{'city': 'Seattle', 'latitude': 47.618599, 'l...
3iLike282002.0[{'city': 'Seattle', 'latitude': 47.615313, 'l...
4Redfin1002004.0[{'city': 'Seattle', 'latitude': 47.603122, 'l...
...............
136Itron85001977.0[{'city': 'Liberty Lake', 'latitude': 47.67493...
137Optimum Energy652005.0[{'city': 'Seattle', 'latitude': 47.598657, 'l...
138MicroVision1101993.0[{'city': 'Redmond', 'latitude': 47.6614954, '...
139Netupdate501998.0[{'city': 'Bellevue', 'latitude': 47.6325767, ...
140Ambassadors Group2671967.0[{'city': 'Spokane', 'latitude': None, 'longit...
\n", + "

141 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " name number_of_employees founded_year \\\n", + "0 Google 28000 1998.0 \n", + "1 Farecast 26 2003.0 \n", + "2 Newsvine 8 2005.0 \n", + "3 iLike 28 2002.0 \n", + "4 Redfin 100 2004.0 \n", + ".. ... ... ... \n", + "136 Itron 8500 1977.0 \n", + "137 Optimum Energy 65 2005.0 \n", + "138 MicroVision 110 1993.0 \n", + "139 Netupdate 50 1998.0 \n", + "140 Ambassadors Group 267 1967.0 \n", + "\n", + " offices \n", + "0 [{'city': 'Mountain View', 'latitude': 37.4219... \n", + "1 [{'city': 'Seattle', 'latitude': 47.620982, 'l... \n", + "2 [{'city': 'Seattle', 'latitude': 47.618599, 'l... \n", + "3 [{'city': 'Seattle', 'latitude': 47.615313, 'l... \n", + "4 [{'city': 'Seattle', 'latitude': 47.603122, 'l... \n", + ".. ... \n", + "136 [{'city': 'Liberty Lake', 'latitude': 47.67493... \n", + "137 [{'city': 'Seattle', 'latitude': 47.598657, 'l... \n", + "138 [{'city': 'Redmond', 'latitude': 47.6614954, '... \n", + "139 [{'city': 'Bellevue', 'latitude': 47.6325767, ... \n", + "140 [{'city': 'Spokane', 'latitude': None, 'longit... \n", + "\n", + "[141 rows x 4 columns]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#2 Dataframe result as expected \n", + "dfs=pd.DataFrame(list(seattleq))\n", + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "# 3 Assigning the correct column names to the unwrapped offices column\n", + "new_df = pd.DataFrame(index=[], columns=dfs.columns)\n", + "for _, i in dfs.iterrows():\n", + " flattened_d = [dict(i.to_dict(), offices=c) for c in i.offices]\n", + " new_df = new_df.append(flattened_d )" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [], + "source": [ + "#4 Fixing index\n", + "new_df = new_df.reset_index(drop=True) " + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:2: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", + " \n" + ] + } + ], + "source": [ + "#6 Fixing columns wrapped information\n", + "new_new = json_normalize(new_df['offices']) " + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "#7 Merging DataFrames\n", + "df=pd.concat([new_df, new_new], axis=1).drop(columns=['offices'])" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "df=pd.concat([new_df, new_new], axis=1).drop(columns=['offices'])" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "#9 DataFrame as expected, cleaning process\n", + "df.dropna(inplace=True)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "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", + "
namenumber_of_employeesfounded_yearcitylatitudelongitude
0Google280001998.0Mountain View37.421972-122.084143
1Google280001998.0Ann Arbor42.280988-83.748882
2Google280001998.0Atlanta33.781466-84.387519
3Google280001998.0Austin30.351416-97.751382
4Google280001998.0Boulder40.021416-105.260931
.....................
297Optimum Energy652005.0Seattle47.598657-122.334614
298Optimum Energy652005.0San Diego32.838641-117.098216
299Optimum Energy652005.0New York40.751892-73.987592
300MicroVision1101993.0Redmond47.661495-122.094320
301Netupdate501998.0Bellevue47.632577-122.153758
\n", + "

174 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " name number_of_employees founded_year city \\\n", + "0 Google 28000 1998.0 Mountain View \n", + "1 Google 28000 1998.0 Ann Arbor \n", + "2 Google 28000 1998.0 Atlanta \n", + "3 Google 28000 1998.0 Austin \n", + "4 Google 28000 1998.0 Boulder \n", + ".. ... ... ... ... \n", + "297 Optimum Energy 65 2005.0 Seattle \n", + "298 Optimum Energy 65 2005.0 San Diego \n", + "299 Optimum Energy 65 2005.0 New York \n", + "300 MicroVision 110 1993.0 Redmond \n", + "301 Netupdate 50 1998.0 Bellevue \n", + "\n", + " latitude longitude \n", + "0 37.421972 -122.084143 \n", + "1 42.280988 -83.748882 \n", + "2 33.781466 -84.387519 \n", + "3 30.351416 -97.751382 \n", + "4 40.021416 -105.260931 \n", + ".. ... ... \n", + "297 47.598657 -122.334614 \n", + "298 32.838641 -117.098216 \n", + "299 40.751892 -73.987592 \n", + "300 47.661495 -122.094320 \n", + "301 47.632577 -122.153758 \n", + "\n", + "[174 rows x 6 columns]" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "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", + "
namenumber_of_employeesfounded_yearcitylatitudelongitude
18Google280001998.0Seattle47.675326-122.351397
19Google280001998.0Seattle47.649701-122.350592
67Farecast262003.0Seattle47.620982-122.359397
68Newsvine82005.0Seattle47.618599-122.358484
69iLike282002.0Seattle47.615313-122.323408
.....................
285Glympse202008.0Seattle47.622025-122.335085
295Voxmobili801999.0Bellevue47.613805-122.194891
297Optimum Energy652005.0Seattle47.598657-122.334614
300MicroVision1101993.0Redmond47.661495-122.094320
301Netupdate501998.0Bellevue47.632577-122.153758
\n", + "

85 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " name number_of_employees founded_year city latitude \\\n", + "18 Google 28000 1998.0 Seattle 47.675326 \n", + "19 Google 28000 1998.0 Seattle 47.649701 \n", + "67 Farecast 26 2003.0 Seattle 47.620982 \n", + "68 Newsvine 8 2005.0 Seattle 47.618599 \n", + "69 iLike 28 2002.0 Seattle 47.615313 \n", + ".. ... ... ... ... ... \n", + "285 Glympse 20 2008.0 Seattle 47.622025 \n", + "295 Voxmobili 80 1999.0 Bellevue 47.613805 \n", + "297 Optimum Energy 65 2005.0 Seattle 47.598657 \n", + "300 MicroVision 110 1993.0 Redmond 47.661495 \n", + "301 Netupdate 50 1998.0 Bellevue 47.632577 \n", + "\n", + " longitude \n", + "18 -122.351397 \n", + "19 -122.350592 \n", + "67 -122.359397 \n", + "68 -122.358484 \n", + "69 -122.323408 \n", + ".. ... \n", + "285 -122.335085 \n", + "295 -122.194891 \n", + "297 -122.334614 \n", + "300 -122.094320 \n", + "301 -122.153758 \n", + "\n", + "[85 rows x 6 columns]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#10 Looking for the three main cities for the project\n", + "#data=df[(df[\"city\"]== \"Redmond\")]\n", + "data = df.loc[(df['city'] == 'Seattle') | (df['city'] == 'Bellevue') | (df['city'] == 'Redmond')]\n", + "data" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "#11 Reseting index\n", + "data.reset_index(drop=True, inplace=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [], + "source": [ + "#12 Saving dataset\n", + "data.to_csv('dataset_clean.csv')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Mongo - Transfering DataFrame" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "#1 Converting to json\n", + "data.to_json('dataset_clean.json') " + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#2 Inserting data to Mongo\n", + "db.clean_data.insert_many(data.to_dict('records'))" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'principal_2dsphere'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#3 Adding 2dsphere\n", + "db.clean_data.create_index([('principal', '2dsphere')])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## MAPS with Folium" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [], + "source": [ + "import folium\n", + "from folium import plugins" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [], + "source": [ + "#Reading clean dataset\n", + "df=pd.read_csv(\"dataset_clean.csv\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Clustering with a Heat Map in Seattle Great Area " + ] + }, + { + "cell_type": "code", + "execution_count": 119, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 119, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating Heat Map\n", + "mapa = folium.Map([47.616415, -122.253495], zoom_start=12)\n", + "value_data = data[['latitude', 'longitude']].values\n", + "mapa.add_child(plugins.HeatMap(value_data, radius=15))\n", + "mapa" + ] + }, + { + "cell_type": "code", + "execution_count": 128, + "metadata": {}, + "outputs": [], + "source": [ + "#Saving map\n", + "mapa.save('heatmap.html')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Detail map of the Clusters in Seattle Great Area " + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[47.59993370000001, -122.3276962]" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating markers map step 1\n", + "locations = df[['latitude', 'longitude']]\n", + "locationlist = locations.values.tolist()\n", + "len(locationlist)\n", + "locationlist[7]" + ] + }, + { + "cell_type": "code", + "execution_count": 118, + "metadata": { + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 118, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating markers map step 2\n", + "\n", + "map = folium.Map(location=[47.616415, -122.253495], zoom_start=12)\n", + "for point in range(0, len(locationlist)):\n", + " folium.Marker(locationlist[point], popup=df['name'][point]).add_to(map)\n", + "map" + ] + }, + { + "cell_type": "code", + "execution_count": 129, + "metadata": {}, + "outputs": [], + "source": [ + "#Saving map\n", + "map.save('detail_clustering.html')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Detail map of the recommended area and Top 3 near competitors" + ] + }, + { + "cell_type": "code", + "execution_count": 124, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 124, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating specific location map with extra markers\n", + "m = folium.Map(\n", + " location=[47.604348, -122.331304],\n", + " tiles='cartodbpositron',\n", + " zoom_start=16\n", + ")\n", + "\n", + "folium.Circle(\n", + " radius=30,\n", + " location=[47.604348, -122.331304],\n", + " popup='Proposed Store',\n", + " color='crimson',\n", + " fill=False,\n", + ").add_to(m)\n", + "\n", + "folium.CircleMarker(\n", + " location=[47.604209, -122.331127],\n", + " radius=100,\n", + " popup='Main Cluster',\n", + " color='#3186cc',\n", + " fill=True,\n", + " fill_color='#3186cc'\n", + ").add_to(m)\n", + "\n", + "folium.Marker(\n", + " location=[47.605890, -122.332978],\n", + " popup='Belle Epicurean Bakery & Catering',\n", + " icon=folium.Icon(color='red', icon='glyphicon glyphicon-cutlery')\n", + ").add_to(m)\n", + "\n", + "folium.Marker(\n", + " location=[47.603655, -122.330642],\n", + " popup='Einstein Bros. Bagels',\n", + " icon=folium.Icon(color='red', icon='glyphicon glyphicon-cutlery')\n", + ").add_to(m)\n", + "\n", + "\n", + "folium.Marker(\n", + " location=[47.600032, -122.332845],\n", + " popup='The London Plane',\n", + " icon=folium.Icon(color='red', icon='glyphicon glyphicon-cutlery')\n", + ").add_to(m)\n", + "\n", + "m" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Location\n", + "#The best location with the client restrictions is the Columbia Tower, ground floor commercial area as is located\n", + "#in one of the main clusters of Seattle and close by to the original location of the client.\n", + "#This location is 861 sqf with a cost of $3.50 sqf/m\n", + "#This location is partially owner by Japanese-Americans also owners of super markets in the near-by area.\n", + "#They have special interest in the proyect and offered different incentives and discounts. \n", + "#Also, the map shows possible competitors that are in the same rank as our client. " + ] + }, + { + "cell_type": "code", + "execution_count": 130, + "metadata": {}, + "outputs": [], + "source": [ + "#Saving map\n", + "m.save('proposed_site.html')" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "metadata": {}, + "outputs": [], + "source": [ + "#end" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.7.7" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/module-2/python-bi-project/1. Mongo query's - Funnel .ipynb b/module-2/python-bi-project/1. Mongo query's - Funnel .ipynb new file mode 100644 index 0000000..e0cb925 --- /dev/null +++ b/module-2/python-bi-project/1. Mongo query's - Funnel .ipynb @@ -0,0 +1,2655 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python-bi-project" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Mongo query's - Funnel " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Testing Area & Steps Definition" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from pymongo import MongoClient\n", + "import pymongo\n", + "import pandas as pd\n", + "cliente=pymongo.MongoClient()\n", + "db=cliente.Companies\n", + "from pandas.io.json import json_normalize" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Companies', 'admin', 'config', 'local']" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cliente.list_database_names()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "colec=db.Companies" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Companies']" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "db.list_collection_names()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "#list(colec.find().limit(2))" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# 1.testing query\n", + "seattle = list(colec.find({'$and':[{'offices.city': 'Seattle'},{'offices.state_code': 'WA'}]},\\\n", + " {'name':1, 'offices.city':1, '_id':0, 'offices.latitude':1, 'offices.longitude':1}))\n", + "\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'name': 'Wetpaint',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603122,\n", + " 'longitude': -122.333253},\n", + " {'city': 'New York', 'latitude': 40.7237306, 'longitude': -73.9964312}]},\n", + " {'name': 'Google',\n", + " 'offices': [{'city': 'Mountain View',\n", + " 'latitude': 37.421972,\n", + " 'longitude': -122.084143},\n", + " {'city': 'Ann Arbor', 'latitude': 42.280988, 'longitude': -83.748882},\n", + " {'city': 'Atlanta', 'latitude': 33.781466, 'longitude': -84.387519},\n", + " {'city': 'Austin', 'latitude': 30.351416, 'longitude': -97.751382},\n", + " {'city': 'Boulder', 'latitude': 40.021416, 'longitude': -105.260931},\n", + " {'city': 'Cambridge', 'latitude': 42.36305, 'longitude': -71.087478},\n", + " {'city': 'Chicago', 'latitude': 41.889474, 'longitude': -87.628912},\n", + " {'city': 'Coppell', 'latitude': 32.981465, 'longitude': -97.018196},\n", + " {'city': 'Dallas', 'latitude': 32.809161, 'longitude': -96.807693},\n", + " {'city': 'Denver', 'latitude': 39.62919, 'longitude': -104.898419},\n", + " {'city': 'Birmingham', 'latitude': 42.547807, 'longitude': -83.215498},\n", + " {'city': 'Irvine', 'latitude': 33.658331, 'longitude': -117.861817},\n", + " {'city': 'Kirkland', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': 40.74222, 'longitude': -74.004489},\n", + " {'city': 'Tempe', 'latitude': 33.411898, 'longitude': -111.926263},\n", + " {'city': 'Pittsburgh', 'latitude': 40.444528, 'longitude': -79.946269},\n", + " {'city': 'San Francisco', 'latitude': 37.789803, 'longitude': -122.389757},\n", + " {'city': 'Santa Monica', 'latitude': 34.019282, 'longitude': -118.494288},\n", + " {'city': 'Seattle', 'latitude': 47.675326, 'longitude': -122.351397},\n", + " {'city': 'Seattle', 'latitude': 47.649701, 'longitude': -122.350592},\n", + " {'city': 'Washington', 'latitude': 38.901113, 'longitude': -77.027101},\n", + " {'city': 'Melbourne', 'latitude': -37.879234, 'longitude': 145.073608},\n", + " {'city': 'Sydney', 'latitude': -34.822723, 'longitude': 138.612396},\n", + " {'city': 'Beijing', 'latitude': None, 'longitude': None},\n", + " {'city': 'Guangzhou', 'latitude': None, 'longitude': None},\n", + " {'city': 'Shanghai', 'latitude': None, 'longitude': None},\n", + " {'city': 'Central', 'latitude': None, 'longitude': None},\n", + " {'city': 'Bangalore', 'latitude': None, 'longitude': None},\n", + " {'city': 'Gurgaon', 'latitude': None, 'longitude': None},\n", + " {'city': 'New Delhi', 'latitude': 28.86999, 'longitude': 77.122261},\n", + " {'city': 'Hyderabad', 'latitude': None, 'longitude': None},\n", + " {'city': 'Mumbai', 'latitude': None, 'longitude': None},\n", + " {'city': 'Tokyo', 'latitude': None, 'longitude': None},\n", + " {'city': 'Osaka', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seoul', 'latitude': None, 'longitude': None},\n", + " {'city': 'Singapore', 'latitude': None, 'longitude': None},\n", + " {'city': 'Taipei', 'latitude': None, 'longitude': None},\n", + " {'city': '', 'latitude': 56.171882, 'longitude': 10.187799},\n", + " {'city': '', 'latitude': None, 'longitude': None},\n", + " {'city': 'Helsinki', 'latitude': None, 'longitude': None},\n", + " {'city': 'Paris', 'latitude': 48.869606, 'longitude': 2.332749},\n", + " {'city': 'Hamburg', 'latitude': 53.554052, 'longitude': 9.985266},\n", + " {'city': 'Dublin', 'latitude': 53.339914, 'longitude': -6.234424},\n", + " {'city': 'Milan', 'latitude': 45.46381, 'longitude': 9.195978},\n", + " {'city': 'Amsterdam', 'latitude': 52.337495, 'longitude': 4.871464},\n", + " {'city': 'Oslo', 'latitude': 59.915848, 'longitude': 10.741047},\n", + " {'city': 'Trondheim', 'latitude': 63.435324, 'longitude': 10.412428},\n", + " {'city': 'Kraków', 'latitude': 50.063281, 'longitude': 19.929806},\n", + " {'city': 'Wroclaw', 'latitude': 51.116574, 'longitude': 17.041942},\n", + " {'city': 'Moscow', 'latitude': None, 'longitude': None},\n", + " {'city': 'St. Petersburg', 'latitude': None, 'longitude': None},\n", + " {'city': 'Madrid', 'latitude': None, 'longitude': None},\n", + " {'city': 'Luleå', 'latitude': 65.617491, 'longitude': 22.126255},\n", + " {'city': 'Stockholm', 'latitude': 59.332344, 'longitude': 18.060162},\n", + " {'city': 'Zürich', 'latitude': 47.36554, 'longitude': 8.524864},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Manchester', 'latitude': 53.473606, 'longitude': -2.250166},\n", + " {'city': 'Montreal', 'latitude': 45.498588, 'longitude': -73.567044},\n", + " {'city': 'Toronto', 'latitude': None, 'longitude': None},\n", + " {'city': 'Waterloo', 'latitude': 43.474704, 'longitude': -80.546381},\n", + " {'city': 'Buenos Aires', 'latitude': None, 'longitude': None},\n", + " {'city': 'Sao Paulo', 'latitude': -23.590463, 'longitude': -46.681494},\n", + " {'city': 'Mexico', 'latitude': 19.507519, 'longitude': -99.030156},\n", + " {'city': 'Haifa', 'latitude': None, 'longitude': None},\n", + " {'city': 'Tel-Aviv', 'latitude': None, 'longitude': None},\n", + " {'city': 'Istanbul', 'latitude': None, 'longitude': None},\n", + " {'city': 'Dubai', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Jobster',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.617682,\n", + " 'longitude': -122.357242}]},\n", + " {'name': 'ZenZui',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Yapta',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.599925,\n", + " 'longitude': -122.334264},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Farecast',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620982,\n", + " 'longitude': -122.359397}]},\n", + " {'name': 'TripHub',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.614653,\n", + " 'longitude': -122.338793}]},\n", + " {'name': 'Newsvine',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.618599,\n", + " 'longitude': -122.358484}]},\n", + " {'name': 'iLike',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.615313,\n", + " 'longitude': -122.323408}]},\n", + " {'name': 'Redfin',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603122,\n", + " 'longitude': -122.333253}]},\n", + " {'name': 'Wishpot',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'PayScale',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5999337,\n", + " 'longitude': -122.3276962}]},\n", + " {'name': 'Amazon',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5923,\n", + " 'longitude': -122.317295}]},\n", + " {'name': 'BuddyTV',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.61968,\n", + " 'longitude': -122.356756}]},\n", + " {'name': 'Brightcove',\n", + " 'offices': [{'city': 'Cambridge',\n", + " 'latitude': 42.362993,\n", + " 'longitude': -71.086596},\n", + " {'city': 'Tokyo', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Hamburg', 'latitude': None, 'longitude': None},\n", + " {'city': 'Barcelona', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'BillMonk',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Shock Treatment Management',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.610332,\n", + " 'longitude': -122.339859}]},\n", + " {'name': 'dpreview',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 55.378051,\n", + " 'longitude': -3.435973}]},\n", + " {'name': 'GoChongo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 37.09024,\n", + " 'longitude': -95.712891}]},\n", + " {'name': 'Ripl',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Marchex',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611201,\n", + " 'longitude': -122.336825}]},\n", + " {'name': 'EyeJot',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5999337,\n", + " 'longitude': -122.3276962}]},\n", + " {'name': 'MediaPops',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611012,\n", + " 'longitude': -122.333523}]},\n", + " {'name': 'FlowPlay',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6015315,\n", + " 'longitude': -122.335943}]},\n", + " {'name': 'Avvo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6104101,\n", + " 'longitude': -122.3396627}]},\n", + " {'name': 'Zillow',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6011125,\n", + " 'longitude': -122.3293984}]},\n", + " {'name': 'Moz',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'DocuSign',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603015,\n", + " 'longitude': -122.335668}]},\n", + " {'name': 'Tioti',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.733603,\n", + " 'longitude': -122.355579},\n", + " {'city': 'London', 'latitude': 51.524323, 'longitude': -0.081169}]},\n", + " {'name': 'AdReady',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649027,\n", + " 'longitude': -122.346299}]},\n", + " {'name': 'Treemo Labs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Picnik',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.610571,\n", + " 'longitude': -122.341769}]},\n", + " {'name': 'GridNetworks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.602873,\n", + " 'longitude': -122.336132}]},\n", + " {'name': 'Pelago',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.607065,\n", + " 'longitude': -122.335373}]},\n", + " {'name': 'Faves',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603327,\n", + " 'longitude': -122.334983}]},\n", + " {'name': 'Chintano',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649788,\n", + " 'longitude': -122.34988}]},\n", + " {'name': 'Jackson Fish Market',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6018824,\n", + " 'longitude': -122.3355636}]},\n", + " {'name': 'RealSelf',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'RescueTime',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603577,\n", + " 'longitude': -122.335333}]},\n", + " {'name': 'Zoji',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Hark',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Snapvine',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.598968,\n", + " 'longitude': -122.332904}]},\n", + " {'name': 'Jott',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6139472,\n", + " 'longitude': -122.327807}]},\n", + " {'name': 'Delve Networks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.600818,\n", + " 'longitude': -122.334117}]},\n", + " {'name': 'Livemocha',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6399006,\n", + " 'longitude': -122.1914274}]},\n", + " {'name': 'CleverSet',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.605711,\n", + " 'longitude': -122.33872}]},\n", + " {'name': 'LiquidPlanner',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'PopShops',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6064,\n", + " 'longitude': -122.3308}]},\n", + " {'name': 'eNotes',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.615313,\n", + " 'longitude': -122.323408}]},\n", + " {'name': 'Mergelab',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.599136,\n", + " 'longitude': -122.334393}]},\n", + " {'name': 'Survey Analytics',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.650674,\n", + " 'longitude': -122.349863}]},\n", + " {'name': 'Openomy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634444,\n", + " 'longitude': -122.3419}]},\n", + " {'name': 'ClayValet',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'TalentSpring',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.680496,\n", + " 'longitude': -122.120938}]},\n", + " {'name': 'Movaya',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.66274,\n", + " 'longitude': -122.300863}]},\n", + " {'name': 'LyfeSystems',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634444,\n", + " 'longitude': -122.3419}]},\n", + " {'name': 'Escapia',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.613896,\n", + " 'longitude': -122.3413},\n", + " {'city': 'Austin', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Shelfari',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'Askablogr',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'EVO Media Group',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.613896,\n", + " 'longitude': -122.3413}]},\n", + " {'name': 'Evri',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'PI Corporation',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.602416,\n", + " 'longitude': -122.332614}]},\n", + " {'name': 'SportsUltra',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.693994,\n", + " 'longitude': -122.349701}]},\n", + " {'name': 'politicsultra',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.693994,\n", + " 'longitude': -122.349701}]},\n", + " {'name': 'Vendaria',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603602,\n", + " 'longitude': -122.336791}]},\n", + " {'name': 'aQuantive',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6435828,\n", + " 'longitude': -122.1285846}]},\n", + " {'name': 'Bookgoo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'CarDomain Network',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634741,\n", + " 'longitude': -122.340435}]},\n", + " {'name': 'Pirillo Open Source CMS Project',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': 'RichRelevance',\n", + " 'offices': [{'city': 'San Francisco',\n", + " 'latitude': 37.7938969,\n", + " 'longitude': -122.4000965},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'Reading, Berkshire', 'latitude': None, 'longitude': None},\n", + " {'city': 'Boulder', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Reach Machines',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.618579,\n", + " 'longitude': -122.348937}]},\n", + " {'name': 'Seattle Software',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.625511,\n", + " 'longitude': -122.344966}]},\n", + " {'name': 'Mojiva',\n", + " 'offices': [{'city': 'New York',\n", + " 'latitude': 40.7185614,\n", + " 'longitude': -73.998662},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'Los Angeles', 'latitude': None, 'longitude': None},\n", + " {'city': 'Chicago', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'AdXpose',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.635354,\n", + " 'longitude': -122.340459}]},\n", + " {'name': 'Daptiv',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.604279,\n", + " 'longitude': -122.337437}]},\n", + " {'name': 'IndieShares',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.661375,\n", + " 'longitude': -122.331217}]},\n", + " {'name': 'TeachStreet',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6171788,\n", + " 'longitude': -122.3370801}]},\n", + " {'name': 'Estately',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.273017,\n", + " 'longitude': -120.882482}]},\n", + " {'name': 'Luminotes',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.683612,\n", + " 'longitude': -122.278022}]},\n", + " {'name': 'Blue Nile',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Conenza',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603176,\n", + " 'longitude': -122.3333044}]},\n", + " {'name': 'Elite Renting',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.619767,\n", + " 'longitude': -122.33651}]},\n", + " {'name': 'Lookfab',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.615417,\n", + " 'longitude': -122.294485}]},\n", + " {'name': 'Simple Spark',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Propertyqube',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 40.757929,\n", + " 'longitude': -73.985506}]},\n", + " {'name': 'IndieFlix',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.634731,\n", + " 'longitude': -122.27962}]},\n", + " {'name': 'M:Metrics',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620716,\n", + " 'longitude': -122.347533}]},\n", + " {'name': \"Maitre'D POS\",\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.70903,\n", + " 'longitude': -122.320556}]},\n", + " {'name': 'WRLDs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.739569,\n", + " 'longitude': -122.344948}]},\n", + " {'name': 'CultureMob',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603357,\n", + " 'longitude': -122.33501}]},\n", + " {'name': 'Trusera',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.617122,\n", + " 'longitude': -122.305994}]},\n", + " {'name': 'Bevy',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Gimigo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 44.859587,\n", + " 'longitude': -93.226503}]},\n", + " {'name': 'thePlatform',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.617838,\n", + " 'longitude': -122.356027}]},\n", + " {'name': 'Rhapsody',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Sao Paulo', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Jetrecord',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 40.179731,\n", + " 'longitude': -105.20545}]},\n", + " {'name': 'Fixie',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042792,\n", + " 'longitude': -122.3374372}]},\n", + " {'name': 'Urbanspoon',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6420401,\n", + " 'longitude': -122.3263922}]},\n", + " {'name': 'RedMonk',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.59921,\n", + " 'longitude': -122.334357}]},\n", + " {'name': 'FriendlyFavor',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.618598,\n", + " 'longitude': -122.357028}]},\n", + " {'name': 'Jootware',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6141,\n", + " 'longitude': -122.33763}]},\n", + " {'name': 'DatStat',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6490908,\n", + " 'longitude': -122.3466877}]},\n", + " {'name': 'Konamoxt',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.670294,\n", + " 'longitude': -122.348306}]},\n", + " {'name': 'Local Marketers',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5989681,\n", + " 'longitude': -122.3329036}]},\n", + " {'name': 'Varolii',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.604242,\n", + " 'longitude': -122.334448}]},\n", + " {'name': 'Onehub',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.580235,\n", + " 'longitude': -122.145038}]},\n", + " {'name': 'Swype',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6495905,\n", + " 'longitude': -122.3497956}]},\n", + " {'name': 'Foodista',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6254784,\n", + " 'longitude': -122.3564234}]},\n", + " {'name': 'Divvy Systems',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.61321,\n", + " 'longitude': -122.342169}]},\n", + " {'name': 'Varolii',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.604242,\n", + " 'longitude': -122.334448}]},\n", + " {'name': 'Onehub',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.580235,\n", + " 'longitude': -122.145038}]},\n", + " {'name': 'Swype',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6495905,\n", + " 'longitude': -122.3497956}]},\n", + " {'name': 'Foodista',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6254784,\n", + " 'longitude': -122.3564234}]},\n", + " {'name': 'Divvy Systems',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.61321,\n", + " 'longitude': -122.342169}]},\n", + " {'name': 'perceptu',\n", + " 'offices': [{'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Pathable',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.657435,\n", + " 'longitude': -122.324861}]},\n", + " {'name': 'IMDB',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'F5 Networks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.622263,\n", + " 'longitude': -122.363276},\n", + " {'city': 'Liberty Lake', 'latitude': 47.667105, 'longitude': -117.111222},\n", + " {'city': 'New York', 'latitude': 40.75304, 'longitude': -73.998135},\n", + " {'city': 'San Jose', 'latitude': 37.381844, 'longitude': -121.924439},\n", + " {'city': 'Lowell', 'latitude': 42.619502, 'longitude': -71.322888},\n", + " {'city': 'Sao Paulo', 'latitude': -23.620738, 'longitude': -46.698267}]},\n", + " {'name': 'Artefact',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611718,\n", + " 'longitude': -122.345874}]},\n", + " {'name': 'Groupon',\n", + " 'offices': [{'city': 'Chicago',\n", + " 'latitude': 41.8965162,\n", + " 'longitude': -87.643622},\n", + " {'city': 'Palo Alto', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'findwell',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.627368,\n", + " 'longitude': -122.34229}]},\n", + " {'name': 'Fansoft Media',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 43.079324,\n", + " 'longitude': -89.367591}]},\n", + " {'name': 'Cooler Planet',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5127049,\n", + " 'longitude': -122.255536}]},\n", + " {'name': 'Trailfire',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Entellium',\n", + " 'offices': [{'city': 'Kuala Lumpur',\n", + " 'latitude': 3.15021,\n", + " 'longitude': 101.707703},\n", + " {'city': 'Seattle', 'latitude': 47.620973, 'longitude': -122.347276}]},\n", + " {'name': 'Edoceo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.547269,\n", + " 'longitude': -122.333709}]},\n", + " {'name': 'Lizardtech',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Go2Net',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'SeaMobile',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Mcneel',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6512967,\n", + " 'longitude': -122.3440227}]},\n", + " {'name': 'Athleon',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5999007,\n", + " 'longitude': -122.3302395}]},\n", + " {'name': 'Twenty20',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6307952,\n", + " 'longitude': -122.3423291}]},\n", + " {'name': 'Brain Fingerprinting Laboratories',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.66274,\n", + " 'longitude': -122.300863}]},\n", + " {'name': 'Decho',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6024156,\n", + " 'longitude': -122.3326145}]},\n", + " {'name': 'Datacastle',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.651315,\n", + " 'longitude': -122.3498959}]},\n", + " {'name': 'NewBay',\n", + " 'offices': [{'city': 'Dublin 2', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Attenex',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Tadlock Enterprises',\n", + " 'offices': [{'city': 'Los Angeles', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Random Computers',\n", + " 'offices': [{'city': 'Spokane',\n", + " 'latitude': 47.6572277,\n", + " 'longitude': -117.4180439},\n", + " {'city': 'Seattle', 'latitude': 47.611215, 'longitude': -122.3408776}]},\n", + " {'name': 'Valu Valu',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6254784,\n", + " 'longitude': -122.3564234}]},\n", + " {'name': 'Foundry Interactive',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6606589,\n", + " 'longitude': -122.344595}]},\n", + " {'name': 'Produxs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5753035,\n", + " 'longitude': -122.3342499}]},\n", + " {'name': 'Tableau Software',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6504518,\n", + " 'longitude': -122.3545086}]},\n", + " {'name': 'Social1000',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 61.216583,\n", + " 'longitude': -149.899597}]},\n", + " {'name': 'able2know',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5990906,\n", + " 'longitude': -122.335109}]},\n", + " {'name': 'BlueKai',\n", + " 'offices': [{'city': 'Cupertino', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': 40.760955, 'longitude': -73.968441},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Francisco', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'AllRecipes',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Vantos',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6018054,\n", + " 'longitude': -122.3342382}]},\n", + " {'name': 'Implied Solutions',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042663,\n", + " 'longitude': -122.3328401}]},\n", + " {'name': 'IMedExchange',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6136485,\n", + " 'longitude': -122.3371174}]},\n", + " {'name': 'Immunex',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Toodledo',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.68932,\n", + " 'longitude': -122.379259}]},\n", + " {'name': 'ScreenLife',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5991987,\n", + " 'longitude': -122.3338691}]},\n", + " {'name': 'Internap',\n", + " 'offices': [{'city': 'Houston', 'latitude': None, 'longitude': None},\n", + " {'city': 'Atlanta', 'latitude': None, 'longitude': None},\n", + " {'city': 'Cambridge', 'latitude': None, 'longitude': None},\n", + " {'city': 'Chicago', 'latitude': None, 'longitude': None},\n", + " {'city': 'Dallas', 'latitude': None, 'longitude': None},\n", + " {'city': 'Denver', 'latitude': None, 'longitude': None},\n", + " {'city': 'Costa Mesa', 'latitude': None, 'longitude': None},\n", + " {'city': 'Ft. Lauderdale', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'San Jose', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'Herndon', 'latitude': None, 'longitude': None},\n", + " {'city': 'London', 'latitude': None, 'longitude': None},\n", + " {'city': 'Paris', 'latitude': None, 'longitude': None},\n", + " {'city': 'Tokyo', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Spring Mobile Solutions',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6154389,\n", + " 'longitude': -122.3479567},\n", + " {'city': 'São Paulo', 'latitude': -23.5965303, 'longitude': -46.6864531}]},\n", + " {'name': 'SourceLabs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5990443,\n", + " 'longitude': -122.3342758}]},\n", + " {'name': 'Airbiquity',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042933,\n", + " 'longitude': -122.3374506}]},\n", + " {'name': 'Fremont Forward',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6600087,\n", + " 'longitude': -122.3425575}]},\n", + " {'name': 'Pikaba',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'ActiveRain',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Good Technology',\n", + " 'offices': [{'city': 'Sunnyvale',\n", + " 'latitude': 37.518539,\n", + " 'longitude': -122.254275},\n", + " {'city': 'Chicago', 'latitude': 41.8812179, 'longitude': -87.637522},\n", + " {'city': 'New York', 'latitude': 40.7511339, 'longitude': -73.978807},\n", + " {'city': 'Seattle', 'latitude': 47.6246175, 'longitude': -122.35931},\n", + " {'city': 'London', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Speakeasy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6057109,\n", + " 'longitude': -122.3387201}]},\n", + " {'name': 'Lakefront Software',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649043,\n", + " 'longitude': -122.275618}]},\n", + " {'name': 'SynapticMash',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6098932,\n", + " 'longitude': -122.3379255}]},\n", + " {'name': 'Teen Togs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5405059,\n", + " 'longitude': -122.3045438}]},\n", + " {'name': 'Hidden City Games',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6026054,\n", + " 'longitude': -122.2848651}]},\n", + " {'name': 'OnRequest Images',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6075374,\n", + " 'longitude': -122.3403478}]},\n", + " {'name': 'Medio',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.611827,\n", + " 'longitude': -122.331308}]},\n", + " {'name': 'Mixpo',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'OpenMarket',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'FrugalMechanic',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620973,\n", + " 'longitude': -122.347276}]},\n", + " {'name': 'Vorsite',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6057109,\n", + " 'longitude': -122.3387201}]},\n", + " {'name': 'PhotoWorks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6028733,\n", + " 'longitude': -122.3361327}]},\n", + " {'name': 'SlideME',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5992095,\n", + " 'longitude': -122.3343564}]},\n", + " {'name': 'Skytap',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.544341,\n", + " 'longitude': -122.334732}]},\n", + " {'name': 'L4 Mobile',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.676762,\n", + " 'longitude': -122.2049192}]},\n", + " {'name': 'Kashless',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6257402,\n", + " 'longitude': -122.3581623}]},\n", + " {'name': 'Optify',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603364,\n", + " 'longitude': -122.333359}]},\n", + " {'name': 'Twibs',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.718192,\n", + " 'longitude': -122.284674}]},\n", + " {'name': 'Verdiem',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Clustrix',\n", + " 'offices': [{'city': 'San Francisco', 'latitude': None, 'longitude': None},\n", + " {'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'NetMotion Wireless',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.649392,\n", + " 'longitude': -122.3486837}]},\n", + " {'name': 'Tamarac',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Z2Live',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6103008,\n", + " 'longitude': -122.3399782}]},\n", + " {'name': 'LookStat',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6447802,\n", + " 'longitude': -122.325878}]},\n", + " {'name': 'Adapx',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603873,\n", + " 'longitude': -122.3339579}]},\n", + " {'name': 'ExtraHop Networks',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6209107,\n", + " 'longitude': -122.361239}]},\n", + " {'name': 'Next Door Media',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6913332,\n", + " 'longitude': -122.3824321}]},\n", + " {'name': 'Altus Alliance',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.603176,\n", + " 'longitude': -122.3333044}]},\n", + " {'name': 'LexBlog',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Ingeniux',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6146338,\n", + " 'longitude': -122.3408187}]},\n", + " {'name': 'Startup Weekend',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Banyan Branch',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None},\n", + " {'city': 'New York', 'latitude': None, 'longitude': None},\n", + " {'city': 'Santa Monica', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Ratio Interactive',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5998944,\n", + " 'longitude': -122.3328866}]},\n", + " {'name': 'GroupieGuide',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042792,\n", + " 'longitude': -122.3374372}]},\n", + " {'name': 'Zooppa',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'OffiSync',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Symform',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6452085,\n", + " 'longitude': -122.3477735}]},\n", + " {'name': 'Gist',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6008183,\n", + " 'longitude': -122.334117}]},\n", + " {'name': 'AppStoreHQ',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6447802,\n", + " 'longitude': -122.325878}]},\n", + " {'name': 'FireRock Research',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6051695,\n", + " 'longitude': -122.3305597}]},\n", + " {'name': 'Eco-Rate',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.715013,\n", + " 'longitude': -122.320283}]},\n", + " {'name': 'Glympse',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6220245,\n", + " 'longitude': -122.3350847}]},\n", + " {'name': 'DomainTools',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Flaggpole',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.620973,\n", + " 'longitude': -122.347276}]},\n", + " {'name': 'Beacon Law Advisors',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Rosetta Biosoftware',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6220596,\n", + " 'longitude': -122.3371699}]},\n", + " {'name': 'NanoString Technologies',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6234781,\n", + " 'longitude': -122.3343544}]},\n", + " {'name': 'Optimum Energy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.598657,\n", + " 'longitude': -122.334614},\n", + " {'city': 'San Diego', 'latitude': 32.8386414, 'longitude': -117.098216},\n", + " {'city': 'New York', 'latitude': 40.7518919, 'longitude': -73.9875922}]},\n", + " {'name': 'EnerG2',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6042663,\n", + " 'longitude': -122.3328401}]},\n", + " {'name': 'iCopyright',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'SEM Wisdom',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5888393,\n", + " 'longitude': -122.2901035}]},\n", + " {'name': 'Principle Power',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.5992095,\n", + " 'longitude': -122.3343564}]},\n", + " {'name': 'PopCap Games',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6161693,\n", + " 'longitude': -122.3451897}]},\n", + " {'name': 'AltaRock Energy',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6859295,\n", + " 'longitude': -122.3373282},\n", + " {'city': 'Seattle', 'latitude': 47.620973, 'longitude': -122.347276}]},\n", + " {'name': 'Calistoga Pharmaceuticals',\n", + " 'offices': [{'city': 'Seattle', 'latitude': None, 'longitude': None}]},\n", + " {'name': 'Vigilos',\n", + " 'offices': [{'city': 'Seattle',\n", + " 'latitude': 47.6113314,\n", + " 'longitude': -122.3430581}]}]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(seattle)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "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", + "
nameoffices
0Wetpaint[{'city': 'Seattle', 'latitude': 47.603122, 'l...
1Google[{'city': 'Mountain View', 'latitude': 37.4219...
2Jobster[{'city': 'Seattle', 'latitude': 47.617682, 'l...
3ZenZui[{'city': 'Seattle', 'latitude': 47.620716, 'l...
4Yapta[{'city': 'Seattle', 'latitude': 47.599925, 'l...
.........
212Principle Power[{'city': 'Seattle', 'latitude': 47.5992095, '...
213PopCap Games[{'city': 'Seattle', 'latitude': 47.6161693, '...
214AltaRock Energy[{'city': 'Seattle', 'latitude': 47.6859295, '...
215Calistoga Pharmaceuticals[{'city': 'Seattle', 'latitude': None, 'longit...
216Vigilos[{'city': 'Seattle', 'latitude': 47.6113314, '...
\n", + "

217 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " name \\\n", + "0 Wetpaint \n", + "1 Google \n", + "2 Jobster \n", + "3 ZenZui \n", + "4 Yapta \n", + ".. ... \n", + "212 Principle Power \n", + "213 PopCap Games \n", + "214 AltaRock Energy \n", + "215 Calistoga Pharmaceuticals \n", + "216 Vigilos \n", + "\n", + " offices \n", + "0 [{'city': 'Seattle', 'latitude': 47.603122, 'l... \n", + "1 [{'city': 'Mountain View', 'latitude': 37.4219... \n", + "2 [{'city': 'Seattle', 'latitude': 47.617682, 'l... \n", + "3 [{'city': 'Seattle', 'latitude': 47.620716, 'l... \n", + "4 [{'city': 'Seattle', 'latitude': 47.599925, 'l... \n", + ".. ... \n", + "212 [{'city': 'Seattle', 'latitude': 47.5992095, '... \n", + "213 [{'city': 'Seattle', 'latitude': 47.6161693, '... \n", + "214 [{'city': 'Seattle', 'latitude': 47.6859295, '... \n", + "215 [{'city': 'Seattle', 'latitude': None, 'longit... \n", + "216 [{'city': 'Seattle', 'latitude': 47.6113314, '... \n", + "\n", + "[217 rows x 2 columns]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# 2.queary to dataframe\n", + "dfs=pd.DataFrame(list(seattle))\n", + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "#dfs.iloc[1]['offices'] #testing" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "#dfs.info() #testing" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "#data=dfs[(dfs[\"name\"]==\"Google\")] #testing\n" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "#data #testing" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "#3. asigning name to multiple adddresses \n", + "new_df = pd.DataFrame(index=[], columns=dfs.columns)\n", + "for _, i in dfs.iterrows():\n", + " flattened_d = [dict(i.to_dict(), offices=c) for c in i.offices]\n", + " new_df = new_df.append(flattened_d )" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "#4. reseting index, preparing to merge\n", + "new_df = new_df.reset_index(drop=True) " + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "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", + "
nameoffices
0Wetpaint{'city': 'Seattle', 'latitude': 47.603122, 'lo...
1Wetpaint{'city': 'New York', 'latitude': 40.7237306, '...
2Google{'city': 'Mountain View', 'latitude': 37.42197...
3Google{'city': 'Ann Arbor', 'latitude': 42.280988, '...
4Google{'city': 'Atlanta', 'latitude': 33.781466, 'lo...
.........
341PopCap Games{'city': 'Seattle', 'latitude': 47.6161693, 'l...
342AltaRock Energy{'city': 'Seattle', 'latitude': 47.6859295, 'l...
343AltaRock Energy{'city': 'Seattle', 'latitude': 47.620973, 'lo...
344Calistoga Pharmaceuticals{'city': 'Seattle', 'latitude': None, 'longitu...
345Vigilos{'city': 'Seattle', 'latitude': 47.6113314, 'l...
\n", + "

346 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " name \\\n", + "0 Wetpaint \n", + "1 Wetpaint \n", + "2 Google \n", + "3 Google \n", + "4 Google \n", + ".. ... \n", + "341 PopCap Games \n", + "342 AltaRock Energy \n", + "343 AltaRock Energy \n", + "344 Calistoga Pharmaceuticals \n", + "345 Vigilos \n", + "\n", + " offices \n", + "0 {'city': 'Seattle', 'latitude': 47.603122, 'lo... \n", + "1 {'city': 'New York', 'latitude': 40.7237306, '... \n", + "2 {'city': 'Mountain View', 'latitude': 37.42197... \n", + "3 {'city': 'Ann Arbor', 'latitude': 42.280988, '... \n", + "4 {'city': 'Atlanta', 'latitude': 33.781466, 'lo... \n", + ".. ... \n", + "341 {'city': 'Seattle', 'latitude': 47.6161693, 'l... \n", + "342 {'city': 'Seattle', 'latitude': 47.6859295, 'l... \n", + "343 {'city': 'Seattle', 'latitude': 47.620973, 'lo... \n", + "344 {'city': 'Seattle', 'latitude': None, 'longitu... \n", + "345 {'city': 'Seattle', 'latitude': 47.6113314, 'l... \n", + "\n", + "[346 rows x 2 columns]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#5. checking\n", + "new_df" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:2: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", + " \n" + ] + } + ], + "source": [ + "#6. normalizing the office column\n", + "new_new = json_normalize(new_df['offices']) " + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "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", + "
citylatitudelongitude
0Seattle47.603122-122.333253
1New York40.723731-73.996431
2Mountain View37.421972-122.084143
3Ann Arbor42.280988-83.748882
4Atlanta33.781466-84.387519
............
341Seattle47.616169-122.345190
342Seattle47.685930-122.337328
343Seattle47.620973-122.347276
344SeattleNaNNaN
345Seattle47.611331-122.343058
\n", + "

346 rows × 3 columns

\n", + "
" + ], + "text/plain": [ + " city latitude longitude\n", + "0 Seattle 47.603122 -122.333253\n", + "1 New York 40.723731 -73.996431\n", + "2 Mountain View 37.421972 -122.084143\n", + "3 Ann Arbor 42.280988 -83.748882\n", + "4 Atlanta 33.781466 -84.387519\n", + ".. ... ... ...\n", + "341 Seattle 47.616169 -122.345190\n", + "342 Seattle 47.685930 -122.337328\n", + "343 Seattle 47.620973 -122.347276\n", + "344 Seattle NaN NaN\n", + "345 Seattle 47.611331 -122.343058\n", + "\n", + "[346 rows x 3 columns]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#7. checking\n", + "new_new" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "#8. merging\n", + "df=pd.concat([new_df, new_new], axis=1).drop(columns=['offices'])" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "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", + "
namecitylatitudelongitude
0WetpaintSeattle47.603122-122.333253
1WetpaintNew York40.723731-73.996431
2GoogleMountain View37.421972-122.084143
3GoogleAnn Arbor42.280988-83.748882
4GoogleAtlanta33.781466-84.387519
...............
341PopCap GamesSeattle47.616169-122.345190
342AltaRock EnergySeattle47.685930-122.337328
343AltaRock EnergySeattle47.620973-122.347276
344Calistoga PharmaceuticalsSeattleNaNNaN
345VigilosSeattle47.611331-122.343058
\n", + "

346 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " name city latitude longitude\n", + "0 Wetpaint Seattle 47.603122 -122.333253\n", + "1 Wetpaint New York 40.723731 -73.996431\n", + "2 Google Mountain View 37.421972 -122.084143\n", + "3 Google Ann Arbor 42.280988 -83.748882\n", + "4 Google Atlanta 33.781466 -84.387519\n", + ".. ... ... ... ...\n", + "341 PopCap Games Seattle 47.616169 -122.345190\n", + "342 AltaRock Energy Seattle 47.685930 -122.337328\n", + "343 AltaRock Energy Seattle 47.620973 -122.347276\n", + "344 Calistoga Pharmaceuticals Seattle NaN NaN\n", + "345 Vigilos Seattle 47.611331 -122.343058\n", + "\n", + "[346 rows x 4 columns]" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 117, + "metadata": {}, + "outputs": [], + "source": [ + "#end of testing " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Funnel - Initial Query" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "#1 seattle and surrondings\n", + "seattleq = list(colec.find({\n", + " '$and':[\n", + " {'$or':[{'offices.city': 'Seattle'},\\\n", + " {'offices.city': 'Belleuve'},\\\n", + " {'offices.city': 'Redmond'},\\\n", + " {'offices.state_code': 'WA'}]},\\\n", + " {'number_of_employees':{'$gt':5}},\\\n", + " {'deadpooled_year': None }]},\\\n", + " {'name':1, 'offices.city':1, '_id':0, 'founded_year':1,'number_of_employees':1,\\\n", + " 'offices.latitude':1, 'offices.longitude':1}))\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "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", + "
namenumber_of_employeesfounded_yearoffices
0Google280001998.0[{'city': 'Mountain View', 'latitude': 37.4219...
1Farecast262003.0[{'city': 'Seattle', 'latitude': 47.620982, 'l...
2Newsvine82005.0[{'city': 'Seattle', 'latitude': 47.618599, 'l...
3iLike282002.0[{'city': 'Seattle', 'latitude': 47.615313, 'l...
4Redfin1002004.0[{'city': 'Seattle', 'latitude': 47.603122, 'l...
...............
136Itron85001977.0[{'city': 'Liberty Lake', 'latitude': 47.67493...
137Optimum Energy652005.0[{'city': 'Seattle', 'latitude': 47.598657, 'l...
138MicroVision1101993.0[{'city': 'Redmond', 'latitude': 47.6614954, '...
139Netupdate501998.0[{'city': 'Bellevue', 'latitude': 47.6325767, ...
140Ambassadors Group2671967.0[{'city': 'Spokane', 'latitude': None, 'longit...
\n", + "

141 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " name number_of_employees founded_year \\\n", + "0 Google 28000 1998.0 \n", + "1 Farecast 26 2003.0 \n", + "2 Newsvine 8 2005.0 \n", + "3 iLike 28 2002.0 \n", + "4 Redfin 100 2004.0 \n", + ".. ... ... ... \n", + "136 Itron 8500 1977.0 \n", + "137 Optimum Energy 65 2005.0 \n", + "138 MicroVision 110 1993.0 \n", + "139 Netupdate 50 1998.0 \n", + "140 Ambassadors Group 267 1967.0 \n", + "\n", + " offices \n", + "0 [{'city': 'Mountain View', 'latitude': 37.4219... \n", + "1 [{'city': 'Seattle', 'latitude': 47.620982, 'l... \n", + "2 [{'city': 'Seattle', 'latitude': 47.618599, 'l... \n", + "3 [{'city': 'Seattle', 'latitude': 47.615313, 'l... \n", + "4 [{'city': 'Seattle', 'latitude': 47.603122, 'l... \n", + ".. ... \n", + "136 [{'city': 'Liberty Lake', 'latitude': 47.67493... \n", + "137 [{'city': 'Seattle', 'latitude': 47.598657, 'l... \n", + "138 [{'city': 'Redmond', 'latitude': 47.6614954, '... \n", + "139 [{'city': 'Bellevue', 'latitude': 47.6325767, ... \n", + "140 [{'city': 'Spokane', 'latitude': None, 'longit... \n", + "\n", + "[141 rows x 4 columns]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#2 Dataframe result as expected \n", + "dfs=pd.DataFrame(list(seattleq))\n", + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "# 3 Assigning the correct column names to the unwrapped offices column\n", + "new_df = pd.DataFrame(index=[], columns=dfs.columns)\n", + "for _, i in dfs.iterrows():\n", + " flattened_d = [dict(i.to_dict(), offices=c) for c in i.offices]\n", + " new_df = new_df.append(flattened_d )" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [], + "source": [ + "#4 Fixing index\n", + "new_df = new_df.reset_index(drop=True) " + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:2: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", + " \n" + ] + } + ], + "source": [ + "#6 Fixing columns wrapped information\n", + "new_new = json_normalize(new_df['offices']) " + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "#7 Merging DataFrames\n", + "df=pd.concat([new_df, new_new], axis=1).drop(columns=['offices'])" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "df=pd.concat([new_df, new_new], axis=1).drop(columns=['offices'])" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "#9 DataFrame as expected, cleaning process\n", + "df.dropna(inplace=True)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "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", + "
namenumber_of_employeesfounded_yearcitylatitudelongitude
0Google280001998.0Mountain View37.421972-122.084143
1Google280001998.0Ann Arbor42.280988-83.748882
2Google280001998.0Atlanta33.781466-84.387519
3Google280001998.0Austin30.351416-97.751382
4Google280001998.0Boulder40.021416-105.260931
.....................
297Optimum Energy652005.0Seattle47.598657-122.334614
298Optimum Energy652005.0San Diego32.838641-117.098216
299Optimum Energy652005.0New York40.751892-73.987592
300MicroVision1101993.0Redmond47.661495-122.094320
301Netupdate501998.0Bellevue47.632577-122.153758
\n", + "

174 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " name number_of_employees founded_year city \\\n", + "0 Google 28000 1998.0 Mountain View \n", + "1 Google 28000 1998.0 Ann Arbor \n", + "2 Google 28000 1998.0 Atlanta \n", + "3 Google 28000 1998.0 Austin \n", + "4 Google 28000 1998.0 Boulder \n", + ".. ... ... ... ... \n", + "297 Optimum Energy 65 2005.0 Seattle \n", + "298 Optimum Energy 65 2005.0 San Diego \n", + "299 Optimum Energy 65 2005.0 New York \n", + "300 MicroVision 110 1993.0 Redmond \n", + "301 Netupdate 50 1998.0 Bellevue \n", + "\n", + " latitude longitude \n", + "0 37.421972 -122.084143 \n", + "1 42.280988 -83.748882 \n", + "2 33.781466 -84.387519 \n", + "3 30.351416 -97.751382 \n", + "4 40.021416 -105.260931 \n", + ".. ... ... \n", + "297 47.598657 -122.334614 \n", + "298 32.838641 -117.098216 \n", + "299 40.751892 -73.987592 \n", + "300 47.661495 -122.094320 \n", + "301 47.632577 -122.153758 \n", + "\n", + "[174 rows x 6 columns]" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "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", + "
namenumber_of_employeesfounded_yearcitylatitudelongitude
18Google280001998.0Seattle47.675326-122.351397
19Google280001998.0Seattle47.649701-122.350592
67Farecast262003.0Seattle47.620982-122.359397
68Newsvine82005.0Seattle47.618599-122.358484
69iLike282002.0Seattle47.615313-122.323408
.....................
285Glympse202008.0Seattle47.622025-122.335085
295Voxmobili801999.0Bellevue47.613805-122.194891
297Optimum Energy652005.0Seattle47.598657-122.334614
300MicroVision1101993.0Redmond47.661495-122.094320
301Netupdate501998.0Bellevue47.632577-122.153758
\n", + "

85 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " name number_of_employees founded_year city latitude \\\n", + "18 Google 28000 1998.0 Seattle 47.675326 \n", + "19 Google 28000 1998.0 Seattle 47.649701 \n", + "67 Farecast 26 2003.0 Seattle 47.620982 \n", + "68 Newsvine 8 2005.0 Seattle 47.618599 \n", + "69 iLike 28 2002.0 Seattle 47.615313 \n", + ".. ... ... ... ... ... \n", + "285 Glympse 20 2008.0 Seattle 47.622025 \n", + "295 Voxmobili 80 1999.0 Bellevue 47.613805 \n", + "297 Optimum Energy 65 2005.0 Seattle 47.598657 \n", + "300 MicroVision 110 1993.0 Redmond 47.661495 \n", + "301 Netupdate 50 1998.0 Bellevue 47.632577 \n", + "\n", + " longitude \n", + "18 -122.351397 \n", + "19 -122.350592 \n", + "67 -122.359397 \n", + "68 -122.358484 \n", + "69 -122.323408 \n", + ".. ... \n", + "285 -122.335085 \n", + "295 -122.194891 \n", + "297 -122.334614 \n", + "300 -122.094320 \n", + "301 -122.153758 \n", + "\n", + "[85 rows x 6 columns]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#10 Looking for the three main cities for the project\n", + "#data=df[(df[\"city\"]== \"Redmond\")]\n", + "data = df.loc[(df['city'] == 'Seattle') | (df['city'] == 'Bellevue') | (df['city'] == 'Redmond')]\n", + "data" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "#11 Reseting index\n", + "data.reset_index(drop=True, inplace=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [], + "source": [ + "#12 Saving dataset\n", + "data.to_csv('dataset_clean.csv')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Mongo - Transfering DataFrame" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "#1 Converting to json\n", + "data.to_json('dataset_clean.json') " + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#2 Inserting data to Mongo\n", + "db.clean_data.insert_many(data.to_dict('records'))" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'principal_2dsphere'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#3 Adding 2dsphere\n", + "db.clean_data.create_index([('principal', '2dsphere')])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## MAPS with Folium" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [], + "source": [ + "import folium\n", + "from folium import plugins" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [], + "source": [ + "#Reading clean dataset\n", + "df=pd.read_csv(\"dataset_clean.csv\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Clustering with a Heat Map in Seattle Great Area " + ] + }, + { + "cell_type": "code", + "execution_count": 119, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 119, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating Heat Map\n", + "mapa = folium.Map([47.616415, -122.253495], zoom_start=12)\n", + "value_data = data[['latitude', 'longitude']].values\n", + "mapa.add_child(plugins.HeatMap(value_data, radius=15))\n", + "mapa" + ] + }, + { + "cell_type": "code", + "execution_count": 128, + "metadata": {}, + "outputs": [], + "source": [ + "#Saving map\n", + "mapa.save('heatmap.html')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Detail map of the Clusters in Seattle Great Area " + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[47.59993370000001, -122.3276962]" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating markers map step 1\n", + "locations = df[['latitude', 'longitude']]\n", + "locationlist = locations.values.tolist()\n", + "len(locationlist)\n", + "locationlist[7]" + ] + }, + { + "cell_type": "code", + "execution_count": 118, + "metadata": { + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 118, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating markers map step 2\n", + "\n", + "map = folium.Map(location=[47.616415, -122.253495], zoom_start=12)\n", + "for point in range(0, len(locationlist)):\n", + " folium.Marker(locationlist[point], popup=df['name'][point]).add_to(map)\n", + "map" + ] + }, + { + "cell_type": "code", + "execution_count": 129, + "metadata": {}, + "outputs": [], + "source": [ + "#Saving map\n", + "map.save('detail_clustering.html')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Detail map of the recommended area and Top 3 near competitors" + ] + }, + { + "cell_type": "code", + "execution_count": 124, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 124, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Generating specific location map with extra markers\n", + "m = folium.Map(\n", + " location=[47.604348, -122.331304],\n", + " tiles='cartodbpositron',\n", + " zoom_start=16\n", + ")\n", + "\n", + "folium.Circle(\n", + " radius=30,\n", + " location=[47.604348, -122.331304],\n", + " popup='Proposed Store',\n", + " color='crimson',\n", + " fill=False,\n", + ").add_to(m)\n", + "\n", + "folium.CircleMarker(\n", + " location=[47.604209, -122.331127],\n", + " radius=100,\n", + " popup='Main Cluster',\n", + " color='#3186cc',\n", + " fill=True,\n", + " fill_color='#3186cc'\n", + ").add_to(m)\n", + "\n", + "folium.Marker(\n", + " location=[47.605890, -122.332978],\n", + " popup='Belle Epicurean Bakery & Catering',\n", + " icon=folium.Icon(color='red', icon='glyphicon glyphicon-cutlery')\n", + ").add_to(m)\n", + "\n", + "folium.Marker(\n", + " location=[47.603655, -122.330642],\n", + " popup='Einstein Bros. Bagels',\n", + " icon=folium.Icon(color='red', icon='glyphicon glyphicon-cutlery')\n", + ").add_to(m)\n", + "\n", + "\n", + "folium.Marker(\n", + " location=[47.600032, -122.332845],\n", + " popup='The London Plane',\n", + " icon=folium.Icon(color='red', icon='glyphicon glyphicon-cutlery')\n", + ").add_to(m)\n", + "\n", + "m" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Location\n", + "#The best location with the client restrictions is the Columbia Tower, ground floor commercial area as is located\n", + "#in one of the main clusters of Seattle and close by to the original location of the client.\n", + "#This location is 861 sqf with a cost of $3.50 sqf/m\n", + "#This location is partially owner by Japanese-Americans also owners of super markets in the near-by area.\n", + "#They have special interest in the proyect and offered different incentives and discounts. \n", + "#Also, the map shows possible competitors that are in the same rank as our client. " + ] + }, + { + "cell_type": "code", + "execution_count": 130, + "metadata": {}, + "outputs": [], + "source": [ + "#Saving map\n", + "m.save('proposed_site.html')" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "metadata": {}, + "outputs": [], + "source": [ + "#end" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.7.7" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/module-2/python-bi-project/README(Ironhack).md b/module-2/python-bi-project/README(Ironhack).md new file mode 100755 index 0000000..6d13e20 --- /dev/null +++ b/module-2/python-bi-project/README(Ironhack).md @@ -0,0 +1,58 @@ +![IronHack Logo](https://s3-eu-west-1.amazonaws.com/ih-materials/uploads/upload_d5c5793015fec3be28a63c4fa3dd4d55.png) + +# Project: Business Intelligence with Python + +## Overview + +The goal of this project is for you to apply the things that we have learned in the previous lessons in data visualizations with python and derive Business Intelligence insights. For this project, you will choose a data set and explore it using Python. You will put together a Story using different visualizations for presentation showing the insights you have derived from the data. You should demonstrate your proficiency using Python and the concepts you have learned throughout the chapter. + +**You will be working individually for this project**, but we'll be guiding you along the process and helping you as you go. Show us what you've got! + +--- + +## Technical Requirements + +The technical requirements for this project are as follows: + +* You must construct a Story using visualizations consisting of at least 5 different plots for the data set you have chosen. +* Choose a different visualizations types for each of the 5 plots. Try to implement the concepts that we covered in the chapter (sorting, filtering, different , aggregations, etc.) +* Save the file in the python-bi-project in Github, and your data should be saved to a folder named data. +* You should also include a README.md file that describes the steps you took, your thought process as you built your visualizations + +## Necessary Deliverables + +The following deliverables should be pushed to your Github repo for this chapter. + +* **A Jupyter notebook uploaded to Git Hub** that contains the visualizations you created from your data set. +* **A data folder** containing the data set you used for your project. +* **A ``README.md`` file** containing a detailed explanation of your approach and code for constructing visualizations and organizing them into a Story as well as your results, obstacles encountered, lessons learned, and a link to your completed Tableau workbook. + + +## Suggested Ways to Get Started + +* **Find a data set to process** - a great place to start looking would be [Awesome Public Data Sets](https://github.com/awesomedata/awesome-public-datasets) and [Kaggle Data Sets](https://www.kaggle.com/datasets). +* **Explore the data set** and come up with a variety of visualizations that you can potentially include in your story. +* **Break the project down into different steps** - identify the entities/dimensions in your data set, explore them each individually, and then progress to analyzing different combinations of them. +* **Use the tools in your tool kit** - the concepts and methods you have learned in the business intelligence chapter as well as some of the things you've learned in previous chapters. This is a great way to start tying everything you've learned together! +* **Work through the lessons in class** & ask questions when you need to! Think about adding relevant code to your project each night, instead of, you know... _procrastinating_. +* **Commit early, commit often**, don’t be afraid of doing something incorrectly because you can always roll back to a previous version. +* **Consult documentation and resources provided** to better understand the tools you are using and how to accomplish what you want. + + +## Project Feedback + Evaluation + +* __Technical Requirements__: Did you deliver a project that met all the technical requirements? Given what the class has covered so far, did you build something that was reasonably complex? + +* __Creativity__: Did you add a personal spin or creative element into your project submission? Did you incorporate domain knowledge or unique perspective into your analysis. + +* __Code Quality__: Did you follow code style guidance and best practices covered in class? + +* __Total__: Your instructors will give you a total score on your project between: + + **Score**|**Expectations** + -----|----- + 0|Does not meet expectations + 1|Meets expectactions, good job! + 2|Exceeds expectations, you wonderful creature, you! + +This will be useful as an overall gauge of whether you met the project goals, but __the more important scores are described in the specs above__, which can help you identify where to focus your efforts for the next project! diff --git a/module-2/python-bi-project/README.md b/module-2/python-bi-project/README.md old mode 100755 new mode 100644 index 6d13e20..514b328 --- a/module-2/python-bi-project/README.md +++ b/module-2/python-bi-project/README.md @@ -1,58 +1,82 @@ -![IronHack Logo](https://s3-eu-west-1.amazonaws.com/ih-materials/uploads/upload_d5c5793015fec3be28a63c4fa3dd4d55.png) +
-# Project: Business Intelligence with Python +------ -## Overview +
-The goal of this project is for you to apply the things that we have learned in the previous lessons in data visualizations with python and derive Business Intelligence insights. For this project, you will choose a data set and explore it using Python. You will put together a Story using different visualizations for presentation showing the insights you have derived from the data. You should demonstrate your proficiency using Python and the concepts you have learned throughout the chapter. +------ -**You will be working individually for this project**, but we'll be guiding you along the process and helping you as you go. Show us what you've got! ---- -## Technical Requirements +# Python-bi-project -The technical requirements for this project are as follows: +For this project, I chose a certain Japanese bakery with 107 years of history that originally started in Seattle, USA. As expansion project, they are interested in going back to Seattle, the company hometown and have a location where they can showcase their long history and be part of one of the most vibrant cities in the USA. -* You must construct a Story using visualizations consisting of at least 5 different plots for the data set you have chosen. -* Choose a different visualizations types for each of the 5 plots. Try to implement the concepts that we covered in the chapter (sorting, filtering, different , aggregations, etc.) -* Save the file in the python-bi-project in Github, and your data should be saved to a folder named data. -* You should also include a README.md file that describes the steps you took, your thought process as you built your visualizations +Seattle is home to some of the greatest companies in the world like Amazon, Boeing, Costco, Starbucks and others...is time to take our place too. -## Necessary Deliverables -The following deliverables should be pushed to your Github repo for this chapter. -* **A Jupyter notebook uploaded to Git Hub** that contains the visualizations you created from your data set. -* **A data folder** containing the data set you used for your project. -* **A ``README.md`` file** containing a detailed explanation of your approach and code for constructing visualizations and organizing them into a Story as well as your results, obstacles encountered, lessons learned, and a link to your completed Tableau workbook. +## Client Requirements +As mentioned before our client wants to be located in Seattle but is open to explore the Great Puget Sound Area best know as Seattle Great Area that includes the cities of Seattle, Bellevue, Redmond, and Kirkland. -## Suggested Ways to Get Started +- **Budget**: 3 million dollars as initial investment and setup -* **Find a data set to process** - a great place to start looking would be [Awesome Public Data Sets](https://github.com/awesomedata/awesome-public-datasets) and [Kaggle Data Sets](https://www.kaggle.com/datasets). -* **Explore the data set** and come up with a variety of visualizations that you can potentially include in your story. -* **Break the project down into different steps** - identify the entities/dimensions in your data set, explore them each individually, and then progress to analyzing different combinations of them. -* **Use the tools in your tool kit** - the concepts and methods you have learned in the business intelligence chapter as well as some of the things you've learned in previous chapters. This is a great way to start tying everything you've learned together! -* **Work through the lessons in class** & ask questions when you need to! Think about adding relevant code to your project each night, instead of, you know... _procrastinating_. -* **Commit early, commit often**, don’t be afraid of doing something incorrectly because you can always roll back to a previous version. -* **Consult documentation and resources provided** to better understand the tools you are using and how to accomplish what you want. +- **Restrictions**: +- - Must be located in a high foot traffic area. + - Must be located in a safe environment where Japanese employees can work peacefully without dealing with the negative aspects of Seattle. + - Must be located in a highly commercial area with preference in Seattle downtown or the International District. + - Must be located at the ground level (First floor) with: -## Project Feedback + Evaluation + - Street access + - Employees access + + - Parking area for clients is optional as longer the possible location is in a commercial area with easy street parking access. + + - Easy access for public and private transportation for customers and employees. + + - Multi-purpose commercial areas are preferable. + + - This store is a step-stone for future stores. + +- **Localization:** Seattle, Bellevue, Kirkland, Redmond. -* __Technical Requirements__: Did you deliver a project that met all the technical requirements? Given what the class has covered so far, did you build something that was reasonably complex? -* __Creativity__: Did you add a personal spin or creative element into your project submission? Did you incorporate domain knowledge or unique perspective into your analysis. -* __Code Quality__: Did you follow code style guidance and best practices covered in class? +## Project Steps -* __Total__: Your instructors will give you a total score on your project between: +**Jupyter notebook**: + +1. I defined a testing area where I can try my mongo queries, data frames and results manipulation. +2. Defined a specific query that helped me to find a possible cluster of companies as the product of the client is targetting middle and middle-high class workers. As the Great Seattle Area is home of large companies I wanted to find how these clusters are distributed in the area. +3. Once I got the query result I worked my wat to unwrap all info in a clean and clear data frame. +4. This data frame was added to Mongo for future reference. +5. With this data frame, I produced 2 maps: Heatmap and Markers map that allowed me to identify possible locations. +6. After, some extra research a location was chosen where all the conditions of the client are covered. + + + +## Files + +1. Mongo query's - Funnel.ipynb +2. dataset_clean.csv +3. dataset_clean.json +4. README.md +5. Maps: + 1. heatmap.html + 2. detail_clustering.html + 3. proposed_site.html + +## Author +``` +|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾| +| CODING FERRET | +|___________________| +(\__/) || +(•ㅅ•) || +/   づ +I'm a ferret, not a rabbit o(>ω<)o +``` - **Score**|**Expectations** - -----|----- - 0|Does not meet expectations - 1|Meets expectactions, good job! - 2|Exceeds expectations, you wonderful creature, you! -This will be useful as an overall gauge of whether you met the project goals, but __the more important scores are described in the specs above__, which can help you identify where to focus your efforts for the next project! diff --git a/module-2/python-bi-project/dataset_clean.csv b/module-2/python-bi-project/dataset_clean.csv new file mode 100644 index 0000000..b0ed67d --- /dev/null +++ b/module-2/python-bi-project/dataset_clean.csv @@ -0,0 +1,86 @@ +,name,number_of_employees,founded_year,city,latitude,longitude +0,Google,28000,1998.0,Seattle,47.675326,-122.351397 +1,Google,28000,1998.0,Seattle,47.649701,-122.350592 +2,Farecast,26,2003.0,Seattle,47.620982,-122.359397 +3,Newsvine,8,2005.0,Seattle,47.618599,-122.358484 +4,iLike,28,2002.0,Seattle,47.615313,-122.323408 +5,Redfin,100,2004.0,Seattle,47.603122,-122.333253 +6,Wishpot,10,2006.0,Seattle,47.620716,-122.347533 +7,PayScale,130,1999.0,Seattle,47.5999337,-122.3276962 +8,BuddyTV,20,2005.0,Seattle,47.61968,-122.356756 +9,dpreview,13,1998.0,Seattle,55.378051,-3.435973 +10,YouBeQB,8,2008.0,Bellevue,47.597965,-122.151158 +11,FlowPlay,30,2006.0,Seattle,47.6015315,-122.335943 +12,Zillow,600,2005.0,Seattle,47.6011125,-122.3293984 +13,Moz,130,2002.0,Seattle,47.620716,-122.347533 +14,AdReady,33,2006.0,Seattle,47.649027,-122.346299 +15,The Climate Corporation,150,2006.0,Seattle,47.5984767,-122.3331466 +16,Microsoft,90000,1974.0,Redmond,47.643583,-122.128585 +17,RealSelf,23,2006.0,Seattle,47.620716,-122.347533 +18,Snapvine,20,2005.0,Seattle,47.598968,-122.332904 +19,Livemocha,35,2007.0,Seattle,47.6399006,-122.1914274 +20,Expedia,4400,1996.0,Bellevue,47.58181,-122.154837 +21,eNotes,11,2004.0,Seattle,47.615313,-122.323408 +22,Survey Analytics,100,2003.0,Seattle,47.650674,-122.349863 +23,TalentSpring,9,2006.0,Seattle,47.680496,-122.120938 +24,Limeade,55,2006.0,Bellevue,47.6097449,-122.196699 +25,Movaya,20,2006.0,Seattle,47.66274,-122.300863 +26,LyfeSystems,9,2007.0,Seattle,47.634444,-122.3419 +27,Escapia,23,2000.0,Seattle,47.613896,-122.3413 +28,Shelfari,11,2006.0,Seattle,47.620716,-122.347533 +29,Evri,35,2007.0,Seattle,47.620716,-122.347533 +30,CarDomain Network,13,1999.0,Seattle,47.634741,-122.340435 +31,Seattle Software,6,2000.0,Seattle,47.625511,-122.344966 +32,Daptiv,150,1997.0,Seattle,47.604279,-122.337437 +33,TeachStreet,8,2007.0,Seattle,47.6171788,-122.3370801 +34,PurpleTrail,35,2007.0,Bellevue,47.584224,-122.19292 +35,Estately,6,2006.0,Seattle,47.273017,-120.882482 +36,Versaly Entertainment,15,2000.0,Bellevue,47.626479,-122.205149 +37,Intelius,131,2003.0,Bellevue,47.614723,-122.196262 +38,NitroDesk,8,2008.0,Bellevue,47.584975,-122.132013 +39,thePlatform,130,2000.0,Seattle,47.617838,-122.356027 +40,Synology,70,2000.0,Redmond,47.634824,-122.13771 +41,Avidian Technologies,30,2002.0,Redmond,47.628895,-122.138507 +42,DatStat,25,1997.0,Seattle,47.6490908,-122.3466877 +43,WebStarts,15,2007.0,Bellevue,27.937603,-82.2871293 +44,Likewise Software,50,2004.0,Bellevue,47.582658,-122.135282 +45,Onehub,10,2007.0,Seattle,47.580235,-122.145038 +46,Atigeo,50,2005.0,Bellevue,47.6174533,-122.2016685 +47,Swype,80,2002.0,Seattle,47.6495905,-122.3497956 +48,Likewise Software,50,2004.0,Bellevue,47.582658,-122.135282 +49,Onehub,10,2007.0,Seattle,47.580235,-122.145038 +50,Atigeo,50,2005.0,Bellevue,47.6174533,-122.2016685 +51,Swype,80,2002.0,Seattle,47.6495905,-122.3497956 +52,Pathable,18,2007.0,Seattle,47.657435,-122.324861 +53,F5 Networks,1650,1996.0,Seattle,47.622263,-122.363276 +54,Artefact,18,2006.0,Seattle,47.611718,-122.345874 +55,findwell,7,2008.0,Seattle,47.627368,-122.34229 +56,AskMe Corp,40,2000.0,Bellevue,47.582658,-122.135282 +57,Pharmacy OneSource,60,2001.0,Bellevue,47.579884,-122.168877 +58,NuWire,10,2007.0,Bellevue,47.615044,-122.171758 +59,Xeround,40,2005.0,Bellevue,47.5827406,-122.1353561 +60,Decho,150,2008.0,Seattle,47.6024156,-122.3326145 +61,Random Computers,18,1998.0,Seattle,47.611215,-122.3408776 +62,Ramp Technology Group,75,2000.0,Bellevue,47.61251,-122.1962236 +63,Produxs,10,2006.0,Seattle,47.5753035,-122.3342499 +64,Tableau Software,92,2003.0,Seattle,47.6504518,-122.3545086 +65,Aztecsoft,2000,1995.0,Bellevue,47.6314974,-122.1680127 +66,Good Technology,800,1996.0,Seattle,47.6246175,-122.35931 +67,Medio,90,2004.0,Seattle,47.611827,-122.331308 +68,Concur Technologies,1200,1993.0,Redmond,51.5200277,-0.651155 +69,Skytap,200,2006.0,Seattle,47.544341,-122.334732 +70,L4 Mobile,25,2008.0,Seattle,47.676762,-122.2049192 +71,Optify,45,2008.0,Seattle,47.603364,-122.333359 +72,NetMotion Wireless,107,2001.0,Seattle,47.649392,-122.3486837 +73,StoreBlogs,10,2009.0,Redmond,47.6859063,-122.141024 +74,Z2Live,130,2009.0,Seattle,47.6103008,-122.3399782 +75,ExtraHop Networks,50,2007.0,Seattle,47.6209107,-122.361239 +76,Nirvaha,14,2007.0,Bellevue,47.6008008,-122.3342585 +77,Altus Alliance,10,1999.0,Seattle,47.603176,-122.3333044 +78,Ingeniux,35,1999.0,Seattle,47.6146338,-122.3408187 +79,MAQ Software,250,2000.0,Redmond,47.632945,-122.133449 +80,Glympse,20,2008.0,Seattle,47.6220245,-122.3350847 +81,Voxmobili,80,1999.0,Bellevue,47.6138045,-122.1948914 +82,Optimum Energy,65,2005.0,Seattle,47.598657,-122.334614 +83,MicroVision,110,1993.0,Redmond,47.6614954,-122.0943198 +84,Netupdate,50,1998.0,Bellevue,47.6325767,-122.1537577 diff --git a/module-2/python-bi-project/dataset_clean.json b/module-2/python-bi-project/dataset_clean.json new file mode 100644 index 0000000..fd341ab --- /dev/null +++ b/module-2/python-bi-project/dataset_clean.json @@ -0,0 +1 @@ +{"name":{"0":"Google","1":"Google","2":"Farecast","3":"Newsvine","4":"iLike","5":"Redfin","6":"Wishpot","7":"PayScale","8":"BuddyTV","9":"dpreview","10":"YouBeQB","11":"FlowPlay","12":"Zillow","13":"Moz","14":"AdReady","15":"The Climate Corporation","16":"Microsoft","17":"RealSelf","18":"Snapvine","19":"Livemocha","20":"Expedia","21":"eNotes","22":"Survey Analytics","23":"TalentSpring","24":"Limeade","25":"Movaya","26":"LyfeSystems","27":"Escapia","28":"Shelfari","29":"Evri","30":"CarDomain Network","31":"Seattle Software","32":"Daptiv","33":"TeachStreet","34":"PurpleTrail","35":"Estately","36":"Versaly Entertainment","37":"Intelius","38":"NitroDesk","39":"thePlatform","40":"Synology","41":"Avidian Technologies","42":"DatStat","43":"WebStarts","44":"Likewise Software","45":"Onehub","46":"Atigeo","47":"Swype","48":"Likewise Software","49":"Onehub","50":"Atigeo","51":"Swype","52":"Pathable","53":"F5 Networks","54":"Artefact","55":"findwell","56":"AskMe Corp","57":"Pharmacy OneSource","58":"NuWire","59":"Xeround","60":"Decho","61":"Random Computers","62":"Ramp Technology Group","63":"Produxs","64":"Tableau Software","65":"Aztecsoft","66":"Good Technology","67":"Medio","68":"Concur Technologies","69":"Skytap","70":"L4 Mobile","71":"Optify","72":"NetMotion Wireless","73":"StoreBlogs","74":"Z2Live","75":"ExtraHop Networks","76":"Nirvaha","77":"Altus Alliance","78":"Ingeniux","79":"MAQ Software","80":"Glympse","81":"Voxmobili","82":"Optimum Energy","83":"MicroVision","84":"Netupdate"},"number_of_employees":{"0":28000,"1":28000,"2":26,"3":8,"4":28,"5":100,"6":10,"7":130,"8":20,"9":13,"10":8,"11":30,"12":600,"13":130,"14":33,"15":150,"16":90000,"17":23,"18":20,"19":35,"20":4400,"21":11,"22":100,"23":9,"24":55,"25":20,"26":9,"27":23,"28":11,"29":35,"30":13,"31":6,"32":150,"33":8,"34":35,"35":6,"36":15,"37":131,"38":8,"39":130,"40":70,"41":30,"42":25,"43":15,"44":50,"45":10,"46":50,"47":80,"48":50,"49":10,"50":50,"51":80,"52":18,"53":1650,"54":18,"55":7,"56":40,"57":60,"58":10,"59":40,"60":150,"61":18,"62":75,"63":10,"64":92,"65":2000,"66":800,"67":90,"68":1200,"69":200,"70":25,"71":45,"72":107,"73":10,"74":130,"75":50,"76":14,"77":10,"78":35,"79":250,"80":20,"81":80,"82":65,"83":110,"84":50},"founded_year":{"0":1998.0,"1":1998.0,"2":2003.0,"3":2005.0,"4":2002.0,"5":2004.0,"6":2006.0,"7":1999.0,"8":2005.0,"9":1998.0,"10":2008.0,"11":2006.0,"12":2005.0,"13":2002.0,"14":2006.0,"15":2006.0,"16":1974.0,"17":2006.0,"18":2005.0,"19":2007.0,"20":1996.0,"21":2004.0,"22":2003.0,"23":2006.0,"24":2006.0,"25":2006.0,"26":2007.0,"27":2000.0,"28":2006.0,"29":2007.0,"30":1999.0,"31":2000.0,"32":1997.0,"33":2007.0,"34":2007.0,"35":2006.0,"36":2000.0,"37":2003.0,"38":2008.0,"39":2000.0,"40":2000.0,"41":2002.0,"42":1997.0,"43":2007.0,"44":2004.0,"45":2007.0,"46":2005.0,"47":2002.0,"48":2004.0,"49":2007.0,"50":2005.0,"51":2002.0,"52":2007.0,"53":1996.0,"54":2006.0,"55":2008.0,"56":2000.0,"57":2001.0,"58":2007.0,"59":2005.0,"60":2008.0,"61":1998.0,"62":2000.0,"63":2006.0,"64":2003.0,"65":1995.0,"66":1996.0,"67":2004.0,"68":1993.0,"69":2006.0,"70":2008.0,"71":2008.0,"72":2001.0,"73":2009.0,"74":2009.0,"75":2007.0,"76":2007.0,"77":1999.0,"78":1999.0,"79":2000.0,"80":2008.0,"81":1999.0,"82":2005.0,"83":1993.0,"84":1998.0},"city":{"0":"Seattle","1":"Seattle","2":"Seattle","3":"Seattle","4":"Seattle","5":"Seattle","6":"Seattle","7":"Seattle","8":"Seattle","9":"Seattle","10":"Bellevue","11":"Seattle","12":"Seattle","13":"Seattle","14":"Seattle","15":"Seattle","16":"Redmond","17":"Seattle","18":"Seattle","19":"Seattle","20":"Bellevue","21":"Seattle","22":"Seattle","23":"Seattle","24":"Bellevue","25":"Seattle","26":"Seattle","27":"Seattle","28":"Seattle","29":"Seattle","30":"Seattle","31":"Seattle","32":"Seattle","33":"Seattle","34":"Bellevue","35":"Seattle","36":"Bellevue","37":"Bellevue","38":"Bellevue","39":"Seattle","40":"Redmond","41":"Redmond","42":"Seattle","43":"Bellevue","44":"Bellevue","45":"Seattle","46":"Bellevue","47":"Seattle","48":"Bellevue","49":"Seattle","50":"Bellevue","51":"Seattle","52":"Seattle","53":"Seattle","54":"Seattle","55":"Seattle","56":"Bellevue","57":"Bellevue","58":"Bellevue","59":"Bellevue","60":"Seattle","61":"Seattle","62":"Bellevue","63":"Seattle","64":"Seattle","65":"Bellevue","66":"Seattle","67":"Seattle","68":"Redmond","69":"Seattle","70":"Seattle","71":"Seattle","72":"Seattle","73":"Redmond","74":"Seattle","75":"Seattle","76":"Bellevue","77":"Seattle","78":"Seattle","79":"Redmond","80":"Seattle","81":"Bellevue","82":"Seattle","83":"Redmond","84":"Bellevue"},"latitude":{"0":47.675326,"1":47.649701,"2":47.620982,"3":47.618599,"4":47.615313,"5":47.603122,"6":47.620716,"7":47.5999337,"8":47.61968,"9":55.378051,"10":47.597965,"11":47.6015315,"12":47.6011125,"13":47.620716,"14":47.649027,"15":47.5984767,"16":47.643583,"17":47.620716,"18":47.598968,"19":47.6399006,"20":47.58181,"21":47.615313,"22":47.650674,"23":47.680496,"24":47.6097449,"25":47.66274,"26":47.634444,"27":47.613896,"28":47.620716,"29":47.620716,"30":47.634741,"31":47.625511,"32":47.604279,"33":47.6171788,"34":47.584224,"35":47.273017,"36":47.626479,"37":47.614723,"38":47.584975,"39":47.617838,"40":47.634824,"41":47.628895,"42":47.6490908,"43":27.937603,"44":47.582658,"45":47.580235,"46":47.6174533,"47":47.6495905,"48":47.582658,"49":47.580235,"50":47.6174533,"51":47.6495905,"52":47.657435,"53":47.622263,"54":47.611718,"55":47.627368,"56":47.582658,"57":47.579884,"58":47.615044,"59":47.5827406,"60":47.6024156,"61":47.611215,"62":47.61251,"63":47.5753035,"64":47.6504518,"65":47.6314974,"66":47.6246175,"67":47.611827,"68":51.5200277,"69":47.544341,"70":47.676762,"71":47.603364,"72":47.649392,"73":47.6859063,"74":47.6103008,"75":47.6209107,"76":47.6008008,"77":47.603176,"78":47.6146338,"79":47.632945,"80":47.6220245,"81":47.6138045,"82":47.598657,"83":47.6614954,"84":47.6325767},"longitude":{"0":-122.351397,"1":-122.350592,"2":-122.359397,"3":-122.358484,"4":-122.323408,"5":-122.333253,"6":-122.347533,"7":-122.3276962,"8":-122.356756,"9":-3.435973,"10":-122.151158,"11":-122.335943,"12":-122.3293984,"13":-122.347533,"14":-122.346299,"15":-122.3331466,"16":-122.128585,"17":-122.347533,"18":-122.332904,"19":-122.1914274,"20":-122.154837,"21":-122.323408,"22":-122.349863,"23":-122.120938,"24":-122.196699,"25":-122.300863,"26":-122.3419,"27":-122.3413,"28":-122.347533,"29":-122.347533,"30":-122.340435,"31":-122.344966,"32":-122.337437,"33":-122.3370801,"34":-122.19292,"35":-120.882482,"36":-122.205149,"37":-122.196262,"38":-122.132013,"39":-122.356027,"40":-122.13771,"41":-122.138507,"42":-122.3466877,"43":-82.2871293,"44":-122.135282,"45":-122.145038,"46":-122.2016685,"47":-122.3497956,"48":-122.135282,"49":-122.145038,"50":-122.2016685,"51":-122.3497956,"52":-122.324861,"53":-122.363276,"54":-122.345874,"55":-122.34229,"56":-122.135282,"57":-122.168877,"58":-122.171758,"59":-122.1353561,"60":-122.3326145,"61":-122.3408776,"62":-122.1962236,"63":-122.3342499,"64":-122.3545086,"65":-122.1680127,"66":-122.35931,"67":-122.331308,"68":-0.651155,"69":-122.334732,"70":-122.2049192,"71":-122.333359,"72":-122.3486837,"73":-122.141024,"74":-122.3399782,"75":-122.361239,"76":-122.3342585,"77":-122.3333044,"78":-122.3408187,"79":-122.133449,"80":-122.3350847,"81":-122.1948914,"82":-122.334614,"83":-122.0943198,"84":-122.1537577}} \ No newline at end of file diff --git a/module-2/python-bi-project/detail_clustering.html b/module-2/python-bi-project/detail_clustering.html new file mode 100644 index 0000000..e7d064b --- /dev/null +++ b/module-2/python-bi-project/detail_clustering.html @@ -0,0 +1,1678 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/module-2/python-bi-project/heatmap.html b/module-2/python-bi-project/heatmap.html new file mode 100644 index 0000000..f3a71ae --- /dev/null +++ b/module-2/python-bi-project/heatmap.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/module-2/python-bi-project/proposed_site.html b/module-2/python-bi-project/proposed_site.html new file mode 100644 index 0000000..f59e1f6 --- /dev/null +++ b/module-2/python-bi-project/proposed_site.html @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file