{ "cells": [ { "cell_type": "markdown", "id": "0e8a1768", "metadata": {}, "source": [ "# A price analysis of coffee\n", "\n", "- cpc = cost per cup (18gr of coffee per cup)\n", "- cpc_250g = cost per cup when buying 250g bag (13.88 cups per bag)\n", "- cpc_1kg = cost per cup when buying 1kg bag (55.55 cups per bag)\n", "\n", "All prices in €, as of march 1, 2024, as found on the brand websites.\n", "\n", "11 shops, 86 coffees in total" ] }, { "cell_type": "code", "execution_count": 1, "id": "7bc98ea6", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
shopnameurlcountrytypeprocessnotes250gr1kgcpc_250gcpc_1kg
0coffee circlehouse blendhttps://www.coffeecircle.com/en/k/house-blend-...brazil, laos, colombia, congoblendnaturalCharacterful | Marzipan, Nougat9.9033.900.710.61
1coffee circlesidamohttps://www.coffeecircle.com/en/k/sidamo-espressoethiopiasonaturalLively | Caramel, Dark Berries10.9036.900.780.66
2coffee circlecerradohttps://www.coffeecircle.com/en/k/cerradobrazilsonaturalVelvety | Hazelnut, Sweet Fruits10.9036.900.780.66
3coffee circletiga terra omniroasthttps://www.coffeecircle.com/en/k/tiga-terrabrazil, guinea, indonesiablendnaturalFull-bodied | Chocolate, Walnut11.9040.900.860.74
4coffee circleyirga santoshttps://www.coffeecircle.com/en/k/yirga-santos...india, brazil, ethiopiablend(mixed)Strong | Chocolate, Brown Sugar9.9033.900.710.61
5coffee circlepacashttps://www.coffeecircle.com/en/k/pacasel salvadorsowashedBalanced | Hazelnut, Nougat14.9050.901.070.92
6coffee circlefeliciano castillohttps://www.coffeecircle.com/en/k/feliciano-ca...hondurassowashedVelvety | Dark Chocolate, Pecan Nut14.9050.901.070.92
7coffee circleespresso chirehttps://www.coffeecircle.com/en/k/chire-espressoethiopiasonaturalVelvety | Lime, Strawberry14.9050.901.070.92
8coffee circlegrano gayohttps://www.coffeecircle.com/en/k/grano-gayo-e...peru, indonesia, colombiablendwashedStrong | Brown Sugar, Tiramisu10.9036.900.780.66
9coffee circlefrancisco lopezhttps://www.coffeecircle.com/en/k/francisco-lo...guatemalasowashedCreamy | Almond, Chocolate14.9050.901.070.92
10coffee circleespresso decafhttps://www.coffeecircle.com/en/k/decaf-espres...colombiasowashedWell-Balanced | Cinnamon, Chocolate Cookie10.9036.900.780.66
11coffee circleyirga santos decafhttps://www.coffeecircle.com/en/k/yirga-santos...ethiopiasonaturalStrong | Chocolate, Brown Sugar11.9040.900.860.74
12fjordhouse blendhttps://fjord-coffee.de/products/house-blendbrazil, perublend(mixed)chocolatey tones and a fruity highlights12.9041.500.930.75
13fjordsamii arichahttps://fjord-coffee.de/products/ethiopia-sami...ethiopiasowashedButterscotch, White Peach, Sultana20.9071.901.501.29
14fjordkii abhttps://fjord-coffee.de/products/kenya-kii-ab-...kenyasowashedCranberry, Red Currant, Hibiscus20.9073.901.501.33
15fjordpuente solayahttps://fjord-coffee.de/products/peru-puente-s...perusowashedMilk Chocolate, Cherry, Clementine14.9049.901.070.90
16fjordfes red bourbonhttps://fjord-coffee.de/products/el-salvador-f...el salvadorsonaturalCaramel, Pink Lady, White Peach18.9062.901.361.13
17fjordmi minahttps://fjord-coffee.de/products/honduras-mi-m...hondurassonaturalCocoa, Cashew, Blueberry16.9058.901.221.06
18fjordfrancisco becerrahttps://fjord-coffee.de/products/colombia-fran...colombiasowashedRaspberry, Citrus, Red Apple17.9060.901.291.10
19five elephanthouse blendhttps://www.fiveelephant.com/collections/espre...el salvadorblendNaNorange, bittersweet cacao nibs and mellow cham...10.1933.550.730.60
20five elephantcyesha washedhttps://www.fiveelephant.com/collections/espre...rwandasowashedrose water, red apple, panela16.9049.821.220.90
21five elephantnandi hillshttps://www.fiveelephant.com/collections/espre...kenyasowashedgoji berry, candied apple, hibiscus16.9046.451.220.84
22five elephantdecaf omni roasthttps://www.fiveelephant.com/collections/espre...colombiasowashedchoc chip cookie, roasted hazelnut, and juicy ...14.5042.901.040.77
23bonanza coffeeblendhttps://shop.bonanzacoffee.de/products/bonanza...brazil, perublendwashedCHOCOLATE TRUFFLE & DARK CHERRY13.9045.501.000.82
24bonanza coffeenairobihttps://shop.bonanzacoffee.de/collections/coff...colombiasowashedNECTARINE, PLUM JAM & NOUGAT16.9067.601.221.22
25bonanza coffeekathima abhttps://shop.bonanzacoffee.de/collections/coff...kenyasowashedRASPBERRY, BLOOD ORANGE, MAPLE SYRUP17.9071.601.291.29
26bonanza coffeefinca rabanaleshttps://shop.bonanzacoffee.de/collections/coff...guatemalasohoneyCANDIED ALMOND, CARAMEL, PAPAYA15.9053.501.140.96
27bonanza coffeecaballerohttps://shop.bonanzacoffee.de/collections/coff...hondurassowashedTOFFEE, HAZELNUT CREAM, GOLDEN RAISIN15.9063.601.141.14
28bonanza coffeesamii chelbesahttps://shop.bonanzacoffee.de/collections/coff...ethiopiasowashedHONEY MELON, LEMON CURD & DARJEELING TEA17.9071.601.291.29
29bonanza coffeegogoguhttps://shop.bonanzacoffee.de/collections/coff...ethiopiasonaturalMILK CHOCOLATE, BROWN SUGAR & NECTARINE16.9057.501.221.04
30bonanza coffeesitio vargem grandehttps://shop.bonanzacoffee.de/collections/coff...brazilsoanaerobicTOFFEE, DARK CHOCOLATE & STRAWBERRY JAM15.9053.501.140.96
31bonanza coffeeel carmenhttps://shop.bonanzacoffee.de/collections/coff...colombiasowashedRED APPLE, ALMOND & MOLASSES15.9053.501.140.96
32bonanza coffeedark roasthttps://shop.bonanzacoffee.de/collections/coff...brazilsonaturalDARK CHOCOLATE12.9041.500.930.75
33the barnboa vistahttps://thebarn.de/products/boa-vistabrazilsonaturalChocolate. Brazil Nut. Fudge.14.0053.001.010.95
34the barncruz gordahttps://thebarn.de/products/cruz-gordael salvadorsonaturalChocolate Ganache. Cherry. Rich.14.5058.001.041.04
35the barnla colinahttps://thebarn.de/products/la-colinaguatemalasowashedChocolate. Citrus. Velvety.14.5058.001.041.04
36the barngigesahttps://thebarn.de/products/gigesaethiopiasowashedPeach. Elderflower. Silky.15.0060.001.081.08
37the barncaballerohttps://thebarn.de/products/caballerohondurassowashedNougat. Macadamia. Vanilla.15.0060.001.081.08
38the barngiakanja abhttps://thebarn.de/products/giakanja-ab-espressokenyasowashedBlackberry. Vanilla. Bold.15.5062.001.121.12
39the barnhuye mountainhttps://thebarn.de/products/huye-mountain-naturalrwandasonaturalCherries. Raisin.15.5062.001.121.12
40the barnmohamed ali naturalhttps://thebarn.de/products/mohamed-ali-naturalethiopiasonaturalStrawberry. Chocolate. Creamy.16.0064.001.151.15
41the barndaterra reserve low cafhttps://thebarn.de/products/daterra-reservebrazilsonaturalcherry jam, nougat18.0072.001.301.30
4219 gramsCafé des Mamas - Women's Day Specialhttps://19grams.coffee/en/products/cafe-des-ma...rwandasonaturalBlueberry, Mango, Coconut18.9075.601.361.36
4319 gramslos tres potros SL28https://19grams.coffee/en/products/los-tres-po...el salvadorsonaturalYellow Plum, Gooseberry, Cashew18.9064.901.361.17
4419 gramsla montanahttps://19grams.coffee/en/products/la-montana-...el salvadorsonaturalRaspberry, Toffee, Milk Chocolate16.9057.901.221.04
4519 gramsla esperanzahttps://19grams.coffee/en/products/la-esperanz...perusowashedFigs, Wild Honey, Clementine13.9047.901.000.86
4619 gramsorang utanhttps://19grams.coffee/en/products/orang-utan-...indonesiasowashedCaramel, Apple, Dark chocolate12.9043.900.930.79
4719 gramsdecafhttps://19grams.coffee/en/products/entkoffeini...colombiasowashedRipe figs, Brown sugar, Dark chocolate12.9043.900.930.79
4819 gramswild at hearthttps://19grams.coffee/en/products/wild-at-heartbrazil, ethiopiablend(mixed)Caramel, Strawberry, Chocolate11.9047.600.860.86
4919 gramsendless summerhttps://19grams.coffee/en/products/endless-sum...nicaraguasowashedCocoa, Melon, Cane sugar10.9037.900.780.68
5019 gramslittle flowerhttps://19grams.coffee/en/products/little-flow...indiasowashedCocoa, Hazelnut , Marzipan9.9033.900.710.61
5119 gramsitalo discohttps://19grams.coffee/en/products/italo-disco...brazilsonaturalDark Chocolate, Caramel, Cherry Jam9.9039.600.710.71
52populusguji highlandhttps://www.populus.coffee/product-page/ethiop...ethiopiasonaturalStrawberry, pomegranate, dried fig15.9057.501.141.04
53populusluz mariahttps://www.populus.coffee/product-page/mexico...mexicosohoneyBergamot, Honeydew, Mandarine15.9057.501.141.04
54populuskhalid shifahttps://www.populus.coffee/product-page/ethiop...ethiopiasohoneyBergamot, honeydew and mandarine15.9057.501.141.04
55populusoreti estate aahttps://www.populus.coffee/product-page/kenya-...kenyasowashedBlack currants, rose hips, persimmon16.5059.901.191.08
56populusandrade broshttps://www.populus.coffee/product-page/brazil...brazilsonaturalCacao nibs, pineapple, rose14.5051.901.040.93
57populusbig shothttps://www.populus.coffee/product-page/big-shotbrazil, hondurasblend(mixed)Dark chocolate, Medjool dates, red apple11.9042.500.860.77
58populuszeitgeisthttps://www.populus.coffee/product-page/zeitgeistel salvador, ethiopiablend(mixed)dried cherry, cacao nibs, hazelnut butter11.9042.500.860.77
59populuspeace easy (decaf)https://www.populus.coffee/product-page/peace-...colombiablendsugarcaneCreamy, milk chocolatey, smooth, cherry, molas...11.9042.500.860.77
60cebesanta catarinahttps://www.cebecoffeeroasters.com/product-pag...brazilsonaturalbanana13.5040.500.970.73
61cebesonarahttps://www.cebecoffeeroasters.com/product-pag...costa ricasohoneystone fruit, cacao powder, watermelon15.0045.001.080.81
62cebedanisahttps://www.cebecoffeeroasters.com/product-pag...ethiopiasonaturalMixed berries, bergamot, dark chocolate14.5043.501.040.78
63cebecuzcatlecohttps://www.cebecoffeeroasters.com/product-pag...el salvadorsohoneyHoney, Pineapple Round body15.0045.001.080.81
64cebecaucahttps://www.cebecoffeeroasters.com/product-pag...colombiasoanaerobicBerry like, Dried Plum, Cacao, Vanila17.5070.001.261.26
65passengerblendhttps://www.passenger-coffee.de/shop/espressob...brazil, india, indonesia, guatemala, ethiopiablendNaNcrunchy nuts, butter-soaked spices, mild berri...9.5032.000.680.58
66passengerblend 2https://www.passenger-coffee.de/shop/espressob...colombia, mexico, kenyablendNaNhoneyed and floral note, orange and blackcurrant10.5035.000.760.63
67passengerrawhttps://www.passenger-coffee.de/shop/espressob...timor-leste, mexico, rwanda, burundiblendNaNNaN11.5038.000.830.68
68passengerdecafhttps://www.passenger-coffee.de/shop/espressob...colombiasoNaNcherry bomb with nuances of dried dates and da...9.5032.000.680.58
69passengertimor-lestehttps://www.passenger-coffee.de/shop/espressob...timor-lestesoNaNfloral flavors accompanied by baked plums10.5035.000.760.63
70passengermexicohttps://www.passenger-coffee.de/shop/espressob...mexicosoNaNchocolate, traces of mango and a bite of mandarin10.5035.000.760.63
71passengerburundihttps://www.passenger-coffee.de/shop/espressob...burundisoNaNcherry and red currant10.5035.000.760.63
72passengercubanohttps://www.passenger-coffee.de/shop/espressob...cubasoNaNmilk chocolate, complemented with hints of nut...10.5035.000.760.63
73flying roastersnightingalehttps://www.flyingroasters.de/en/shop/nighting...honduras, guatemala, indiablend(mixed)fruity notes paired with bitter chocolate and ...8.2031.300.590.56
74flying roastersblackcaphttps://www.flyingroasters.de/en/shop/blackcap...peru, guatemala, sumatrablendNaNchocolate and cocoa with notes of black currant8.2031.300.590.56
75flying roastershummingbirdhttps://www.flyingroasters.de/en/shop/hummingb...perusowashedred berries aromas, sweet with nuts and nougat8.3031.700.600.57
76flying roasterspearl kitehttps://www.flyingroasters.de/en/shop/pearl-ki...hondurasblend(mixed)cherry-cognac and lots of nougat8.3033.200.600.60
77flying roastersjocotocohttps://www.flyingroasters.de/en/shop/espresso...colombiasowashedcaramel and orange notes8.3033.200.600.60
78flying roastersnapcaphttps://www.flyingroasters.de/en/shop/napcap/peru, guatemala, sumatrablendNaNchocolate and cocoa with notes of black currant8.9035.600.640.64
79nano kaffeenano pleasurehttps://nano-kaffee.de/products/nano-pleasure-...brazil, colombiablend(mixed)nougat, cocoa and sweet10.5034.000.760.61
80nano kaffeeo passarohttps://nano-kaffee.de/products/brasil-o-passa...brazilsonaturaldark chocolate, nutty and berry12.9036.000.930.65
81nano kaffeefabrica de nubeshttps://nano-kaffee.de/products/colombia-fabri...colombiasowashedchocolate with a slight sweetness from figs12.9044.000.930.79
82nano kaffeekabirahttps://nano-kaffee.de/products/ethiopia-kabir...ethiopiasonaturalripe mango and blueberries13.8047.800.990.86
83nano kaffeedecafhttps://nano-kaffee.de/products/colombia-decafcolombiablend(mixed)dark chocolate, cherries and dates11.9039.000.860.70
84nano kaffeerio negrohttps://nano-kaffee.de/products/guatemala-rio-...guatemalasowashedred apple, sugar cane and dark chocolate12.9039.000.930.70
85nano kaffeegachatha aahttps://nano-kaffee.de/products/kenya-gachatha-aakenyasowashedgreen grapes, brown sugar15.8055.901.141.01
\n", "
" ], "text/plain": [ " shop name \\\n", "0 coffee circle house blend \n", "1 coffee circle sidamo \n", "2 coffee circle cerrado \n", "3 coffee circle tiga terra omniroast \n", "4 coffee circle yirga santos \n", "5 coffee circle pacas \n", "6 coffee circle feliciano castillo \n", "7 coffee circle espresso chire \n", "8 coffee circle grano gayo \n", "9 coffee circle francisco lopez \n", "10 coffee circle espresso decaf \n", "11 coffee circle yirga santos decaf \n", "12 fjord house blend \n", "13 fjord samii aricha \n", "14 fjord kii ab \n", "15 fjord puente solaya \n", "16 fjord fes red bourbon \n", "17 fjord mi mina \n", "18 fjord francisco becerra \n", "19 five elephant house blend \n", "20 five elephant cyesha washed \n", "21 five elephant nandi hills \n", "22 five elephant decaf omni roast \n", "23 bonanza coffee blend \n", "24 bonanza coffee nairobi \n", "25 bonanza coffee kathima ab \n", "26 bonanza coffee finca rabanales \n", "27 bonanza coffee caballero \n", "28 bonanza coffee samii chelbesa \n", "29 bonanza coffee gogogu \n", "30 bonanza coffee sitio vargem grande \n", "31 bonanza coffee el carmen \n", "32 bonanza coffee dark roast \n", "33 the barn boa vista \n", "34 the barn cruz gorda \n", "35 the barn la colina \n", "36 the barn gigesa \n", "37 the barn caballero \n", "38 the barn giakanja ab \n", "39 the barn huye mountain \n", "40 the barn mohamed ali natural \n", "41 the barn daterra reserve low caf \n", "42 19 grams Café des Mamas - Women's Day Special \n", "43 19 grams los tres potros SL28 \n", "44 19 grams la montana \n", "45 19 grams la esperanza \n", "46 19 grams orang utan \n", "47 19 grams decaf \n", "48 19 grams wild at heart \n", "49 19 grams endless summer \n", "50 19 grams little flower \n", "51 19 grams italo disco \n", "52 populus guji highland \n", "53 populus luz maria \n", "54 populus khalid shifa \n", "55 populus oreti estate aa \n", "56 populus andrade bros \n", "57 populus big shot \n", "58 populus zeitgeist \n", "59 populus peace easy (decaf) \n", "60 cebe santa catarina \n", "61 cebe sonara \n", "62 cebe danisa \n", "63 cebe cuzcatleco \n", "64 cebe cauca \n", "65 passenger blend \n", "66 passenger blend 2 \n", "67 passenger raw \n", "68 passenger decaf \n", "69 passenger timor-leste \n", "70 passenger mexico \n", "71 passenger burundi \n", "72 passenger cubano \n", "73 flying roasters nightingale \n", "74 flying roasters blackcap \n", "75 flying roasters hummingbird \n", "76 flying roasters pearl kite \n", "77 flying roasters jocotoco \n", "78 flying roasters napcap \n", "79 nano kaffee nano pleasure \n", "80 nano kaffee o passaro \n", "81 nano kaffee fabrica de nubes \n", "82 nano kaffee kabira \n", "83 nano kaffee decaf \n", "84 nano kaffee rio negro \n", "85 nano kaffee gachatha aa \n", "\n", " url \\\n", "0 https://www.coffeecircle.com/en/k/house-blend-... \n", "1 https://www.coffeecircle.com/en/k/sidamo-espresso \n", "2 https://www.coffeecircle.com/en/k/cerrado \n", "3 https://www.coffeecircle.com/en/k/tiga-terra \n", "4 https://www.coffeecircle.com/en/k/yirga-santos... \n", "5 https://www.coffeecircle.com/en/k/pacas \n", "6 https://www.coffeecircle.com/en/k/feliciano-ca... \n", "7 https://www.coffeecircle.com/en/k/chire-espresso \n", "8 https://www.coffeecircle.com/en/k/grano-gayo-e... \n", "9 https://www.coffeecircle.com/en/k/francisco-lo... \n", "10 https://www.coffeecircle.com/en/k/decaf-espres... \n", "11 https://www.coffeecircle.com/en/k/yirga-santos... \n", "12 https://fjord-coffee.de/products/house-blend \n", "13 https://fjord-coffee.de/products/ethiopia-sami... \n", "14 https://fjord-coffee.de/products/kenya-kii-ab-... \n", "15 https://fjord-coffee.de/products/peru-puente-s... \n", "16 https://fjord-coffee.de/products/el-salvador-f... \n", "17 https://fjord-coffee.de/products/honduras-mi-m... \n", "18 https://fjord-coffee.de/products/colombia-fran... \n", "19 https://www.fiveelephant.com/collections/espre... \n", "20 https://www.fiveelephant.com/collections/espre... \n", "21 https://www.fiveelephant.com/collections/espre... \n", "22 https://www.fiveelephant.com/collections/espre... \n", "23 https://shop.bonanzacoffee.de/products/bonanza... \n", "24 https://shop.bonanzacoffee.de/collections/coff... \n", "25 https://shop.bonanzacoffee.de/collections/coff... \n", "26 https://shop.bonanzacoffee.de/collections/coff... \n", "27 https://shop.bonanzacoffee.de/collections/coff... \n", "28 https://shop.bonanzacoffee.de/collections/coff... \n", "29 https://shop.bonanzacoffee.de/collections/coff... \n", "30 https://shop.bonanzacoffee.de/collections/coff... \n", "31 https://shop.bonanzacoffee.de/collections/coff... \n", "32 https://shop.bonanzacoffee.de/collections/coff... \n", "33 https://thebarn.de/products/boa-vista \n", "34 https://thebarn.de/products/cruz-gorda \n", "35 https://thebarn.de/products/la-colina \n", "36 https://thebarn.de/products/gigesa \n", "37 https://thebarn.de/products/caballero \n", "38 https://thebarn.de/products/giakanja-ab-espresso \n", "39 https://thebarn.de/products/huye-mountain-natural \n", "40 https://thebarn.de/products/mohamed-ali-natural \n", "41 https://thebarn.de/products/daterra-reserve \n", "42 https://19grams.coffee/en/products/cafe-des-ma... \n", "43 https://19grams.coffee/en/products/los-tres-po... \n", "44 https://19grams.coffee/en/products/la-montana-... \n", "45 https://19grams.coffee/en/products/la-esperanz... \n", "46 https://19grams.coffee/en/products/orang-utan-... \n", "47 https://19grams.coffee/en/products/entkoffeini... \n", "48 https://19grams.coffee/en/products/wild-at-heart \n", "49 https://19grams.coffee/en/products/endless-sum... \n", "50 https://19grams.coffee/en/products/little-flow... \n", "51 https://19grams.coffee/en/products/italo-disco... \n", "52 https://www.populus.coffee/product-page/ethiop... \n", "53 https://www.populus.coffee/product-page/mexico... \n", "54 https://www.populus.coffee/product-page/ethiop... \n", "55 https://www.populus.coffee/product-page/kenya-... \n", "56 https://www.populus.coffee/product-page/brazil... \n", "57 https://www.populus.coffee/product-page/big-shot \n", "58 https://www.populus.coffee/product-page/zeitgeist \n", "59 https://www.populus.coffee/product-page/peace-... \n", "60 https://www.cebecoffeeroasters.com/product-pag... \n", "61 https://www.cebecoffeeroasters.com/product-pag... \n", "62 https://www.cebecoffeeroasters.com/product-pag... \n", "63 https://www.cebecoffeeroasters.com/product-pag... \n", "64 https://www.cebecoffeeroasters.com/product-pag... \n", "65 https://www.passenger-coffee.de/shop/espressob... \n", "66 https://www.passenger-coffee.de/shop/espressob... \n", "67 https://www.passenger-coffee.de/shop/espressob... \n", "68 https://www.passenger-coffee.de/shop/espressob... \n", "69 https://www.passenger-coffee.de/shop/espressob... \n", "70 https://www.passenger-coffee.de/shop/espressob... \n", "71 https://www.passenger-coffee.de/shop/espressob... \n", "72 https://www.passenger-coffee.de/shop/espressob... \n", "73 https://www.flyingroasters.de/en/shop/nighting... \n", "74 https://www.flyingroasters.de/en/shop/blackcap... \n", "75 https://www.flyingroasters.de/en/shop/hummingb... \n", "76 https://www.flyingroasters.de/en/shop/pearl-ki... \n", "77 https://www.flyingroasters.de/en/shop/espresso... \n", "78 https://www.flyingroasters.de/en/shop/napcap/ \n", "79 https://nano-kaffee.de/products/nano-pleasure-... \n", "80 https://nano-kaffee.de/products/brasil-o-passa... \n", "81 https://nano-kaffee.de/products/colombia-fabri... \n", "82 https://nano-kaffee.de/products/ethiopia-kabir... \n", "83 https://nano-kaffee.de/products/colombia-decaf \n", "84 https://nano-kaffee.de/products/guatemala-rio-... \n", "85 https://nano-kaffee.de/products/kenya-gachatha-aa \n", "\n", " country type process \\\n", "0 brazil, laos, colombia, congo blend natural \n", "1 ethiopia so natural \n", "2 brazil so natural \n", "3 brazil, guinea, indonesia blend natural \n", "4 india, brazil, ethiopia blend (mixed) \n", "5 el salvador so washed \n", "6 honduras so washed \n", "7 ethiopia so natural \n", "8 peru, indonesia, colombia blend washed \n", "9 guatemala so washed \n", "10 colombia so washed \n", "11 ethiopia so natural \n", "12 brazil, peru blend (mixed) \n", "13 ethiopia so washed \n", "14 kenya so washed \n", "15 peru so washed \n", "16 el salvador so natural \n", "17 honduras so natural \n", "18 colombia so washed \n", "19 el salvador blend NaN \n", "20 rwanda so washed \n", "21 kenya so washed \n", "22 colombia so washed \n", "23 brazil, peru blend washed \n", "24 colombia so washed \n", "25 kenya so washed \n", "26 guatemala so honey \n", "27 honduras so washed \n", "28 ethiopia so washed \n", "29 ethiopia so natural \n", "30 brazil so anaerobic \n", "31 colombia so washed \n", "32 brazil so natural \n", "33 brazil so natural \n", "34 el salvador so natural \n", "35 guatemala so washed \n", "36 ethiopia so washed \n", "37 honduras so washed \n", "38 kenya so washed \n", "39 rwanda so natural \n", "40 ethiopia so natural \n", "41 brazil so natural \n", "42 rwanda so natural \n", "43 el salvador so natural \n", "44 el salvador so natural \n", "45 peru so washed \n", "46 indonesia so washed \n", "47 colombia so washed \n", "48 brazil, ethiopia blend (mixed) \n", "49 nicaragua so washed \n", "50 india so washed \n", "51 brazil so natural \n", "52 ethiopia so natural \n", "53 mexico so honey \n", "54 ethiopia so honey \n", "55 kenya so washed \n", "56 brazil so natural \n", "57 brazil, honduras blend (mixed) \n", "58 el salvador, ethiopia blend (mixed) \n", "59 colombia blend sugarcane \n", "60 brazil so natural \n", "61 costa rica so honey \n", "62 ethiopia so natural \n", "63 el salvador so honey \n", "64 colombia so anaerobic \n", "65 brazil, india, indonesia, guatemala, ethiopia blend NaN \n", "66 colombia, mexico, kenya blend NaN \n", "67 timor-leste, mexico, rwanda, burundi blend NaN \n", "68 colombia so NaN \n", "69 timor-leste so NaN \n", "70 mexico so NaN \n", "71 burundi so NaN \n", "72 cuba so NaN \n", "73 honduras, guatemala, india blend (mixed) \n", "74 peru, guatemala, sumatra blend NaN \n", "75 peru so washed \n", "76 honduras blend (mixed) \n", "77 colombia so washed \n", "78 peru, guatemala, sumatra blend NaN \n", "79 brazil, colombia blend (mixed) \n", "80 brazil so natural \n", "81 colombia so washed \n", "82 ethiopia so natural \n", "83 colombia blend (mixed) \n", "84 guatemala so washed \n", "85 kenya so washed \n", "\n", " notes 250gr 1kg cpc_250g \\\n", "0 Characterful | Marzipan, Nougat 9.90 33.90 0.71 \n", "1 Lively | Caramel, Dark Berries 10.90 36.90 0.78 \n", "2 Velvety | Hazelnut, Sweet Fruits 10.90 36.90 0.78 \n", "3 Full-bodied | Chocolate, Walnut 11.90 40.90 0.86 \n", "4 Strong | Chocolate, Brown Sugar 9.90 33.90 0.71 \n", "5 Balanced | Hazelnut, Nougat 14.90 50.90 1.07 \n", "6 Velvety | Dark Chocolate, Pecan Nut 14.90 50.90 1.07 \n", "7 Velvety | Lime, Strawberry 14.90 50.90 1.07 \n", "8 Strong | Brown Sugar, Tiramisu 10.90 36.90 0.78 \n", "9 Creamy | Almond, Chocolate 14.90 50.90 1.07 \n", "10 Well-Balanced | Cinnamon, Chocolate Cookie 10.90 36.90 0.78 \n", "11 Strong | Chocolate, Brown Sugar 11.90 40.90 0.86 \n", "12 chocolatey tones and a fruity highlights 12.90 41.50 0.93 \n", "13 Butterscotch, White Peach, Sultana 20.90 71.90 1.50 \n", "14 Cranberry, Red Currant, Hibiscus 20.90 73.90 1.50 \n", "15 Milk Chocolate, Cherry, Clementine 14.90 49.90 1.07 \n", "16 Caramel, Pink Lady, White Peach 18.90 62.90 1.36 \n", "17 Cocoa, Cashew, Blueberry 16.90 58.90 1.22 \n", "18 Raspberry, Citrus, Red Apple 17.90 60.90 1.29 \n", "19 orange, bittersweet cacao nibs and mellow cham... 10.19 33.55 0.73 \n", "20 rose water, red apple, panela 16.90 49.82 1.22 \n", "21 goji berry, candied apple, hibiscus 16.90 46.45 1.22 \n", "22 choc chip cookie, roasted hazelnut, and juicy ... 14.50 42.90 1.04 \n", "23 CHOCOLATE TRUFFLE & DARK CHERRY 13.90 45.50 1.00 \n", "24 NECTARINE, PLUM JAM & NOUGAT 16.90 67.60 1.22 \n", "25 RASPBERRY, BLOOD ORANGE, MAPLE SYRUP 17.90 71.60 1.29 \n", "26 CANDIED ALMOND, CARAMEL, PAPAYA 15.90 53.50 1.14 \n", "27 TOFFEE, HAZELNUT CREAM, GOLDEN RAISIN 15.90 63.60 1.14 \n", "28 HONEY MELON, LEMON CURD & DARJEELING TEA 17.90 71.60 1.29 \n", "29 MILK CHOCOLATE, BROWN SUGAR & NECTARINE 16.90 57.50 1.22 \n", "30 TOFFEE, DARK CHOCOLATE & STRAWBERRY JAM 15.90 53.50 1.14 \n", "31 RED APPLE, ALMOND & MOLASSES 15.90 53.50 1.14 \n", "32 DARK CHOCOLATE 12.90 41.50 0.93 \n", "33 Chocolate. Brazil Nut. Fudge. 14.00 53.00 1.01 \n", "34 Chocolate Ganache. Cherry. Rich. 14.50 58.00 1.04 \n", "35 Chocolate. Citrus. Velvety. 14.50 58.00 1.04 \n", "36 Peach. Elderflower. Silky. 15.00 60.00 1.08 \n", "37 Nougat. Macadamia. Vanilla. 15.00 60.00 1.08 \n", "38 Blackberry. Vanilla. Bold. 15.50 62.00 1.12 \n", "39 Cherries. Raisin. 15.50 62.00 1.12 \n", "40 Strawberry. Chocolate. Creamy. 16.00 64.00 1.15 \n", "41 cherry jam, nougat 18.00 72.00 1.30 \n", "42 Blueberry, Mango, Coconut 18.90 75.60 1.36 \n", "43 Yellow Plum, Gooseberry, Cashew 18.90 64.90 1.36 \n", "44 Raspberry, Toffee, Milk Chocolate 16.90 57.90 1.22 \n", "45 Figs, Wild Honey, Clementine 13.90 47.90 1.00 \n", "46 Caramel, Apple, Dark chocolate 12.90 43.90 0.93 \n", "47 Ripe figs, Brown sugar, Dark chocolate 12.90 43.90 0.93 \n", "48 Caramel, Strawberry, Chocolate 11.90 47.60 0.86 \n", "49 Cocoa, Melon, Cane sugar 10.90 37.90 0.78 \n", "50 Cocoa, Hazelnut , Marzipan 9.90 33.90 0.71 \n", "51 Dark Chocolate, Caramel, Cherry Jam 9.90 39.60 0.71 \n", "52 Strawberry, pomegranate, dried fig 15.90 57.50 1.14 \n", "53 Bergamot, Honeydew, Mandarine 15.90 57.50 1.14 \n", "54 Bergamot, honeydew and mandarine 15.90 57.50 1.14 \n", "55 Black currants, rose hips, persimmon 16.50 59.90 1.19 \n", "56 Cacao nibs, pineapple, rose 14.50 51.90 1.04 \n", "57 Dark chocolate, Medjool dates, red apple 11.90 42.50 0.86 \n", "58 dried cherry, cacao nibs, hazelnut butter 11.90 42.50 0.86 \n", "59 Creamy, milk chocolatey, smooth, cherry, molas... 11.90 42.50 0.86 \n", "60 banana 13.50 40.50 0.97 \n", "61 stone fruit, cacao powder, watermelon 15.00 45.00 1.08 \n", "62 Mixed berries, bergamot, dark chocolate 14.50 43.50 1.04 \n", "63 Honey, Pineapple Round body 15.00 45.00 1.08 \n", "64 Berry like, Dried Plum, Cacao, Vanila 17.50 70.00 1.26 \n", "65 crunchy nuts, butter-soaked spices, mild berri... 9.50 32.00 0.68 \n", "66 honeyed and floral note, orange and blackcurrant 10.50 35.00 0.76 \n", "67 NaN 11.50 38.00 0.83 \n", "68 cherry bomb with nuances of dried dates and da... 9.50 32.00 0.68 \n", "69 floral flavors accompanied by baked plums 10.50 35.00 0.76 \n", "70 chocolate, traces of mango and a bite of mandarin 10.50 35.00 0.76 \n", "71 cherry and red currant 10.50 35.00 0.76 \n", "72 milk chocolate, complemented with hints of nut... 10.50 35.00 0.76 \n", "73 fruity notes paired with bitter chocolate and ... 8.20 31.30 0.59 \n", "74 chocolate and cocoa with notes of black currant 8.20 31.30 0.59 \n", "75 red berries aromas, sweet with nuts and nougat 8.30 31.70 0.60 \n", "76 cherry-cognac and lots of nougat 8.30 33.20 0.60 \n", "77 caramel and orange notes 8.30 33.20 0.60 \n", "78 chocolate and cocoa with notes of black currant 8.90 35.60 0.64 \n", "79 nougat, cocoa and sweet 10.50 34.00 0.76 \n", "80 dark chocolate, nutty and berry 12.90 36.00 0.93 \n", "81 chocolate with a slight sweetness from figs 12.90 44.00 0.93 \n", "82 ripe mango and blueberries 13.80 47.80 0.99 \n", "83 dark chocolate, cherries and dates 11.90 39.00 0.86 \n", "84 red apple, sugar cane and dark chocolate 12.90 39.00 0.93 \n", "85 green grapes, brown sugar 15.80 55.90 1.14 \n", "\n", " cpc_1kg \n", "0 0.61 \n", "1 0.66 \n", "2 0.66 \n", "3 0.74 \n", "4 0.61 \n", "5 0.92 \n", "6 0.92 \n", "7 0.92 \n", "8 0.66 \n", "9 0.92 \n", "10 0.66 \n", "11 0.74 \n", "12 0.75 \n", "13 1.29 \n", "14 1.33 \n", "15 0.90 \n", "16 1.13 \n", "17 1.06 \n", "18 1.10 \n", "19 0.60 \n", "20 0.90 \n", "21 0.84 \n", "22 0.77 \n", "23 0.82 \n", "24 1.22 \n", "25 1.29 \n", "26 0.96 \n", "27 1.14 \n", "28 1.29 \n", "29 1.04 \n", "30 0.96 \n", "31 0.96 \n", "32 0.75 \n", "33 0.95 \n", "34 1.04 \n", "35 1.04 \n", "36 1.08 \n", "37 1.08 \n", "38 1.12 \n", "39 1.12 \n", "40 1.15 \n", "41 1.30 \n", "42 1.36 \n", "43 1.17 \n", "44 1.04 \n", "45 0.86 \n", "46 0.79 \n", "47 0.79 \n", "48 0.86 \n", "49 0.68 \n", "50 0.61 \n", "51 0.71 \n", "52 1.04 \n", "53 1.04 \n", "54 1.04 \n", "55 1.08 \n", "56 0.93 \n", "57 0.77 \n", "58 0.77 \n", "59 0.77 \n", "60 0.73 \n", "61 0.81 \n", "62 0.78 \n", "63 0.81 \n", "64 1.26 \n", "65 0.58 \n", "66 0.63 \n", "67 0.68 \n", "68 0.58 \n", "69 0.63 \n", "70 0.63 \n", "71 0.63 \n", "72 0.63 \n", "73 0.56 \n", "74 0.56 \n", "75 0.57 \n", "76 0.60 \n", "77 0.60 \n", "78 0.64 \n", "79 0.61 \n", "80 0.65 \n", "81 0.79 \n", "82 0.86 \n", "83 0.70 \n", "84 0.70 \n", "85 1.01 " ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "import numpy as np\n", "import plotly.express as px\n", "\n", "pd.set_option('display.max_rows', None)\n", "pd.set_option('display.max_columns', None)\n", "\n", "df = pd.read_csv(\"coffee.csv\")\n", "\n", "#convert euros to float\n", "df['250gr'] = df['250gr'].replace('[^\\d.]', '', regex=True).astype(float)\n", "df['1kg'] = df['1kg'].replace('[^\\d.]', '', regex=True).astype(float)\n", "df['cpc_250g'] = df['cpc_250g'].replace('[^\\d.]', '', regex=True).astype(float)\n", "df['cpc_1kg'] = df['cpc_1kg'].replace('[^\\d.]', '', regex=True).astype(float)\n", "\n", "df\n" ] }, { "cell_type": "markdown", "id": "2c1cf5a0", "metadata": {}, "source": [ "# Country count\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "dcd95c62", "metadata": {}, "outputs": [], "source": [ "split_countries = df['country'].str.split(',')\n", "all_countries = [country.strip().title() for sublist in split_countries.dropna() for country in sublist]\n", "country_counts = pd.Series(all_countries).value_counts()\n", "country_counts = country_counts.reset_index()\n", "#country_counts" ] }, { "cell_type": "code", "execution_count": 3, "id": "e880eda7", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "country=%{x}
cpc_1kg=%{y}", "legendgroup": "", "marker": { "color": "#636efa" }, "name": "", "notched": false, "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "box", "x": [ "ethiopia", "brazil", "el salvador", "honduras", "ethiopia", "guatemala", "colombia", "ethiopia", "ethiopia", "kenya", "peru", "el salvador", "honduras", "colombia", "rwanda", "kenya", "colombia", "colombia", "kenya", "guatemala", "honduras", "ethiopia", "ethiopia", "brazil", "colombia", "brazil", "brazil", "el salvador", "guatemala", "ethiopia", "honduras", "kenya", "rwanda", "ethiopia", "brazil", "rwanda", "el salvador", "el salvador", "peru", "indonesia", "colombia", "nicaragua", "india", "brazil", "ethiopia", "mexico", "ethiopia", "kenya", "brazil", "brazil", "costa rica", "ethiopia", "el salvador", "colombia", "colombia", "timor-leste", "mexico", "burundi", "cuba", "peru", "colombia", "brazil", "colombia", "ethiopia", "guatemala", "kenya" ], "x0": " ", "xaxis": "x", "y": [ 0.66, 0.66, 0.92, 0.92, 0.92, 0.92, 0.66, 0.74, 1.29, 1.33, 0.9, 1.13, 1.06, 1.1, 0.9, 0.84, 0.77, 1.22, 1.29, 0.96, 1.14, 1.29, 1.04, 0.96, 0.96, 0.75, 0.95, 1.04, 1.04, 1.08, 1.08, 1.12, 1.12, 1.15, 1.3, 1.36, 1.17, 1.04, 0.86, 0.79, 0.79, 0.68, 0.61, 0.71, 1.04, 1.04, 1.04, 1.08, 0.93, 0.73, 0.81, 0.78, 0.81, 1.26, 0.58, 0.63, 0.63, 0.63, 0.63, 0.57, 0.6, 0.65, 0.79, 0.86, 0.7, 1.01 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "group", "legend": { "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Distribution of Coffee Prices by Country (single origin only)" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "tickangle": -45, "title": { "text": "country" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "cpc_1kg" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df_singleorigin = df[df['type'] == 'so']\n", "fig = px.box(df_singleorigin, x='country', y='cpc_1kg', title='Distribution of Coffee Prices by Country (single origin only)')\n", "fig.update_layout(xaxis_title='country', yaxis_title='cpc_1kg', xaxis_tickangle=-45)\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "634edbf0", "metadata": {}, "source": [ "# Brand: average price per brand\n", "cost per cup when buying 1kg bags\n", "\n", "just checking which brands are more expensive, on average" ] }, { "cell_type": "code", "execution_count": 4, "id": "2e776848", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "shop=%{x}
cpc_1kg=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "textposition": "auto", "texttemplate": "%{y}", "type": "bar", "x": [ "flying roasters", "passenger", "coffee circle", "nano kaffee", "five elephant", "cebe", "19 grams", "populus", "bonanza coffee", "fjord", "the barn" ], "xaxis": "x", "y": [ 0.59, 0.62, 0.75, 0.76, 0.78, 0.88, 0.89, 0.93, 1.04, 1.08, 1.1 ], "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Average cost per cup (when buying 1kg bags)" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "shop" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "cpc_1kg" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "shop_avg = df.groupby('shop')[['cpc_250g','cpc_1kg']].mean().round(2)\n", "shop_avg = shop_avg.sort_values(by='cpc_1kg')\n", "shop_avg = shop_avg.reset_index()\n", "#shop_avg.dtypes\n", "\n", "fig = px.bar(shop_avg, x='shop', y='cpc_1kg', title='Average cost per cup (when buying 1kg bags)', text_auto=True)\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "bf64a222", "metadata": {}, "source": [ "# Type: Single origin vs blend\n", "\n", "Single origin tends to be more expensive than blends, but how much more?" ] }, { "cell_type": "code", "execution_count": 5, "id": "bf41d190", "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", "
typecpc_250gcpc_1kg
0blend0.7735000.676000
1so1.0495450.924545
\n", "
" ], "text/plain": [ " type cpc_250g cpc_1kg\n", "0 blend 0.773500 0.676000\n", "1 so 1.049545 0.924545" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "types = df.groupby('type')[['cpc_250g','cpc_1kg']].mean()\n", "types = types.sort_values(by='cpc_250g')\n", "types = types.reset_index()\n", "types" ] }, { "cell_type": "code", "execution_count": 6, "id": "d5775245", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "type=%{x}
cpc_1kg=%{y}", "legendgroup": "", "marker": { "color": "#636efa" }, "name": "", "notched": false, "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "box", "x": [ "blend", "so", "so", "blend", "blend", "so", "so", "so", "blend", "so", "so", "so", "blend", "so", "so", "so", "so", "so", "so", "blend", "so", "so", "so", "blend", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "so", "blend", "so", "so", "so", "so", "so", "so", "so", "so", "blend", "blend", "blend", "so", "so", "so", "so", "so", "blend", "blend", "blend", "so", "so", "so", "so", "so", "blend", "blend", "so", "blend", "so", "blend", "blend", "so", "so", "so", "blend", "so", "so" ], "x0": " ", "xaxis": "x", "y": [ 0.61, 0.66, 0.66, 0.74, 0.61, 0.92, 0.92, 0.92, 0.66, 0.92, 0.66, 0.74, 0.75, 1.29, 1.33, 0.9, 1.13, 1.06, 1.1, 0.6, 0.9, 0.84, 0.77, 0.82, 1.22, 1.29, 0.96, 1.14, 1.29, 1.04, 0.96, 0.96, 0.75, 0.95, 1.04, 1.04, 1.08, 1.08, 1.12, 1.12, 1.15, 1.3, 1.36, 1.17, 1.04, 0.86, 0.79, 0.79, 0.86, 0.68, 0.61, 0.71, 1.04, 1.04, 1.04, 1.08, 0.93, 0.77, 0.77, 0.77, 0.73, 0.81, 0.78, 0.81, 1.26, 0.58, 0.63, 0.68, 0.58, 0.63, 0.63, 0.63, 0.63, 0.56, 0.56, 0.57, 0.6, 0.6, 0.64, 0.61, 0.65, 0.79, 0.86, 0.7, 0.7, 1.01 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "group", "legend": { "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Single origin vs blend" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "type" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "cpc_1kg" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df_type = df\n", "fig = px.box(df_type, x='type', y='cpc_1kg', title='Single origin vs blend')\n", "fig.update_layout(xaxis_title='type', yaxis_title='cpc_1kg')\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 7, "id": "0936c4e6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Single origin is 35.69% more expensive than Blend, on average.\n" ] } ], "source": [ "mean_price_per_type = types.groupby('type')['cpc_250g'].mean()\n", "blend_price = mean_price_per_type['blend']\n", "so_price = mean_price_per_type['so']\n", "percentage_difference = ((so_price - blend_price) / blend_price) * 100\n", "print(\"Single origin is {:.2f}% more expensive than Blend, on average.\".format(percentage_difference))" ] }, { "cell_type": "markdown", "id": "20cd1cdf", "metadata": {}, "source": [ "# Process\n", "- Natural Process: Coffee cherries are dried whole, allowing the fruit to ferment around the bean, imparting fruity flavors.\n", "- Washed Process: Coffee cherries are pulped to remove the fruit, then fermented in water to remove mucilage before drying, resulting in a clean cup with bright acidity.\n", "- Honey Process: Coffee cherries are pulped but some or all of the mucilage is left on the beans during drying, leading to varying degrees of sweetness and body.\n", "- Anaerobic Process: Coffee cherries are placed in a sealed container to ferment in the absence of oxygen, resulting in unique and complex flavor profiles due to controlled fermentation conditions.\n", "\n", "Natural and washed are by far the most common. Unless explicitely mentioned, all blends are usually a combination of natural and washed, and marked as (mixed)." ] }, { "cell_type": "code", "execution_count": 8, "id": "5aa2ef73", "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", "
processcountcpc_250gcpc_1kg
0washed331.0530300.931212
1natural251.0468000.925600
2(mixed)90.7811110.692222
3honey51.1160000.932000
4anaerobic21.2000001.110000
5sugarcane10.8600000.770000
\n", "
" ], "text/plain": [ " process count cpc_250g cpc_1kg\n", "0 washed 33 1.053030 0.931212\n", "1 natural 25 1.046800 0.925600\n", "2 (mixed) 9 0.781111 0.692222\n", "3 honey 5 1.116000 0.932000\n", "4 anaerobic 2 1.200000 1.110000\n", "5 sugarcane 1 0.860000 0.770000" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "process = df.groupby('process').agg({'process': 'count', 'cpc_250g': 'mean', 'cpc_1kg': 'mean'})\n", "process.rename(columns={'process': 'count'}, inplace=True)\n", "process = process.sort_values(by='count', ascending=False)\n", "process = process.reset_index()\n", "process" ] }, { "cell_type": "code", "execution_count": 9, "id": "fb495632", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "process=%{x}
cpc_1kg=%{y}", "legendgroup": "", "marker": { "color": "#636efa" }, "name": "", "notched": false, "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "box", "x": [ "natural", "natural", "washed", "washed", "natural", "washed", "washed", "natural", "washed", "washed", "washed", "natural", "natural", "washed", "washed", "washed", "washed", "washed", "washed", "honey", "washed", "washed", "natural", "anaerobic", "washed", "natural", "natural", "natural", "washed", "washed", "washed", "washed", "natural", "natural", "natural", "natural", "natural", "natural", "washed", "washed", "washed", "washed", "washed", "natural", "natural", "honey", "honey", "washed", "natural", "natural", "honey", "natural", "honey", "anaerobic", null, null, null, null, null, "washed", "washed", "natural", "washed", "natural", "washed", "washed" ], "x0": " ", "xaxis": "x", "y": [ 0.66, 0.66, 0.92, 0.92, 0.92, 0.92, 0.66, 0.74, 1.29, 1.33, 0.9, 1.13, 1.06, 1.1, 0.9, 0.84, 0.77, 1.22, 1.29, 0.96, 1.14, 1.29, 1.04, 0.96, 0.96, 0.75, 0.95, 1.04, 1.04, 1.08, 1.08, 1.12, 1.12, 1.15, 1.3, 1.36, 1.17, 1.04, 0.86, 0.79, 0.79, 0.68, 0.61, 0.71, 1.04, 1.04, 1.04, 1.08, 0.93, 0.73, 0.81, 0.78, 0.81, 1.26, 0.58, 0.63, 0.63, 0.63, 0.63, 0.57, 0.6, 0.65, 0.79, 0.86, 0.7, 1.01 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "group", "legend": { "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Distribution of Coffee Prices by process (single origin only)" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "tickangle": -45, "title": { "text": "process" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "cpc_1kg" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df_process = df[df['type'] == 'so']\n", "fig = px.box(df_process, x='process', y='cpc_1kg', title='Distribution of Coffee Prices by process (single origin only)')\n", "fig.update_layout(xaxis_title='process', yaxis_title='cpc_1kg', xaxis_tickangle=-45)\n", "fig.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.4" } }, "nbformat": 4, "nbformat_minor": 5 }