Skip to content

Instantly share code, notes, and snippets.

@jazzido
Last active January 24, 2020 22:27
Show Gist options
  • Save jazzido/35990ebf8c236d3df953eb1f0af9e39c to your computer and use it in GitHub Desktop.
Save jazzido/35990ebf8c236d3df953eb1f0af9e39c to your computer and use it in GitHub Desktop.
¿Quién fabrica lo que compramos?
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ¿Quién fabrica lo que compramos?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Los códigos de barras de los productos que compramos contienen información sobre la empresa que los distribuye, empaca o fabrica. En este breve ejercicio, vamos a intentar combinar una lista de productos tomada del sitio público [Precios Claros](https://www.preciosclaros.gob.ar/) con una lista de compañías compilada por el proyecto [Product Open Data](http://www.product-open-data.com/).\n",
"\n",
"Los identificadores de productos en _preciosclaros.gob.ar_ son, en la mayoría de los casos, el código de barras del producto. Para extraer el campo [GCP (Global Company Prefix)](http://www.gs1.org/company-prefix) del identificador, vamos a usar la librería [`gtin`](https://pypi.python.org/pypi/gtin/0.1.4)."
]
},
{
"cell_type": "code",
"execution_count": 98,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd\n",
"from gtin import GTIN"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Leemos la lista de productos, y agradecemos a nuestro anónimo amigo que se tomó el trabajo de _scrapear_ Precios Claros."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"df = pd.read_csv('productos_precios_claros.csv')\n",
"df.loc[:, 'uuid'] = df.uuid.apply(lambda s: s.split('producto-')[1])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Agregamos una columna que contendrá, si es posible, el campo GCP."
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def gg(gtin):\n",
" try:\n",
" g = GTIN(gtin)\n",
" except:\n",
" return None\n",
" \n",
" try:\n",
" return g.get_gcp()\n",
" except:\n",
" return None\n",
"\n",
"df.loc[:, 'gcp'] = df.uuid.apply(lambda u: gg(u))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Calculamos una agregación de la tabla anterior, calculando dos variables adicionales:\n",
"\n",
" - `marca`: un conjunto de marcas asociadas a un `GCP`\n",
" - `product_count`: cantidad de productos asociados a un `GCP`"
]
},
{
"cell_type": "code",
"execution_count": 115,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"products_by_gcp = df \\\n",
" .groupby(['gcp'], as_index=False) \\\n",
" .agg({\n",
" 'marca': lambda m: set(m), \n",
" 'uuid': 'count'\n",
" }) \\\n",
" .rename(columns={'uuid': 'product_count'}) \\\n",
" .sort_values(by='product_count', ascending=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Leemos la base de datos de GCPs obtenida de [Product Open Data](http://product-open-data.com). Lamentablemente, la última versión es de 2013 y su cobertura para fabricantes argentinos es bastante mala."
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"gepir = pd.read_csv('/Users/manuel/Downloads/gs1_gcp.csv', \n",
" dtype={'GCP_CD': str, 'GLN_CD': str}, \n",
" low_memory=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"…y la combinamos con nuestra lista de GCPs (`products_by_gcp`)."
]
},
{
"cell_type": "code",
"execution_count": 116,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"merged = products_by_gcp.merge(gepir, how='inner', left_on='gcp', right_on='GCP_CD')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Verificamos qué porcentaje de GCPs pudimos encontrar en la base de datos:"
]
},
{
"cell_type": "code",
"execution_count": 129,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"66.34615384615384\n"
]
}
],
"source": [
"n_matched_gcps = len(merged[~merged.GLN_NM.isnull()])\n",
"total_gcps = len(products_by_gcp)\n",
"print((n_matched_gcps / total_gcps) * 100)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Filtramos la lista para mostrar solamente las compañías que pudimos encontrar"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"out = merged[~merged.GLN_NM.isnull()][['gcp', 'product_count', 'marca', 'GLN_NM', 'GLN_COUNTRY_ISO_CD']]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Le agregamos la bandera del país"
]
},
{
"cell_type": "code",
"execution_count": 131,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"OFFSET = ord('🇦') - ord('A')\n",
"def flag(code):\n",
" return chr(ord(code[0]) + OFFSET) + chr(ord(code[1]) + OFFSET)\n",
"\n",
"out.loc[:, 'country_flag'] = out['GLN_COUNTRY_ISO_CD'].apply(flag)"
]
},
{
"cell_type": "code",
"execution_count": 134,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>gcp</th>\n",
" <th>product_count</th>\n",
" <th>marca</th>\n",
" <th>GLN_NM</th>\n",
" <th>GLN_COUNTRY_ISO_CD</th>\n",
" <th>country_flag</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>8480017</td>\n",
" <td>1009</td>\n",
" <td>{GROLS, CUQUE, NAN, CARO AMICI, S.OND, CROCK, ...</td>\n",
" <td>DIA</td>\n",
" <td>ES</td>\n",
" <td>🇪🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>4005808</td>\n",
" <td>29</td>\n",
" <td>{NIVEA}</td>\n",
" <td>Beiersdorf AG</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>0070330</td>\n",
" <td>18</td>\n",
" <td>{BIC , BIC}</td>\n",
" <td>BIC USA Inc.</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>4052899</td>\n",
" <td>10</td>\n",
" <td>{OSRAM, DULUX}</td>\n",
" <td>OSRAM GmbH CRM&amp;S MDS P-W</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>301426</td>\n",
" <td>10</td>\n",
" <td>{ZOOTH, GILLETTE, ORAL B}</td>\n",
" <td>PROCTER ET GAMBLE FRANCE SAS</td>\n",
" <td>FR</td>\n",
" <td>🇫🇷</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>75010074</td>\n",
" <td>7</td>\n",
" <td>{KOLESTON, ALWAYS, PANTENE}</td>\n",
" <td>CORPORATIVO PROCTER &amp; GAMBLE, S. DE R.L. DE C....</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>4008321</td>\n",
" <td>7</td>\n",
" <td>{OSRAM, DULUX}</td>\n",
" <td>OSRAM GmbH</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>75010067</td>\n",
" <td>6</td>\n",
" <td>{PAMPERS, PANTENE}</td>\n",
" <td>CORPORATIVO PROCTER &amp; GAMBLE, S. DE R.L. DE C....</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>7509546</td>\n",
" <td>6</td>\n",
" <td>{PROTEX, COLGATE, PALMOLIVE}</td>\n",
" <td>COLGATE PALMOLIVE, S.A. DE C.V. COLGATE PALMOLIVE</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>0038000</td>\n",
" <td>6</td>\n",
" <td>{PRINGLES}</td>\n",
" <td>Kellogg Company</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>8413600</td>\n",
" <td>5</td>\n",
" <td>{VEET}</td>\n",
" <td>RECKITT BENCKISER</td>\n",
" <td>ES</td>\n",
" <td>🇪🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>0047400</td>\n",
" <td>5</td>\n",
" <td>{GILLETTE}</td>\n",
" <td>Procter &amp; Gamble Company</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>75010092</td>\n",
" <td>5</td>\n",
" <td>{GILLETTE, PRESTOBARBA}</td>\n",
" <td>NEWELL RUBBERMAID DE MEXICO, S. DE R.L. DE C.V...</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>75010563</td>\n",
" <td>5</td>\n",
" <td>{PONDS, SEDAL}</td>\n",
" <td>UNILEVER DE MEXICO, S. DE R.L. DE C.V. UNILEVER</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>4005900</td>\n",
" <td>5</td>\n",
" <td>{NIVEA}</td>\n",
" <td>Beiersdorf AG</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>0041789</td>\n",
" <td>5</td>\n",
" <td>{MARUCHAN}</td>\n",
" <td>Maruchan, Inc.</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>75010592</td>\n",
" <td>4</td>\n",
" <td>{COFFEE MATE, NESCAFE}</td>\n",
" <td>NESTLE MEXICO, S.A. DE C.V. NESTLE MEXICO, S.A...</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>0000075</td>\n",
" <td>4</td>\n",
" <td>{CORONA, DOVE, REXONA}</td>\n",
" <td>ASOCIACION MEXICANA DE ESTANDARES PARA EL COME...</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>0041333</td>\n",
" <td>4</td>\n",
" <td>{DURAC}</td>\n",
" <td>Procter &amp; Gamble Company</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>0084773</td>\n",
" <td>4</td>\n",
" <td>{ROBINSON CRUSOE}</td>\n",
" <td>Trans Antartic Trading Co Ltda</td>\n",
" <td>CL</td>\n",
" <td>🇨🇱</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>8718291</td>\n",
" <td>3</td>\n",
" <td>{PHILI}</td>\n",
" <td>Philips Electronics Nederland B.V.</td>\n",
" <td>NL</td>\n",
" <td>🇳🇱</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>75010011</td>\n",
" <td>3</td>\n",
" <td>{HEAD &amp; SHOULDERS, PANTENE}</td>\n",
" <td>CORPORATIVO PROCTER &amp; GAMBLE, S. DE R.L. DE C....</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>0040000</td>\n",
" <td>3</td>\n",
" <td>{M &amp; M, SKITTLES}</td>\n",
" <td>Mars Chocolate North America LLC</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>8710163</td>\n",
" <td>3</td>\n",
" <td>{PHILI}</td>\n",
" <td>Philips Electronics Nederland B.V.</td>\n",
" <td>NL</td>\n",
" <td>🇳🇱</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>8710103</td>\n",
" <td>3</td>\n",
" <td>{PHILI}</td>\n",
" <td>Philips Electronics Nederland B.V.</td>\n",
" <td>NL</td>\n",
" <td>🇳🇱</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>0000080</td>\n",
" <td>3</td>\n",
" <td>{KINDER}</td>\n",
" <td>Indicod-Ecr - GS1 Italy</td>\n",
" <td>IT</td>\n",
" <td>🇮🇹</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>75010086</td>\n",
" <td>2</td>\n",
" <td>{BACARDI}</td>\n",
" <td>BACARDI Y COMPAÑIA, S.A. DE C.V. BACARDI</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>75010012</td>\n",
" <td>2</td>\n",
" <td>{HEAD &amp; SHOULDERS}</td>\n",
" <td>CORPORATIVO PROCTER &amp; GAMBLE, S. DE R.L. DE C....</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>75010013</td>\n",
" <td>2</td>\n",
" <td>{OLD SPICE, PANTENE}</td>\n",
" <td>CORPORATIVO PROCTER &amp; GAMBLE, S. DE R.L. DE C....</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>9044400</td>\n",
" <td>2</td>\n",
" <td>{PEZ}</td>\n",
" <td>PEZ International GmbH</td>\n",
" <td>AT</td>\n",
" <td>🇦🇹</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>8712581</td>\n",
" <td>2</td>\n",
" <td>{PHILI}</td>\n",
" <td>Philips Electronics Nederland B.V.</td>\n",
" <td>NL</td>\n",
" <td>🇳🇱</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>75010864</td>\n",
" <td>2</td>\n",
" <td>{PRO}</td>\n",
" <td>CORPORATIVO PROCTER &amp; GAMBLE, S. DE R.L. DE C....</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>7591083</td>\n",
" <td>2</td>\n",
" <td>{COLGATE}</td>\n",
" <td>COLGATE-PALMOLIVE C.A</td>\n",
" <td>VE</td>\n",
" <td>🇻🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>0021200</td>\n",
" <td>2</td>\n",
" <td>{SCOTCH BRITE}</td>\n",
" <td>3M Company</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>0071603</td>\n",
" <td>2</td>\n",
" <td>{TRIM}</td>\n",
" <td>Pacific World Corporation</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>08452180</td>\n",
" <td>2</td>\n",
" <td>{VULCA, SIN MARCA}</td>\n",
" <td>GS1 China</td>\n",
" <td>CN</td>\n",
" <td>🇨🇳</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>0070501</td>\n",
" <td>2</td>\n",
" <td>{NEUTROGENA}</td>\n",
" <td>Neutrogena Corporation</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>0022000</td>\n",
" <td>2</td>\n",
" <td>{WRIGLEYS}</td>\n",
" <td>Wm. Wrigley Jr. Company</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>4015400</td>\n",
" <td>2</td>\n",
" <td>{PAMPERS}</td>\n",
" <td>Procter &amp; Gamble GmbH Wasch- u. Reinigungsmittel</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>0079400</td>\n",
" <td>2</td>\n",
" <td>{REXONA}</td>\n",
" <td>Unilever Home and Personal Care USA</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>5000329</td>\n",
" <td>2</td>\n",
" <td>{BEEFEATER}</td>\n",
" <td>Chivas Brothers Limited</td>\n",
" <td>GB</td>\n",
" <td>🇬🇧</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>0012800</td>\n",
" <td>1</td>\n",
" <td>{RAYOV}</td>\n",
" <td>Spectrum Brands, Inc.</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>9002490</td>\n",
" <td>1</td>\n",
" <td>{RED BULL}</td>\n",
" <td>Red Bull GmbH</td>\n",
" <td>AT</td>\n",
" <td>🇦🇹</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50</th>\n",
" <td>0079200</td>\n",
" <td>1</td>\n",
" <td>{NERDS}</td>\n",
" <td>Sunmark</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>51</th>\n",
" <td>0000040</td>\n",
" <td>1</td>\n",
" <td>{KINDER}</td>\n",
" <td>Nestlé Deutschland AG</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>52</th>\n",
" <td>0070942</td>\n",
" <td>1</td>\n",
" <td>{GUM}</td>\n",
" <td>Sunstar Americas, Inc.</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>53</th>\n",
" <td>8412300</td>\n",
" <td>1</td>\n",
" <td>{NIVEA}</td>\n",
" <td>BEIERSDORF MANUFACTURING TRES CANTO</td>\n",
" <td>ES</td>\n",
" <td>🇪🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>54</th>\n",
" <td>8715200</td>\n",
" <td>1</td>\n",
" <td>{NIVEA}</td>\n",
" <td>Beiersdorf N.V.</td>\n",
" <td>NL</td>\n",
" <td>🇳🇱</td>\n",
" </tr>\n",
" <tr>\n",
" <th>55</th>\n",
" <td>0051000</td>\n",
" <td>1</td>\n",
" <td>{sin marca}</td>\n",
" <td>Campbell Soup Company</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>57</th>\n",
" <td>0080432</td>\n",
" <td>1</td>\n",
" <td>{CHIVAS REGAL}</td>\n",
" <td>Pernod Ricard USA LLC</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>58</th>\n",
" <td>0016304</td>\n",
" <td>1</td>\n",
" <td>{SIN MARCA}</td>\n",
" <td>Unofficial Guides Ltd.</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>59</th>\n",
" <td>0013000</td>\n",
" <td>1</td>\n",
" <td>{HEINZ}</td>\n",
" <td>Heinz USA</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>60</th>\n",
" <td>0099176</td>\n",
" <td>1</td>\n",
" <td>{COLGATE}</td>\n",
" <td>Colgate Palmolive (Central America) S.A.</td>\n",
" <td>GT</td>\n",
" <td>🇬🇹</td>\n",
" </tr>\n",
" <tr>\n",
" <th>61</th>\n",
" <td>0090159</td>\n",
" <td>1</td>\n",
" <td>{MAIST}</td>\n",
" <td>May Cheong Toy Products Factory Limited</td>\n",
" <td>HK</td>\n",
" <td>🇭🇰</td>\n",
" </tr>\n",
" <tr>\n",
" <th>62</th>\n",
" <td>75010587</td>\n",
" <td>1</td>\n",
" <td>{sin marca}</td>\n",
" <td>RECKITT BENCKISER MEXICO, S.A. DE C.V. RECKITT...</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>63</th>\n",
" <td>5900273</td>\n",
" <td>1</td>\n",
" <td>{COLGATE}</td>\n",
" <td>Colgate-Palmolive (Poland) Sp. z o.o.</td>\n",
" <td>PL</td>\n",
" <td>🇵🇱</td>\n",
" </tr>\n",
" <tr>\n",
" <th>64</th>\n",
" <td>5410316</td>\n",
" <td>1</td>\n",
" <td>{SMIRNOFF}</td>\n",
" <td>DIAGEO SCOTLAND LTD</td>\n",
" <td>GB</td>\n",
" <td>🇬🇧</td>\n",
" </tr>\n",
" <tr>\n",
" <th>65</th>\n",
" <td>5011013</td>\n",
" <td>1</td>\n",
" <td>{BAILEYS}</td>\n",
" <td>GS1 Ireland</td>\n",
" <td>IE</td>\n",
" <td>🇮🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>66</th>\n",
" <td>5010103</td>\n",
" <td>1</td>\n",
" <td>{J&amp;B}</td>\n",
" <td>Diageo PLC</td>\n",
" <td>GB</td>\n",
" <td>🇬🇧</td>\n",
" </tr>\n",
" <tr>\n",
" <th>67</th>\n",
" <td>75010080</td>\n",
" <td>1</td>\n",
" <td>{CHOCO KRISPIS }</td>\n",
" <td>KELLOGG COMPANY MEXICO, S. DE R.L.DE C.V. KELLOGG</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>68</th>\n",
" <td>75010152</td>\n",
" <td>1</td>\n",
" <td>{PELIK}</td>\n",
" <td>PELIKAN MEXICO, S.A. DE C.V. PELIKAN</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>69</th>\n",
" <td>75010329</td>\n",
" <td>1</td>\n",
" <td>{GLADE}</td>\n",
" <td>S.C. JOHNSON AND SON S.A. DE C.V. S.C. JOHNSON...</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>70</th>\n",
" <td>4006584</td>\n",
" <td>1</td>\n",
" <td>{L.B.L}</td>\n",
" <td>OSRAM GmbH CRM&amp;S MDS P-W</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>71</th>\n",
" <td>75010641</td>\n",
" <td>1</td>\n",
" <td>{CORONA}</td>\n",
" <td>CERVECERIA MODELO, S. DE R.L. DE C.V. CERVECER...</td>\n",
" <td>MX</td>\n",
" <td>🇲🇽</td>\n",
" </tr>\n",
" <tr>\n",
" <th>72</th>\n",
" <td>4005800</td>\n",
" <td>1</td>\n",
" <td>{NIVEA}</td>\n",
" <td>Beiersdorf AG</td>\n",
" <td>DE</td>\n",
" <td>🇩🇪</td>\n",
" </tr>\n",
" <tr>\n",
" <th>73</th>\n",
" <td>303371</td>\n",
" <td>1</td>\n",
" <td>{NESCAFE}</td>\n",
" <td>NESTLE FRANCE SAS</td>\n",
" <td>FR</td>\n",
" <td>🇫🇷</td>\n",
" </tr>\n",
" <tr>\n",
" <th>74</th>\n",
" <td>0742832</td>\n",
" <td>1</td>\n",
" <td>{AOC}</td>\n",
" <td>Tufftek</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>76</th>\n",
" <td>0681326</td>\n",
" <td>1</td>\n",
" <td>{SIN MARCA}</td>\n",
" <td>Jazwares</td>\n",
" <td>US</td>\n",
" <td>🇺🇸</td>\n",
" </tr>\n",
" <tr>\n",
" <th>77</th>\n",
" <td>7590002</td>\n",
" <td>1</td>\n",
" <td>{ALWAYS}</td>\n",
" <td>PROCTER &amp; GAMBLE DE VENEZUELA, S.C.A.</td>\n",
" <td>VE</td>\n",
" <td>🇻🇪</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" gcp product_count \\\n",
"0 8480017 1009 \n",
"2 4005808 29 \n",
"3 0070330 18 \n",
"5 4052899 10 \n",
"6 301426 10 \n",
"9 75010074 7 \n",
"10 4008321 7 \n",
"12 75010067 6 \n",
"13 7509546 6 \n",
"14 0038000 6 \n",
"15 8413600 5 \n",
"16 0047400 5 \n",
"17 75010092 5 \n",
"18 75010563 5 \n",
"19 4005900 5 \n",
"20 0041789 5 \n",
"21 75010592 4 \n",
"22 0000075 4 \n",
"23 0041333 4 \n",
"24 0084773 4 \n",
"25 8718291 3 \n",
"26 75010011 3 \n",
"27 0040000 3 \n",
"29 8710163 3 \n",
"30 8710103 3 \n",
"31 0000080 3 \n",
"32 75010086 2 \n",
"33 75010012 2 \n",
"34 75010013 2 \n",
"35 9044400 2 \n",
"36 8712581 2 \n",
"37 75010864 2 \n",
"38 7591083 2 \n",
"39 0021200 2 \n",
"41 0071603 2 \n",
"42 08452180 2 \n",
"43 0070501 2 \n",
"44 0022000 2 \n",
"45 4015400 2 \n",
"46 0079400 2 \n",
"47 5000329 2 \n",
"48 0012800 1 \n",
"49 9002490 1 \n",
"50 0079200 1 \n",
"51 0000040 1 \n",
"52 0070942 1 \n",
"53 8412300 1 \n",
"54 8715200 1 \n",
"55 0051000 1 \n",
"57 0080432 1 \n",
"58 0016304 1 \n",
"59 0013000 1 \n",
"60 0099176 1 \n",
"61 0090159 1 \n",
"62 75010587 1 \n",
"63 5900273 1 \n",
"64 5410316 1 \n",
"65 5011013 1 \n",
"66 5010103 1 \n",
"67 75010080 1 \n",
"68 75010152 1 \n",
"69 75010329 1 \n",
"70 4006584 1 \n",
"71 75010641 1 \n",
"72 4005800 1 \n",
"73 303371 1 \n",
"74 0742832 1 \n",
"76 0681326 1 \n",
"77 7590002 1 \n",
"\n",
" marca \\\n",
"0 {GROLS, CUQUE, NAN, CARO AMICI, S.OND, CROCK, ... \n",
"2 {NIVEA} \n",
"3 {BIC , BIC} \n",
"5 {OSRAM, DULUX} \n",
"6 {ZOOTH, GILLETTE, ORAL B} \n",
"9 {KOLESTON, ALWAYS, PANTENE} \n",
"10 {OSRAM, DULUX} \n",
"12 {PAMPERS, PANTENE} \n",
"13 {PROTEX, COLGATE, PALMOLIVE} \n",
"14 {PRINGLES} \n",
"15 {VEET} \n",
"16 {GILLETTE} \n",
"17 {GILLETTE, PRESTOBARBA} \n",
"18 {PONDS, SEDAL} \n",
"19 {NIVEA} \n",
"20 {MARUCHAN} \n",
"21 {COFFEE MATE, NESCAFE} \n",
"22 {CORONA, DOVE, REXONA} \n",
"23 {DURAC} \n",
"24 {ROBINSON CRUSOE} \n",
"25 {PHILI} \n",
"26 {HEAD & SHOULDERS, PANTENE} \n",
"27 {M & M, SKITTLES} \n",
"29 {PHILI} \n",
"30 {PHILI} \n",
"31 {KINDER} \n",
"32 {BACARDI} \n",
"33 {HEAD & SHOULDERS} \n",
"34 {OLD SPICE, PANTENE} \n",
"35 {PEZ} \n",
"36 {PHILI} \n",
"37 {PRO} \n",
"38 {COLGATE} \n",
"39 {SCOTCH BRITE} \n",
"41 {TRIM} \n",
"42 {VULCA, SIN MARCA} \n",
"43 {NEUTROGENA} \n",
"44 {WRIGLEYS} \n",
"45 {PAMPERS} \n",
"46 {REXONA} \n",
"47 {BEEFEATER} \n",
"48 {RAYOV} \n",
"49 {RED BULL} \n",
"50 {NERDS} \n",
"51 {KINDER} \n",
"52 {GUM} \n",
"53 {NIVEA} \n",
"54 {NIVEA} \n",
"55 {sin marca} \n",
"57 {CHIVAS REGAL} \n",
"58 {SIN MARCA} \n",
"59 {HEINZ} \n",
"60 {COLGATE} \n",
"61 {MAIST} \n",
"62 {sin marca} \n",
"63 {COLGATE} \n",
"64 {SMIRNOFF} \n",
"65 {BAILEYS} \n",
"66 {J&B} \n",
"67 {CHOCO KRISPIS } \n",
"68 {PELIK} \n",
"69 {GLADE} \n",
"70 {L.B.L} \n",
"71 {CORONA} \n",
"72 {NIVEA} \n",
"73 {NESCAFE} \n",
"74 {AOC} \n",
"76 {SIN MARCA} \n",
"77 {ALWAYS} \n",
"\n",
" GLN_NM GLN_COUNTRY_ISO_CD \\\n",
"0 DIA ES \n",
"2 Beiersdorf AG DE \n",
"3 BIC USA Inc. US \n",
"5 OSRAM GmbH CRM&S MDS P-W DE \n",
"6 PROCTER ET GAMBLE FRANCE SAS FR \n",
"9 CORPORATIVO PROCTER & GAMBLE, S. DE R.L. DE C.... MX \n",
"10 OSRAM GmbH DE \n",
"12 CORPORATIVO PROCTER & GAMBLE, S. DE R.L. DE C.... MX \n",
"13 COLGATE PALMOLIVE, S.A. DE C.V. COLGATE PALMOLIVE MX \n",
"14 Kellogg Company US \n",
"15 RECKITT BENCKISER ES \n",
"16 Procter & Gamble Company US \n",
"17 NEWELL RUBBERMAID DE MEXICO, S. DE R.L. DE C.V... MX \n",
"18 UNILEVER DE MEXICO, S. DE R.L. DE C.V. UNILEVER MX \n",
"19 Beiersdorf AG DE \n",
"20 Maruchan, Inc. US \n",
"21 NESTLE MEXICO, S.A. DE C.V. NESTLE MEXICO, S.A... MX \n",
"22 ASOCIACION MEXICANA DE ESTANDARES PARA EL COME... MX \n",
"23 Procter & Gamble Company US \n",
"24 Trans Antartic Trading Co Ltda CL \n",
"25 Philips Electronics Nederland B.V. NL \n",
"26 CORPORATIVO PROCTER & GAMBLE, S. DE R.L. DE C.... MX \n",
"27 Mars Chocolate North America LLC US \n",
"29 Philips Electronics Nederland B.V. NL \n",
"30 Philips Electronics Nederland B.V. NL \n",
"31 Indicod-Ecr - GS1 Italy IT \n",
"32 BACARDI Y COMPAÑIA, S.A. DE C.V. BACARDI MX \n",
"33 CORPORATIVO PROCTER & GAMBLE, S. DE R.L. DE C.... MX \n",
"34 CORPORATIVO PROCTER & GAMBLE, S. DE R.L. DE C.... MX \n",
"35 PEZ International GmbH AT \n",
"36 Philips Electronics Nederland B.V. NL \n",
"37 CORPORATIVO PROCTER & GAMBLE, S. DE R.L. DE C.... MX \n",
"38 COLGATE-PALMOLIVE C.A VE \n",
"39 3M Company US \n",
"41 Pacific World Corporation US \n",
"42 GS1 China CN \n",
"43 Neutrogena Corporation US \n",
"44 Wm. Wrigley Jr. Company US \n",
"45 Procter & Gamble GmbH Wasch- u. Reinigungsmittel DE \n",
"46 Unilever Home and Personal Care USA US \n",
"47 Chivas Brothers Limited GB \n",
"48 Spectrum Brands, Inc. US \n",
"49 Red Bull GmbH AT \n",
"50 Sunmark US \n",
"51 Nestlé Deutschland AG DE \n",
"52 Sunstar Americas, Inc. US \n",
"53 BEIERSDORF MANUFACTURING TRES CANTO ES \n",
"54 Beiersdorf N.V. NL \n",
"55 Campbell Soup Company US \n",
"57 Pernod Ricard USA LLC US \n",
"58 Unofficial Guides Ltd. US \n",
"59 Heinz USA US \n",
"60 Colgate Palmolive (Central America) S.A. GT \n",
"61 May Cheong Toy Products Factory Limited HK \n",
"62 RECKITT BENCKISER MEXICO, S.A. DE C.V. RECKITT... MX \n",
"63 Colgate-Palmolive (Poland) Sp. z o.o. PL \n",
"64 DIAGEO SCOTLAND LTD GB \n",
"65 GS1 Ireland IE \n",
"66 Diageo PLC GB \n",
"67 KELLOGG COMPANY MEXICO, S. DE R.L.DE C.V. KELLOGG MX \n",
"68 PELIKAN MEXICO, S.A. DE C.V. PELIKAN MX \n",
"69 S.C. JOHNSON AND SON S.A. DE C.V. S.C. JOHNSON... MX \n",
"70 OSRAM GmbH CRM&S MDS P-W DE \n",
"71 CERVECERIA MODELO, S. DE R.L. DE C.V. CERVECER... MX \n",
"72 Beiersdorf AG DE \n",
"73 NESTLE FRANCE SAS FR \n",
"74 Tufftek US \n",
"76 Jazwares US \n",
"77 PROCTER & GAMBLE DE VENEZUELA, S.C.A. VE \n",
"\n",
" country_flag \n",
"0 🇪🇸 \n",
"2 🇩🇪 \n",
"3 🇺🇸 \n",
"5 🇩🇪 \n",
"6 🇫🇷 \n",
"9 🇲🇽 \n",
"10 🇩🇪 \n",
"12 🇲🇽 \n",
"13 🇲🇽 \n",
"14 🇺🇸 \n",
"15 🇪🇸 \n",
"16 🇺🇸 \n",
"17 🇲🇽 \n",
"18 🇲🇽 \n",
"19 🇩🇪 \n",
"20 🇺🇸 \n",
"21 🇲🇽 \n",
"22 🇲🇽 \n",
"23 🇺🇸 \n",
"24 🇨🇱 \n",
"25 🇳🇱 \n",
"26 🇲🇽 \n",
"27 🇺🇸 \n",
"29 🇳🇱 \n",
"30 🇳🇱 \n",
"31 🇮🇹 \n",
"32 🇲🇽 \n",
"33 🇲🇽 \n",
"34 🇲🇽 \n",
"35 🇦🇹 \n",
"36 🇳🇱 \n",
"37 🇲🇽 \n",
"38 🇻🇪 \n",
"39 🇺🇸 \n",
"41 🇺🇸 \n",
"42 🇨🇳 \n",
"43 🇺🇸 \n",
"44 🇺🇸 \n",
"45 🇩🇪 \n",
"46 🇺🇸 \n",
"47 🇬🇧 \n",
"48 🇺🇸 \n",
"49 🇦🇹 \n",
"50 🇺🇸 \n",
"51 🇩🇪 \n",
"52 🇺🇸 \n",
"53 🇪🇸 \n",
"54 🇳🇱 \n",
"55 🇺🇸 \n",
"57 🇺🇸 \n",
"58 🇺🇸 \n",
"59 🇺🇸 \n",
"60 🇬🇹 \n",
"61 🇭🇰 \n",
"62 🇲🇽 \n",
"63 🇵🇱 \n",
"64 🇬🇧 \n",
"65 🇮🇪 \n",
"66 🇬🇧 \n",
"67 🇲🇽 \n",
"68 🇲🇽 \n",
"69 🇲🇽 \n",
"70 🇩🇪 \n",
"71 🇲🇽 \n",
"72 🇩🇪 \n",
"73 🇫🇷 \n",
"74 🇺🇸 \n",
"76 🇺🇸 \n",
"77 🇻🇪 "
]
},
"execution_count": 134,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.set_option('display.max_rows', len(out))\n",
"out"
]
},
{
"cell_type": "code",
"execution_count": 105,
"metadata": {
"collapsed": false
},
"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.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment