Skip to content
Project: What's in an Avocado Toast: A Supply Chain Analysis
  • AI Chat
  • Code
  • Report
  • Spinner

    What's in an Avocado Toast: A Supply Chain Analysis

    You're in London, making an avocado toast, a quick-to-make dish that has soared in popularity on breakfast menus since the 2010s. A simple smashed avocado toast can be made with five ingredients: one ripe avocado, half a lemon, a big pinch of salt flakes, two slices of sourdough bread and a good drizzle of extra virgin olive oil.

    It's no small feat that most of these ingredients are readily available in grocery stores. In this project, you'll conduct a supply chain analysis of the ingredients used in an avocado toast, utilizing the Open Food Facts database. This database contains extensive, openly-sourced information on various foods, including their origins. Through this analysis, you will gain an in-depth understanding of the complex supply chain involved in producing a single dish. The data is contained in .csv files in the data/ folder provided.

    After completing this project, you'll be armed with a list of ingredients and their countries of origin, and be well-positioned to launch into other analyses that explore how long, on average, these ingredients spend at sea.

    import pandas as pd
    df = pd.read_csv('data/avocado.csv',sep='\t')
    df = df[[ 'code', 'lc', 'product_name_en', 'quantity', 'serving_size', 'packaging_tags', 'brands', 'brands_tags', 'categories_tags', 'labels_tags', 'countries', 'countries_tags', 'origins','origins_tags']]
    df.head()
    rows_to_keep = ['en:avocadoes', 'en:avocados', 'en:fresh-foods', 'en:fresh-vegetables', 'en:fruchte', 'en:fruits', 'en:raw-green-avocados', 'en:tropical-fruits', 'en:tropische-fruchte', 'en:vegetables-based-foods','fr:hass-avocados']
    rows_to_keep
    df.shape
    df_not_null = df[~df['categories_tags'].isnull()]
    df_not_null.shape
    df_not_null['categories_list'] = df_not_null['categories_tags'].str.split(',')
    df_not_null.head()
    df_not_null = df_not_null[df_not_null['categories_list'].apply(lambda x: any([i for i in x if i in rows_to_keep]))]
    df_not_null.shape
    df_not_null.head()
    df_not_null = df_not_null[df_not_null['countries']=='United Kingdom']
    df_not_null.shape