From e03c2a266fc3ebf7fac19103c5587d5a40de1f40 Mon Sep 17 00:00:00 2001 From: sg623 Date: Sun, 9 Apr 2023 15:21:08 -0400 Subject: [PATCH] Added ingredient processing notebooks --- notebooks/ingredient_processing_1.ipynb | 467 +++ notebooks/ingredient_processing_2.ipynb | 4408 +++++++++++++++++++++++ 2 files changed, 4875 insertions(+) create mode 100644 notebooks/ingredient_processing_1.ipynb create mode 100644 notebooks/ingredient_processing_2.ipynb diff --git a/notebooks/ingredient_processing_1.ipynb b/notebooks/ingredient_processing_1.ipynb new file mode 100644 index 0000000..faeb75e --- /dev/null +++ b/notebooks/ingredient_processing_1.ipynb @@ -0,0 +1,467 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "8f3cafef-b3fc-4294-81ca-3b6acead188b", + "metadata": {}, + "outputs": [], + "source": [ + "import stanza" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "c7c1bc72-2f43-4f0a-aa80-56d7ac8a2462", + "metadata": {}, + "outputs": [], + "source": [ + "from tqdm import tqdm" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "93145e0d-3a45-4f1f-b65a-ad43a03c393d", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-04-07 21:31:56 INFO: Checking for updates to resources.json in case models have been updated. Note: this behavior can be turned off with download_method=None or download_method=DownloadMethod.REUSE_RESOURCES\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "8873e704829040a1b23a8216f2743605", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.5.0.json: 0%| …" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-04-07 21:31:57 INFO: Loading these models for language: en (English):\n", + "========================\n", + "| Processor | Package |\n", + "------------------------\n", + "| tokenize | combined |\n", + "| pos | combined |\n", + "| lemma | combined |\n", + "========================\n", + "\n", + "2023-04-07 21:31:57 INFO: Using device: cuda\n", + "2023-04-07 21:31:57 INFO: Loading: tokenize\n", + "2023-04-07 21:32:01 INFO: Loading: pos\n", + "2023-04-07 21:32:01 INFO: Loading: lemma\n", + "2023-04-07 21:32:01 INFO: Done loading processors!\n" + ] + } + ], + "source": [ + "nlp = stanza.Pipeline(lang='en', processors='tokenize, lemma ,pos')" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "c53590fa-bc98-413e-836f-45b921319b74", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "e8ad1c84-600c-46dd-b6ac-e858b1c72499", + "metadata": {}, + "outputs": [], + "source": [ + "ingredient_df = pd.read_csv(\"temp.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "99da2a40-68fd-4a07-974b-6b8de7c5d7ef", + "metadata": {}, + "outputs": [], + "source": [ + "ingredient_list = list(ingredient_df.ingredient)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "2e5ab3fe-f507-4fcb-9c7a-8ce3d605a037", + "metadata": {}, + "outputs": [], + "source": [ + "stanza_res=[]" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "29935c4c-7bef-45b6-96ca-3c285020353a", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|██████████| 14901/14901 [05:33<00:00, 44.65it/s]\n" + ] + } + ], + "source": [ + "for i in tqdm(ingredient_list):\n", + " stanza_res.append(nlp(i))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "46f422f6-0bb0-4720-aa78-870f8f5a3c33", + "metadata": {}, + "outputs": [], + "source": [ + "final_words = []" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "781300cf-cc55-40ad-bc9e-b954a7648d9b", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|██████████| 14901/14901 [00:00<00:00, 295556.78it/s]" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6860\n", + "6861\n", + "6862\n", + "9603\n", + "10054\n", + "10055\n", + "11795\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "i = 0\n", + "for res in tqdm(stanza_res):\n", + " noun_list = []\n", + " if len(res.sentences) > 1:\n", + " print(i)\n", + " \n", + " else:\n", + " for sentence in res.sentences:\n", + " noun_list = []\n", + " len_word = len(sentence.words)\n", + " j = 0\n", + " for word in sentence.words:\n", + " if (len_word - 1) == j:\n", + " if word.upos == \"NOUN\":\n", + " noun_list.append(word.lemma)\n", + " else:\n", + " noun_list = []\n", + " else:\n", + " if word.upos == \"NOUN\":\n", + " noun_list.append(word.text)\n", + " else:\n", + " noun_list = []\n", + " j = j + 1\n", + " \n", + " final_words.append(\" \".join(noun_list))\n", + " i = i + 1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "cbb1e23c-294b-403b-948b-72510ce90528", + "metadata": {}, + "outputs": [], + "source": [ + "pd.concat([ingredient_df, pd.DataFrame(final_words)], axis=1).to_csv(\"Foo.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "ea9fe420-deb1-48d8-b873-d7166090b913", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'1% fat buttermilk'" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ingredient_list[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "7b454a6a-5d75-4ec8-8bf4-fd0d4623a2d1", + "metadata": {}, + "outputs": [], + "source": [ + "doc = nlp(ingredient_list[0])" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "ffcdca94-77e3-4ef1-834a-a118b42c51e4", + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'Sentence' object is not subscriptable", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[28], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mdoc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msentences\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\n", + "\u001b[0;31mTypeError\u001b[0m: 'Sentence' object is not subscriptable" + ] + } + ], + "source": [ + "doc.sentences[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "0ce554f5-86fd-4ccf-911c-d4d7e6832f96", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "buttermilk\n" + ] + } + ], + "source": [ + "for sentence in doc.sentences:\n", + " for word in sentence.words:\n", + " if word.upos == \"NOUN\":\n", + " print(word.text)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "8e33a7d8-3fe8-4491-b86a-e7a35afb3843", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(doc.sentences)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f0703042-9863-4fc0-9864-efd96629a329", + "metadata": {}, + "outputs": [], + "source": [ + "def extract_adjectives_with_nouns(review_text, nlp_stanza):\n", + "    \"\"\"\n", + "    Extract the adjectives and the nouns they are describing\n", + "\n", + "    Args:\n", + "        review_text (str): review text\n", + "    \n", + "    Returns:\n", + "        adj_noun_pairs (list): list of adjective-noun pairs\n", + "    \"\"\"\n", + "\n", + "    ## extract all the adjectives and the nouns they are describing\n", + "    doc = nlp_stanza(review_text)\n", + "    adj_noun_pairs = []\n", + " \n", + "    for sentence in doc.sentences:\n", + " \n", + "        for word in sentence.words:\n", + "            if word.upos == \"NOUN\":\n", + " new_list.append(word)\n", + "\n", + "    return adj_noun_pairs" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "49d64a4c-92da-492c-80d9-0a15987e0475", + "metadata": {}, + "outputs": [], + "source": [ + "doc = nlp('Barack Obama was born in Hawaii.')\n", + "print(*[f'word: {word.text}\\tupos: {word.upos}\\txpos: {word.xpos}\\tfeats: {word.feats if word.feats else \"_\"}' for sent in doc.sentences for word in sent.words], sep='\\n')" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "4cc81d74-ea90-4c6b-890b-28f1cdd64446", + "metadata": {}, + "outputs": [], + "source": [ + "#@title Load the Universal Sentence Encoder's TF Hub module\n", + "from absl import logging\n", + "\n", + "import tensorflow as tf\n", + "\n", + "import tensorflow_hub as hub\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import os\n", + "import pandas as pd\n", + "import re\n", + "import seaborn as sns" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "81ae1d6f-87dd-4ba7-bf9d-b86cfbecdbc8", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-04-07 19:50:15.854452: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:16.139046: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:16.139456: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:16.140675: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA\n", + "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", + "2023-04-07 19:50:16.142324: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:16.142705: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:16.143021: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:28.714173: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:28.740275: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:28.741315: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-07 19:50:28.742136: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1613] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 46704 MB memory: -> device: 0, name: NVIDIA RTX A6000, pci bus id: 0000:04:00.0, compute capability: 8.6\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "module https://tfhub.dev/google/universal-sentence-encoder-large/5 loaded\n" + ] + } + ], + "source": [ + "module_url = \"https://tfhub.dev/google/universal-sentence-encoder-large/5\"\n", + "model = hub.load(module_url)\n", + "print (\"module %s loaded\" % module_url)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "b6d7b1d5-beb7-4e83-ac79-1bacc9ccafad", + "metadata": {}, + "outputs": [], + "source": [ + "def embed(input):\n", + " return model(input)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "4d916a89-f1ba-470f-9f19-5733c065dc84", + "metadata": {}, + "outputs": [], + "source": [ + "def run_and_plot(messages_):\n", + " message_embeddings_ = embed(messages_)\n", + " corr = np.inner(message_embeddings_, message_embeddings_)\n", + " return corr, messages_, message_embeddings_" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1a0b51f1-a21b-443f-8df6-e26870372a75", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "cv_540", + "language": "python", + "name": "cv_540" + }, + "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.8.16" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/ingredient_processing_2.ipynb b/notebooks/ingredient_processing_2.ipynb new file mode 100644 index 0000000..b6773bf --- /dev/null +++ b/notebooks/ingredient_processing_2.ipynb @@ -0,0 +1,4408 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "4cc81d74-ea90-4c6b-890b-28f1cdd64446", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-04-08 13:45:02.589586: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA\n", + "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", + "2023-04-08 13:45:06.596352: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory\n", + "2023-04-08 13:45:06.596430: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory\n", + "2023-04-08 13:45:06.596437: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.\n" + ] + } + ], + "source": [ + "#@title Load the Universal Sentence Encoder's TF Hub module\n", + "from absl import logging\n", + "\n", + "import tensorflow as tf\n", + "\n", + "import tensorflow_hub as hub\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import os\n", + "import pandas as pd\n", + "import re\n", + "import seaborn as sns" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "4e4a6986-ed0e-4f84-89a9-ba0dacdf5e8c", + "metadata": {}, + "outputs": [], + "source": [ + "from tqdm import tqdm" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "81ae1d6f-87dd-4ba7-bf9d-b86cfbecdbc8", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-04-08 13:45:16.256070: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.287275: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.287478: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.288588: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA\n", + "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", + "2023-04-08 13:45:16.289189: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.289346: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.289452: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.785499: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.785705: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.785828: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2023-04-08 13:45:16.785956: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1613] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 46705 MB memory: -> device: 0, name: NVIDIA RTX A6000, pci bus id: 0000:13:00.0, compute capability: 8.6\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "module https://tfhub.dev/google/universal-sentence-encoder-large/5 loaded\n" + ] + } + ], + "source": [ + "module_url = \"https://tfhub.dev/google/universal-sentence-encoder-large/5\"\n", + "model = hub.load(module_url)\n", + "print (\"module %s loaded\" % module_url)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "b6d7b1d5-beb7-4e83-ac79-1bacc9ccafad", + "metadata": {}, + "outputs": [], + "source": [ + "def embed(input):\n", + " return model(input)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "4d916a89-f1ba-470f-9f19-5733c065dc84", + "metadata": {}, + "outputs": [], + "source": [ + "def run_and_plot(messages_):\n", + " message_embeddings_ = embed(messages_)\n", + " corr = np.inner(message_embeddings_, message_embeddings_)\n", + " return corr, messages_, message_embeddings_" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "1a0b51f1-a21b-443f-8df6-e26870372a75", + "metadata": {}, + "outputs": [], + "source": [ + "ingredient_df = pd.read_csv(\"temp4.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "d12e632f-b9a7-4528-9351-bad21b34c69d", + "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", + "
ingredientcount
0salt93053
1pepper86475
2sugar85302
3onion76690
4butter65070
.........
7391yigandes bean1
7392yogurt spread1
7393zatarain cajun seasoning1
7394coating meat1
7395zwieback toast crumb1
\n", + "

7396 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " ingredient count\n", + "0 salt 93053\n", + "1 pepper 86475\n", + "2 sugar 85302\n", + "3 onion 76690\n", + "4 butter 65070\n", + "... ... ...\n", + "7391 yigandes bean 1\n", + "7392 yogurt spread 1\n", + "7393 zatarain cajun seasoning 1\n", + "7394 coating meat 1\n", + "7395 zwieback toast crumb 1\n", + "\n", + "[7396 rows x 2 columns]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ingredient_df" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "300d9a85-5769-4eb7-bccb-5c08e0de16b5", + "metadata": {}, + "outputs": [], + "source": [ + "#ingredient_df[\"len\"] = ingredient_df.ingredient.apply(lambda x: len(x.split(\" \")))\n", + "#ingredient_df = ingredient_df.sort_values(by=\"len\")" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "0fafcaf7-3a88-4460-80c2-af7c5956989b", + "metadata": {}, + "outputs": [], + "source": [ + "ingredient_list = list(ingredient_df.ingredient)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "ff0d138f-7b46-4aa4-8697-a34223389e42", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-04-08 13:45:59.276247: I tensorflow/tsl/platform/default/subprocess.cc:304] Start cannot spawn child process: No such file or directory\n", + "2023-04-08 13:46:00.689019: I tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:630] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.\n" + ] + } + ], + "source": [ + "corr, ingredients, embeddings_m = run_and_plot(ingredient_list)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "f28f4be8-f761-40a0-ae46-a9b1a68e9b0e", + "metadata": {}, + "outputs": [], + "source": [ + "foo = pd.DataFrame(corr, index = ingredients, columns = ingredients)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "2528bffc-e672-4d5e-a1b0-6a6addb54c0e", + "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", + "
saltpeppersugaronionbuttereggwateroilmilkgarlic clove...yellow aji limo chileaji limo chilefin potatomasarepayellow pikeyigandes beanyogurt spreadzatarain cajun seasoningcoating meatzwieback toast crumb
salt1.0000000.5811850.5784380.4765640.5509880.4211060.5575170.4884080.4633910.372202...0.0422170.0643380.3334640.2540300.1944260.2482630.2712390.3528070.3486880.143505
pepper0.5811851.0000000.4941780.5324570.4594170.4526640.4499160.4314830.4997350.453722...0.2056170.2406810.2821470.3039750.2118670.3095900.3133890.3100050.3437520.131819
sugar0.5784380.4941781.0000000.3881120.5246950.4446360.5275530.5252050.5334380.302974...0.1176540.1315520.2210170.2594720.1850140.3434730.3656920.1068580.2602500.210830
onion0.4765640.5324570.3881121.0000000.3729350.4040020.3747460.3555790.3153210.447493...0.0980010.1198600.3485800.1663610.1684040.2440880.2867150.2175250.3004800.193938
butter0.5509880.4594170.5246950.3729351.0000000.4904530.4412600.5956290.5597720.331437...-0.048777-0.0143330.3637490.2005050.1323670.3071020.4806410.2472550.3857620.333829
..................................................................
yigandes bean0.2482630.3095900.3434730.2440880.3071020.3443440.2207770.2170230.2663620.271450...0.1963550.2184380.4378390.2032030.2463051.0000000.2388600.1493060.1992380.277417
yogurt spread0.2712390.3133890.3656920.2867150.4806410.3619890.2612240.3127670.4684700.314960...0.0935900.1003040.2827560.1623200.2102440.2388601.0000000.1402990.3203170.377273
zatarain cajun seasoning0.3528070.3100050.1068580.2175250.2472550.0622680.0632270.2071250.0321580.392600...0.2087770.2722700.2164240.1693870.1857540.1493060.1402991.0000000.2810160.195188
coating meat0.3486880.3437520.2602500.3004800.3857620.3678210.2363820.3001630.3096670.267602...0.1173570.1716030.2921150.0714510.1675460.1992380.3203170.2810161.0000000.290854
zwieback toast crumb0.1435050.1318190.2108300.1939380.3338290.2574670.0208910.0636640.2003600.255164...0.1859590.1632350.255539-0.0013730.1533660.2774170.3772730.1951880.2908541.000000
\n", + "

7396 rows × 7396 columns

\n", + "
" + ], + "text/plain": [ + " salt pepper sugar onion butter \n", + "salt 1.000000 0.581185 0.578438 0.476564 0.550988 \\\n", + "pepper 0.581185 1.000000 0.494178 0.532457 0.459417 \n", + "sugar 0.578438 0.494178 1.000000 0.388112 0.524695 \n", + "onion 0.476564 0.532457 0.388112 1.000000 0.372935 \n", + "butter 0.550988 0.459417 0.524695 0.372935 1.000000 \n", + "... ... ... ... ... ... \n", + "yigandes bean 0.248263 0.309590 0.343473 0.244088 0.307102 \n", + "yogurt spread 0.271239 0.313389 0.365692 0.286715 0.480641 \n", + "zatarain cajun seasoning 0.352807 0.310005 0.106858 0.217525 0.247255 \n", + "coating meat 0.348688 0.343752 0.260250 0.300480 0.385762 \n", + "zwieback toast crumb 0.143505 0.131819 0.210830 0.193938 0.333829 \n", + "\n", + " egg water oil milk \n", + "salt 0.421106 0.557517 0.488408 0.463391 \\\n", + "pepper 0.452664 0.449916 0.431483 0.499735 \n", + "sugar 0.444636 0.527553 0.525205 0.533438 \n", + "onion 0.404002 0.374746 0.355579 0.315321 \n", + "butter 0.490453 0.441260 0.595629 0.559772 \n", + "... ... ... ... ... \n", + "yigandes bean 0.344344 0.220777 0.217023 0.266362 \n", + "yogurt spread 0.361989 0.261224 0.312767 0.468470 \n", + "zatarain cajun seasoning 0.062268 0.063227 0.207125 0.032158 \n", + "coating meat 0.367821 0.236382 0.300163 0.309667 \n", + "zwieback toast crumb 0.257467 0.020891 0.063664 0.200360 \n", + "\n", + " garlic clove ... yellow aji limo chile \n", + "salt 0.372202 ... 0.042217 \\\n", + "pepper 0.453722 ... 0.205617 \n", + "sugar 0.302974 ... 0.117654 \n", + "onion 0.447493 ... 0.098001 \n", + "butter 0.331437 ... -0.048777 \n", + "... ... ... ... \n", + "yigandes bean 0.271450 ... 0.196355 \n", + "yogurt spread 0.314960 ... 0.093590 \n", + "zatarain cajun seasoning 0.392600 ... 0.208777 \n", + "coating meat 0.267602 ... 0.117357 \n", + "zwieback toast crumb 0.255164 ... 0.185959 \n", + "\n", + " aji limo chile fin potato masarepa yellow pike \n", + "salt 0.064338 0.333464 0.254030 0.194426 \\\n", + "pepper 0.240681 0.282147 0.303975 0.211867 \n", + "sugar 0.131552 0.221017 0.259472 0.185014 \n", + "onion 0.119860 0.348580 0.166361 0.168404 \n", + "butter -0.014333 0.363749 0.200505 0.132367 \n", + "... ... ... ... ... \n", + "yigandes bean 0.218438 0.437839 0.203203 0.246305 \n", + "yogurt spread 0.100304 0.282756 0.162320 0.210244 \n", + "zatarain cajun seasoning 0.272270 0.216424 0.169387 0.185754 \n", + "coating meat 0.171603 0.292115 0.071451 0.167546 \n", + "zwieback toast crumb 0.163235 0.255539 -0.001373 0.153366 \n", + "\n", + " yigandes bean yogurt spread \n", + "salt 0.248263 0.271239 \\\n", + "pepper 0.309590 0.313389 \n", + "sugar 0.343473 0.365692 \n", + "onion 0.244088 0.286715 \n", + "butter 0.307102 0.480641 \n", + "... ... ... \n", + "yigandes bean 1.000000 0.238860 \n", + "yogurt spread 0.238860 1.000000 \n", + "zatarain cajun seasoning 0.149306 0.140299 \n", + "coating meat 0.199238 0.320317 \n", + "zwieback toast crumb 0.277417 0.377273 \n", + "\n", + " zatarain cajun seasoning coating meat \n", + "salt 0.352807 0.348688 \\\n", + "pepper 0.310005 0.343752 \n", + "sugar 0.106858 0.260250 \n", + "onion 0.217525 0.300480 \n", + "butter 0.247255 0.385762 \n", + "... ... ... \n", + "yigandes bean 0.149306 0.199238 \n", + "yogurt spread 0.140299 0.320317 \n", + "zatarain cajun seasoning 1.000000 0.281016 \n", + "coating meat 0.281016 1.000000 \n", + "zwieback toast crumb 0.195188 0.290854 \n", + "\n", + " zwieback toast crumb \n", + "salt 0.143505 \n", + "pepper 0.131819 \n", + "sugar 0.210830 \n", + "onion 0.193938 \n", + "butter 0.333829 \n", + "... ... \n", + "yigandes bean 0.277417 \n", + "yogurt spread 0.377273 \n", + "zatarain cajun seasoning 0.195188 \n", + "coating meat 0.290854 \n", + "zwieback toast crumb 1.000000 \n", + "\n", + "[7396 rows x 7396 columns]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "foo" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "dbef1714-19e4-4896-8bbc-e1356411f128", + "metadata": {}, + "outputs": [], + "source": [ + "foo1 = round(foo, 2)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "62653b61-af99-405d-8421-921b8feead5f", + "metadata": {}, + "outputs": [], + "source": [ + "for index, row in foo1.iterrows():\n", + " break\n", + " \n", + "new_row = pd.concat([pd.DataFrame(row.nlargest(2)[1:]).reset_index().rename(columns={row.index[0]: \"score\"}), pd.DataFrame([row.index[0]])], axis=1)\n", + "final1 = new_row[1:]" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "203a5722-748f-4918-b47b-4ba875a49fb7", + "metadata": {}, + "outputs": [], + "source": [ + "i=0\n", + "for index, row in foo1.iterrows():\n", + " new_row = pd.concat([pd.DataFrame(row.nlargest(2)[1:]).reset_index().rename(columns={row.index[i]: \"score\"}), pd.DataFrame([row.index[i]])], axis=1)\n", + " final1 = pd.concat([final1, new_row])\n", + " i=i+1" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "dc9c565f-df9f-420d-a4eb-09feb4ebd9d3", + "metadata": {}, + "outputs": [], + "source": [ + "final2 = final1.reset_index(drop=True).rename(columns={\"index\": \"ingredient\", 0: \"similar_ingredient\"})" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "id": "ec71f513-1f32-4e6e-bfa2-e807a088e2fe", + "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", + "
ingredientscoresimilar_ingredient
0sodium salt0.87salt
1ground pepper0.88pepper
2sugar sprinkle0.84sugar
3cipollini onion0.87onion
4butter spread0.89butter
............
7391haricot bean0.79yigandes bean
7392yogurt0.86yogurt spread
7393cajun seasoning0.93zatarain cajun seasoning
7394meat seasoning0.70coating meat
7395bread crumb0.74zwieback toast crumb
\n", + "

7396 rows × 3 columns

\n", + "
" + ], + "text/plain": [ + " ingredient score similar_ingredient\n", + "0 sodium salt 0.87 salt\n", + "1 ground pepper 0.88 pepper\n", + "2 sugar sprinkle 0.84 sugar\n", + "3 cipollini onion 0.87 onion\n", + "4 butter spread 0.89 butter\n", + "... ... ... ...\n", + "7391 haricot bean 0.79 yigandes bean\n", + "7392 yogurt 0.86 yogurt spread\n", + "7393 cajun seasoning 0.93 zatarain cajun seasoning\n", + "7394 meat seasoning 0.70 coating meat\n", + "7395 bread crumb 0.74 zwieback toast crumb\n", + "\n", + "[7396 rows x 3 columns]" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "final2" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "id": "b7c474d2-e05d-472f-922c-2fa2b2619a1c", + "metadata": {}, + "outputs": [], + "source": [ + "final3 = pd.merge(final2, ingredient_df, on=\"ingredient\", how=\"inner\")" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "id": "8aea80ed-2d54-4a85-a4de-9db3db6c07a4", + "metadata": {}, + "outputs": [], + "source": [ + "final3 = final3.sort_values(by=\"count\", ascending=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "id": "77ee2ab9-d069-450d-ab18-5f2b1148ae4c", + "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", + "
ingredientscoresimilar_ingredientcount
890salt0.83season salt93053
891salt0.86rock salt93053
892salt0.74fleur de sel93053
893salt0.87sodium salt93053
894salt0.78lemon salt93053
...............
2611spearmint candy leaf0.80spearmint1
6483mutton neck0.82mutton shoulder1
855vegetable shortening stick0.88vegetable shortening1
6479mushroom spaghetti sauce0.92mushroom marinara sauce1
7395red aji limo chile0.93aji limo chile1
\n", + "

7396 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " ingredient score similar_ingredient count\n", + "890 salt 0.83 season salt 93053\n", + "891 salt 0.86 rock salt 93053\n", + "892 salt 0.74 fleur de sel 93053\n", + "893 salt 0.87 sodium salt 93053\n", + "894 salt 0.78 lemon salt 93053\n", + "... ... ... ... ...\n", + "2611 spearmint candy leaf 0.80 spearmint 1\n", + "6483 mutton neck 0.82 mutton shoulder 1\n", + "855 vegetable shortening stick 0.88 vegetable shortening 1\n", + "6479 mushroom spaghetti sauce 0.92 mushroom marinara sauce 1\n", + "7395 red aji limo chile 0.93 aji limo chile 1\n", + "\n", + "[7396 rows x 4 columns]" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "final3" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "id": "66873eec-0404-4513-b417-5e6ab09bbd61", + "metadata": {}, + "outputs": [], + "source": [ + "# final2[\"len\"] = final2.ingredient.apply(lambda x: len(x.split(\" \")))\n", + "# final2 = final2.sort_values(by=\"len\")\n", + "# final2" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "id": "6618117e-4d5a-413a-9b11-f327e2d02893", + "metadata": {}, + "outputs": [], + "source": [ + "empty = {}" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "id": "55c1005d-2f85-4f28-8ed3-3680378248d5", + "metadata": {}, + "outputs": [], + "source": [ + "# #empty[\"a\"] = [\"b\", \"c\"]\n", + "# empty[\"d\"] = [\"e\", \"f\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "id": "310bb8be-27df-460c-9889-8d599009af52", + "metadata": {}, + "outputs": [], + "source": [ + "# for index, z in final2.iterrows():\n", + "# if z[\"score\"] > 0.85:\n", + "# if z[\"ingredient\"] not in list(empty.keys()):\n", + "# empty[z[\"ingredient\"]] = [z[\"similar_ingredient\"]]\n", + "\n", + "# elif z[\"ingredient\"] not in list(empty.values()):\n", + "# empty[z[\"ingredient\"]].append(z[\"similar_ingredient\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "id": "17c04aa4-7de0-49a6-8d98-6221bedaf694", + "metadata": {}, + "outputs": [], + "source": [ + "for index, z in final3.iterrows():\n", + " if z[\"score\"] > 0.85:\n", + " flag = 0\n", + " if z[\"ingredient\"] in list(empty.keys()):\n", + " flag = 1\n", + " empty[z[\"ingredient\"]].append(z[\"similar_ingredient\"])\n", + " \n", + " else: \n", + " for key, value in empty.items():\n", + " if z[\"ingredient\"] in value:\n", + " flag = 1\n", + " empty[key].append(z[\"similar_ingredient\"])\n", + " if flag==0:\n", + " empty[z[\"ingredient\"]] = [z[\"similar_ingredient\"]]" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "id": "9d0e7648-ceda-4d9f-b0f9-d25cbc587fcb", + "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", + "
01234567891011121314
saltrock saltsodium saltsaltNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
pepperground peppermountain pepperbell pepperpepperNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
onionbaby onionNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
butterbutter spreadbutterNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
milkmilk ofmilkNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
................................................
parmesan cheese pasta ronifettuccine alfredo pasta ronipasta roniparmesan cheese pasta roniNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
antelope cutletantelope steakantelope cutletNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
baby lettucebaby leaf lettucebaby lettuceNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
banana muffin mixbanana nut muffin mixbanana muffin mixNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
multigrain cerealmulti-grain cerealmultigrain cerealNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
\n", + "

1368 rows × 15 columns

\n", + "
" + ], + "text/plain": [ + " 0 1 \n", + "salt rock salt sodium salt \\\n", + "pepper ground pepper mountain pepper \n", + "onion baby onion None \n", + "butter butter spread butter \n", + "milk milk of milk \n", + "... ... ... \n", + "parmesan cheese pasta roni fettuccine alfredo pasta roni pasta roni \n", + "antelope cutlet antelope steak antelope cutlet \n", + "baby lettuce baby leaf lettuce baby lettuce \n", + "banana muffin mix banana nut muffin mix banana muffin mix \n", + "multigrain cereal multi-grain cereal multigrain cereal \n", + "\n", + " 2 3 4 5 \n", + "salt salt None None None \\\n", + "pepper bell pepper pepper None None \n", + "onion None None None None \n", + "butter None None None None \n", + "milk None None None None \n", + "... ... ... ... ... \n", + "parmesan cheese pasta roni parmesan cheese pasta roni None None None \n", + "antelope cutlet None None None None \n", + "baby lettuce None None None None \n", + "banana muffin mix None None None None \n", + "multigrain cereal None None None None \n", + "\n", + " 6 7 8 9 10 11 12 13 \n", + "salt None None None None None None None None \\\n", + "pepper None None None None None None None None \n", + "onion None None None None None None None None \n", + "butter None None None None None None None None \n", + "milk None None None None None None None None \n", + "... ... ... ... ... ... ... ... ... \n", + "parmesan cheese pasta roni None None None None None None None None \n", + "antelope cutlet None None None None None None None None \n", + "baby lettuce None None None None None None None None \n", + "banana muffin mix None None None None None None None None \n", + "multigrain cereal None None None None None None None None \n", + "\n", + " 14 \n", + "salt None \n", + "pepper None \n", + "onion None \n", + "butter None \n", + "milk None \n", + "... ... \n", + "parmesan cheese pasta roni None \n", + "antelope cutlet None \n", + "baby lettuce None \n", + "banana muffin mix None \n", + "multigrain cereal None \n", + "\n", + "[1368 rows x 15 columns]" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pd.DataFrame.from_dict(empty, orient=\"index\")" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "32f1ab41-3dc2-4cdc-9c24-680a58f018fb", + "metadata": {}, + "outputs": [], + "source": [ + "yz = pd.DataFrame.from_dict(empty, orient=\"index\").reset_index()" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "id": "88247851-87fe-4153-83b0-bc8a8f08e7aa", + "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", + "
index01234567891011121314
0saltrock saltsodium saltsaltNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
\n", + "
" + ], + "text/plain": [ + " index 0 1 2 3 4 5 6 7 8 \n", + "0 salt rock salt sodium salt salt None None None None None None \\\n", + "\n", + " 9 10 11 12 13 14 \n", + "0 None None None None None None " + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "yz[yz[\"index\"]==\"salt\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "608a29a6-c4e8-47a0-becb-3464b58f0982", + "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", + "
index01234567891011121314
0saltrock saltsodium saltsaltNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
1pepperground peppermountain pepperbell pepperpepperNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
2onionbaby onionNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
3butterbutter spreadbutterNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
4milkmilk ofmilkNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
...................................................
1363parmesan cheese pasta ronifettuccine alfredo pasta ronipasta roniparmesan cheese pasta roniNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
1364antelope cutletantelope steakantelope cutletNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
1365baby lettucebaby leaf lettucebaby lettuceNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
1366banana muffin mixbanana nut muffin mixbanana muffin mixNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
1367multigrain cerealmulti-grain cerealmultigrain cerealNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
\n", + "

1368 rows × 16 columns

\n", + "
" + ], + "text/plain": [ + " index 0 \n", + "0 salt rock salt \\\n", + "1 pepper ground pepper \n", + "2 onion baby onion \n", + "3 butter butter spread \n", + "4 milk milk of \n", + "... ... ... \n", + "1363 parmesan cheese pasta roni fettuccine alfredo pasta roni \n", + "1364 antelope cutlet antelope steak \n", + "1365 baby lettuce baby leaf lettuce \n", + "1366 banana muffin mix banana nut muffin mix \n", + "1367 multigrain cereal multi-grain cereal \n", + "\n", + " 1 2 3 4 5 6 \n", + "0 sodium salt salt None None None None \\\n", + "1 mountain pepper bell pepper pepper None None None \n", + "2 None None None None None None \n", + "3 butter None None None None None \n", + "4 milk None None None None None \n", + "... ... ... ... ... ... ... \n", + "1363 pasta roni parmesan cheese pasta roni None None None None \n", + "1364 antelope cutlet None None None None None \n", + "1365 baby lettuce None None None None None \n", + "1366 banana muffin mix None None None None None \n", + "1367 multigrain cereal None None None None None \n", + "\n", + " 7 8 9 10 11 12 13 14 \n", + "0 None None None None None None None None \n", + "1 None None None None None None None None \n", + "2 None None None None None None None None \n", + "3 None None None None None None None None \n", + "4 None None None None None None None None \n", + "... ... ... ... ... ... ... ... ... \n", + "1363 None None None None None None None None \n", + "1364 None None None None None None None None \n", + "1365 None None None None None None None None \n", + "1366 None None None None None None None None \n", + "1367 None None None None None None None None \n", + "\n", + "[1368 rows x 16 columns]" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "yz" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "id": "7d741ad1-d9fb-4ace-a882-312deb6c47a9", + "metadata": {}, + "outputs": [], + "source": [ + "ab = yz.melt(id_vars=['index'])" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "id": "3fb4231f-5533-4deb-beb5-d883036c58a1", + "metadata": {}, + "outputs": [], + "source": [ + "cd = ab[~ab[\"value\"].isna()]" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "id": "f555c514-71f9-4eb8-8860-7383c6c236a1", + "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", + "
ingredientcount
0salt93053
1pepper86475
2sugar85302
3onion76690
4butter65070
.........
7391yigandes bean1
7392yogurt spread1
7393zatarain cajun seasoning1
7394coating meat1
7395zwieback toast crumb1
\n", + "

7396 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " ingredient count\n", + "0 salt 93053\n", + "1 pepper 86475\n", + "2 sugar 85302\n", + "3 onion 76690\n", + "4 butter 65070\n", + "... ... ...\n", + "7391 yigandes bean 1\n", + "7392 yogurt spread 1\n", + "7393 zatarain cajun seasoning 1\n", + "7394 coating meat 1\n", + "7395 zwieback toast crumb 1\n", + "\n", + "[7396 rows x 2 columns]" + ] + }, + "execution_count": 77, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ingredient_df" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "id": "fe66d594-e577-4a25-9fa5-ba4247878697", + "metadata": {}, + "outputs": [], + "source": [ + "cd.to_csv(\"temp5.csv\", index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "880ab1b9-8c1e-4a00-8db1-afac7c4c49f8", + "metadata": {}, + "outputs": [], + "source": [ + "pd.DataFrame.from_dict(empty, orient=\"index\").to_csv(\"temp3.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 183, + "id": "0f6bc99f-c861-43fc-aa07-cef731c44ac8", + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "All arrays must be of the same length", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[183], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDataFrame\u001b[49m\u001b[43m(\u001b[49m\u001b[43mempty\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/frame.py:708\u001b[0m, in \u001b[0;36mDataFrame.__init__\u001b[0;34m(self, data, index, columns, dtype, copy)\u001b[0m\n\u001b[1;32m 702\u001b[0m mgr \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_init_mgr(\n\u001b[1;32m 703\u001b[0m data, axes\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mindex\u001b[39m\u001b[38;5;124m\"\u001b[39m: index, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcolumns\u001b[39m\u001b[38;5;124m\"\u001b[39m: columns}, dtype\u001b[38;5;241m=\u001b[39mdtype, copy\u001b[38;5;241m=\u001b[39mcopy\n\u001b[1;32m 704\u001b[0m )\n\u001b[1;32m 706\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(data, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 707\u001b[0m \u001b[38;5;66;03m# GH#38939 de facto copy defaults to False only in non-dict cases\u001b[39;00m\n\u001b[0;32m--> 708\u001b[0m mgr \u001b[38;5;241m=\u001b[39m \u001b[43mdict_to_mgr\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mindex\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcolumns\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcopy\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcopy\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtyp\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmanager\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 709\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(data, ma\u001b[38;5;241m.\u001b[39mMaskedArray):\n\u001b[1;32m 710\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mma\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m mrecords\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/construction.py:481\u001b[0m, in \u001b[0;36mdict_to_mgr\u001b[0;34m(data, index, columns, dtype, typ, copy)\u001b[0m\n\u001b[1;32m 477\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 478\u001b[0m \u001b[38;5;66;03m# dtype check to exclude e.g. range objects, scalars\u001b[39;00m\n\u001b[1;32m 479\u001b[0m arrays \u001b[38;5;241m=\u001b[39m [x\u001b[38;5;241m.\u001b[39mcopy() \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(x, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdtype\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01melse\u001b[39;00m x \u001b[38;5;28;01mfor\u001b[39;00m x \u001b[38;5;129;01min\u001b[39;00m arrays]\n\u001b[0;32m--> 481\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43marrays_to_mgr\u001b[49m\u001b[43m(\u001b[49m\u001b[43marrays\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcolumns\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mindex\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtyp\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtyp\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconsolidate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcopy\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/construction.py:115\u001b[0m, in \u001b[0;36marrays_to_mgr\u001b[0;34m(arrays, columns, index, dtype, verify_integrity, typ, consolidate)\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m verify_integrity:\n\u001b[1;32m 113\u001b[0m \u001b[38;5;66;03m# figure out the index, if necessary\u001b[39;00m\n\u001b[1;32m 114\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m index \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 115\u001b[0m index \u001b[38;5;241m=\u001b[39m \u001b[43m_extract_index\u001b[49m\u001b[43m(\u001b[49m\u001b[43marrays\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 116\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 117\u001b[0m index \u001b[38;5;241m=\u001b[39m ensure_index(index)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/construction.py:655\u001b[0m, in \u001b[0;36m_extract_index\u001b[0;34m(data)\u001b[0m\n\u001b[1;32m 653\u001b[0m lengths \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(\u001b[38;5;28mset\u001b[39m(raw_lengths))\n\u001b[1;32m 654\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(lengths) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m--> 655\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAll arrays must be of the same length\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 657\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m have_dicts:\n\u001b[1;32m 658\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 659\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMixing dicts with non-Series may lead to ambiguous ordering.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 660\u001b[0m )\n", + "\u001b[0;31mValueError\u001b[0m: All arrays must be of the same length" + ] + } + ], + "source": [ + "pd.DataFrame(empty)" + ] + }, + { + "cell_type": "code", + "execution_count": 170, + "id": "2a2b813c-bc04-4fc4-b061-2e8f8c9a6713", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'2% fat cottage cheese': ['1% fat cottage cheese',\n", + " '1% fat cottage cheese',\n", + " '2% large-curd cottage cheese',\n", + " '4% fat cottage cheese'],\n", + " '1% low-fat milk': ['1% low-fat chocolate milk',\n", + " '1% low-fat chocolate milk',\n", + " '2% low-fat milk'],\n", + " '1% low-fat chocolate milk': ['1% low-fat milk', '1% low-fat milk'],\n", + " '15 bean soup mix': ['10 bean soup mix',\n", + " '10 bean soup mix',\n", + " '13 bean soup mix',\n", + " 'dry 18 bean soup mix'],\n", + " 'low-fat flour tortillas': ['10 inch low-fat flour tortillas',\n", + " '10 inch low-fat flour tortillas',\n", + " 'low-fat corn tortillas'],\n", + " '9 unbaked pie crust': ['10 pie crust',\n", + " '10 pie crust',\n", + " '9 baked deep dish pie crust'],\n", + " 'unbaked 8-inch pie shells': ['10-inch baked pie shells',\n", + " '10-inch baked pie shells'],\n", + " '6-inch corn tortillas': ['10-inch corn tortillas',\n", + " '10-inch corn tortillas',\n", + " '6-inch tortillas'],\n", + " '9-inch deep dish pie crust': ['10-inch deep dish pie crust',\n", + " '10-inch deep dish pie crust',\n", + " '9-inch baked pie crust',\n", + " '9-inch deep dish pie crusts'],\n", + " '12-inch flour tortilla': ['10-inch flour tortilla',\n", + " '10-inch flour tortilla',\n", + " '12-inch tortilla'],\n", + " '12-inch flour tortillas': ['10-inch flour tortillas',\n", + " '10-inch flour tortillas',\n", + " '6-inch flour tortillas'],\n", + " 'unbaked 10-inch pie shell': ['10-inch pie shell',\n", + " '10-inch pie shell',\n", + " '10-inch unbaked deep-dish pie shell'],\n", + " '10-inch flour tortillas': ['10-inch sun-dried tomato tortillas',\n", + " '10-inch sun-dried tomato tortillas',\n", + " '9-inch flour tortillas'],\n", + " '8-inch whole wheat flour tortillas': ['10-inch whole wheat tortillas',\n", + " '10-inch whole wheat tortillas'],\n", + " 'brownberry herb stuffing mix': ['10-minute herb stuffing mix',\n", + " '10-minute herb stuffing mix'],\n", + " '10-inch flour tortilla': ['12-inch flour tortilla',\n", + " '12-inch flour tortilla'],\n", + " '6-inch flour tortillas': ['12-inch flour tortillas',\n", + " '12-inch flour tortillas',\n", + " '8-inch flour tortillas'],\n", + " '15 inch pizza crusts': ['12-inch pizza crust', '12-inch pizza crust'],\n", + " '16 bean mix': ['15 bean mix', '15 bean mix'],\n", + " '13 bean soup mix': ['15 bean soup mix', '15 bean soup mix'],\n", + " '12-inch pizza crust': ['15 inch pizza crusts', '15 inch pizza crusts'],\n", + " '15 bean mix': ['16 bean mix', '16 bean mix'],\n", + " '2% mozzarella cheese': ['2% cheddar cheese', '2% cheddar cheese'],\n", + " 'evaporated 2% milk': ['2% evaporated milk', '2% evaporated milk'],\n", + " '2% large-curd cottage cheese': ['2% fat cottage cheese',\n", + " '2% fat cottage cheese'],\n", + " 'mexican blend cheese': ['2% mexican cheese blend',\n", + " '2% mexican cheese blend',\n", + " 'mexican cheese',\n", + " 'reduced-fat mexican cheese blend'],\n", + " '2% cheddar cheese': ['2% mozzarella cheese', '2% mozzarella cheese'],\n", + " '7 bean mix': ['3 bean mix', '3 bean mix'],\n", + " '3-inch tart shells': ['3-inch pie pastry tart shells',\n", + " '3-inch pie pastry tart shells'],\n", + " '3-inch pie pastry tart shells': ['3-inch tart shells', '3-inch tart shells'],\n", + " '35% cream': ['35 % fresh cream', '35 % fresh cream'],\n", + " '35 % fresh cream': ['35% cream', '35% cream'],\n", + " '6-inch pitas': ['5-inch pitas', '5-inch pitas'],\n", + " 'fat-free whole wheat pita bread': ['6 inch fat-free whole wheat pita bread',\n", + " '6 inch fat-free whole wheat pita bread'],\n", + " '10-inch corn tortillas': ['6-inch corn tortillas', '6-inch corn tortillas'],\n", + " '5-inch pitas': ['6-inch pitas', '6-inch pitas'],\n", + " '10-inch whole wheat tortillas': ['6-inch whole wheat tortilla',\n", + " '6-inch whole wheat tortilla',\n", + " '8-inch whole wheat flour tortillas'],\n", + " '3 bean mix': ['7 bean mix', '7 bean mix'],\n", + " '7-up soda': ['7-up', '7-up', 'diet 7-up'],\n", + " '7-up': ['7-up soda', '7-up soda'],\n", + " '80% lean ground beef': ['70% lean ground beef',\n", + " '70% lean ground beef',\n", + " '90% lean ground beef'],\n", + " '9 inch pie shell': ['8 inch pie shell', '8 inch pie shell', '9 pie shell'],\n", + " 'lavash bread': ['8-grain bread', '8-grain bread', 'twelve-grain bread'],\n", + " '8-inch fat-free flour tortillas': ['8-inch 97% fat free flour tortillas',\n", + " '8-inch 97% fat free flour tortillas'],\n", + " '8-inch unbaked pie shell': ['8-inch baked pie shell',\n", + " '8-inch baked pie shell',\n", + " '8-inch double-crust pie shell',\n", + " 'unbaked 8-inch pie shell'],\n", + " '8-inch flour tortillas': ['8-inch fat-free flour tortillas',\n", + " '8-inch fat-free flour tortillas'],\n", + " '8-inch ready-made graham cracker crust': ['8-inch graham cracker crust',\n", + " '8-inch graham cracker crust'],\n", + " '6-inch whole wheat tortilla': ['8-inch low-carb whole wheat tortilla',\n", + " '8-inch low-carb whole wheat tortilla'],\n", + " '8-inch graham cracker crust': ['8-inch ready-made graham cracker crust',\n", + " '8-inch ready-made graham cracker crust'],\n", + " 'unbaked 8-inch pie shell': ['8-inch unbaked pie shell',\n", + " '8-inch unbaked pie shell',\n", + " 'unbaked 8-inch pie shells'],\n", + " '70% lean ground beef': ['80% lean ground beef', '80% lean ground beef'],\n", + " '95% lean ground beef': ['85% lean ground beef', '85% lean ground beef'],\n", + " '9 in. unbaked pastry shells': ['9 in. unbaked pastry shell',\n", + " '9 in. unbaked pastry shell'],\n", + " '9 in. unbaked pastry shell': ['9 in. unbaked pastry shells',\n", + " '9 in. unbaked pastry shells',\n", + " '9 in.baked pastry shell'],\n", + " '8 inch pie shell': ['9 inch pie shell', '9 inch pie shell'],\n", + " '9 unbaked pie shells': ['9 pastry pie shells',\n", + " '9 pastry pie shells',\n", + " '9 unbaked pie shell'],\n", + " '9 baked deep dish pie crust': ['9 unbaked pie crust', '9 unbaked pie crust'],\n", + " '9 pastry pie shells': ['9 unbaked pie shells', '9 unbaked pie shells'],\n", + " '8-grain bread': ['9-grain bread',\n", + " '9-grain bread',\n", + " 'cinnamon-raisin bread',\n", + " 'cinnamon-swirl bread',\n", + " 'honey-wheat bread',\n", + " 'lavash bread',\n", + " 'muffuletta bread',\n", + " 'oatnut bread',\n", + " 'wasa bread'],\n", + " '9-inch baked pie crust': ['9-inch baked pie crusts',\n", + " '9-inch baked pie crusts',\n", + " '9-inch chocolate pie crust',\n", + " '9-inch deep dish pie crust',\n", + " 'unbaked 9-inch pie crust'],\n", + " '9-inch pie shells': ['9-inch double-crust pie shells',\n", + " '9-inch double-crust pie shells',\n", + " '9-inch pie shell'],\n", + " 'reduced-fat 9-inch graham cracker crust': ['9-inch graham cracker crust',\n", + " '9-inch graham cracker crust'],\n", + " '9-inch graham cracker crust': ['9-inch graham cracker crusts',\n", + " '9-inch graham cracker crusts',\n", + " '9-inch low-fat chocolate graham cracker crust',\n", + " 'reduced-fat 9-inch graham cracker crust'],\n", + " 'chocolate cake layers': ['9-inch layers of chocolate cake',\n", + " '9-inch layers of chocolate cake'],\n", + " '9-inch pie shell': ['9-inch low-fat pie shell', '9-inch low-fat pie shell'],\n", + " 'oreo cookie pie crust': ['9-inch oreo cookie pie crust',\n", + " '9-inch oreo cookie pie crust',\n", + " 'oreo cookie pie crusts'],\n", + " '9-inch double-crust pie shells': ['9-inch pie shells', '9-inch pie shells'],\n", + " 'spinach tortillas': ['9-inch spinach tortillas',\n", + " '9-inch spinach tortillas',\n", + " 'spinach tortilla'],\n", + " '93% lean ground beef': ['92% lean ground beef', '92% lean ground beef'],\n", + " '92% lean ground beef': ['93% lean ground beef', '93% lean ground beef'],\n", + " '96% lean ground beef': ['94% lean ground beef', '94% lean ground beef'],\n", + " '97% lean ground beef': ['95% lean ground beef',\n", + " '95% lean ground beef',\n", + " '98% lean ground beef'],\n", + " '94% lean ground beef': ['96% lean ground beef', '96% lean ground beef'],\n", + " '97% fat-free shaved leg ham': ['97% fat-free cooked ham',\n", + " '97% fat-free cooked ham'],\n", + " '97% fat-free cooked ham': ['97% fat-free shaved leg ham',\n", + " '97% fat-free shaved leg ham'],\n", + " '98% lean ground beef': ['97% lean ground beef', '97% lean ground beef'],\n", + " '98% fat free cream of broccoli soup': ['98% fat free broccoli cheese soup',\n", + " '98% fat free broccoli cheese soup',\n", + " '98% fat free condensed cream of celery soup'],\n", + " '98% fat free broccoli cheese soup': ['98% fat free cream of broccoli soup',\n", + " '98% fat free cream of broccoli soup'],\n", + " '98% fat-free cream of mushroom soup': ['98% fat-free condensed mushroom soup',\n", + " '98% fat-free condensed mushroom soup'],\n", + " 'fat-free cream of chicken soup': ['98% fat-free cream of chicken soup',\n", + " '98% fat-free cream of chicken soup'],\n", + " '98% fat-free condensed mushroom soup': ['98% fat-free cream of mushroom soup',\n", + " '98% fat-free cream of mushroom soup'],\n", + " 'a.1. steak sauce': ['a.1. original sauce',\n", + " 'a.1. original sauce',\n", + " 'steak sauce'],\n", + " 'steak sauce': ['a.1. steak sauce', 'a.1. steak sauce'],\n", + " 'absolut vodka': ['absolut citron vodka',\n", + " 'absolut citron vodka',\n", + " 'absolut kurant vodka',\n", + " 'absolut mandarin vodka'],\n", + " 'absolut citron vodka': ['absolut vodka', 'absolut vodka'],\n", + " 'annatto seeds': ['achiote seeds', 'achiote seeds'],\n", + " 'dry active yeast': ['active dry yeast',\n", + " 'active dry yeast',\n", + " 'dry active yeast'],\n", + " 'adobo seasoning': ['adobo sauce', 'adobo sauce'],\n", + " 'adobo sauce': ['adobo seasoning', 'adobo seasoning'],\n", + " 'meat tenderizer': ['adolphs meat tenderizer', 'adolphs meat tenderizer'],\n", + " 'fabada beans': ['adzuki beans', 'adzuki beans'],\n", + " 'agave syrup': ['agave', 'agave', 'agave nectar'],\n", + " 'agave nectar': ['agave syrup', 'agave syrup'],\n", + " 'aged white cheddar cheese': ['aged cheddar cheese', 'aged cheddar cheese'],\n", + " 'aged cheddar cheese': ['aged white cheddar cheese',\n", + " 'aged white cheddar cheese',\n", + " 'old cheddar cheese'],\n", + " 'flounder fillets': ['ahi fillets',\n", + " 'ahi fillets',\n", + " 'fish fillets',\n", + " 'sturgeon fillets'],\n", + " 'tuna steaks': ['ahi tuna steaks', 'ahi tuna steaks', 'tuna steak'],\n", + " 'bell peppers': ['aji bell peppers',\n", + " 'aji bell peppers',\n", + " 'mixed peppers',\n", + " 'sweet bell peppers'],\n", + " 'aji panca chilies': ['aji panca chile', 'aji panca chile'],\n", + " 'aji panca chile': ['aji panca chilies', 'aji panca chilies'],\n", + " 'ajinomoto': ['aji-no-moto', 'aji-no-moto', 'ajinomoto'],\n", + " 'starkist tuna': ['albacore tuna', 'albacore tuna'],\n", + " 'tuna in water': ['albacore tuna in water',\n", + " 'albacore tuna in water',\n", + " 'tuna in brine'],\n", + " 'liquor': ['alcohol', 'alcohol'],\n", + " 'alfalfa sprout': ['alfalfa', 'alfalfa', 'alfalfa sprouts'],\n", + " 'alfalfa': ['alfalfa sprout', 'alfalfa sprout'],\n", + " 'alfredo sauce mix': ['alfredo noodles mix', 'alfredo noodles mix'],\n", + " 'garlic alfredo sauce': ['alfredo sauce',\n", + " 'alfredo sauce',\n", + " 'roasted garlic alfredo sauce'],\n", + " 'alfredo sauce': ['alfredo sauce mix',\n", + " 'alfredo sauce mix',\n", + " 'reduced-fat alfredo sauce'],\n", + " 'parmesan and mozzarella pasta sauce': ['alfredo sauce with parmesan cheese',\n", + " 'alfredo sauce with parmesan cheese',\n", + " 'parmesan pasta sauce with roasted garlic'],\n", + " 'alize red passion liqueur': ['alize gold passion liqueur',\n", + " 'alize gold passion liqueur'],\n", + " 'alize gold passion liqueur': ['alize red passion liqueur',\n", + " 'alize red passion liqueur'],\n", + " 'cavenders all purpose greek seasoning': ['all purpose greek seasoning',\n", + " 'all purpose greek seasoning',\n", + " 'cavenders salt-free all purpose greek seasoning'],\n", + " 'kelloggs all-bran cereal': ['all-bran cereal',\n", + " 'all-bran cereal',\n", + " 'kelloggs croutettes',\n", + " 'kelloggs just right cereal'],\n", + " 'all-bran cereal': ['all-bran cereal with raisins',\n", + " 'all-bran cereal with raisins',\n", + " 'kelloggs all-bran cereal'],\n", + " 'unsifted all-purpose flour': ['all-purpose flour',\n", + " 'all-purpose flour',\n", + " 'unsifted flour'],\n", + " 'plain white flour': ['all-purpose white flour',\n", + " 'all-purpose white flour',\n", + " 'plain flour',\n", + " 'white flour'],\n", + " 'alligator sausage': ['alligator meat', 'alligator meat'],\n", + " 'alligator meat': ['alligator sausage', 'alligator sausage'],\n", + " 'allspice berry': ['allspice', 'allspice', 'allspice berries'],\n", + " 'allspice berries': ['allspice berry', 'allspice berry'],\n", + " 'chocolate almond bark': ['almond bark', 'almond bark'],\n", + " 'smooth almond butter': ['almond butter', 'almond butter'],\n", + " 'almond cookies': ['almond cookie', 'almond cookie'],\n", + " 'almond cookie': ['almond cookies', 'almond cookies'],\n", + " 'almond liqueur': ['almond flavored liqueur', 'almond flavored liqueur'],\n", + " 'honey nut granola': ['almond granola', 'almond granola'],\n", + " 'almond halves': ['almond halve', 'almond halve'],\n", + " 'almond halve': ['almond halves', 'almond halves'],\n", + " 'miniature almond joy bars': ['almond joy candy bars',\n", + " 'almond joy candy bars'],\n", + " 'almond flavored liqueur': ['almond liqueur', 'almond liqueur'],\n", + " 'light almond milk': ['almond milk', 'almond milk'],\n", + " 'bitter almond oil': ['almond oil', 'almond oil'],\n", + " 'chocolate-covered toffee bits': ['almond toffee bits', 'almond toffee bits'],\n", + " 'arrack liqueur': ['almond-flavored liqueur',\n", + " 'almond-flavored liqueur',\n", + " 'orangecello liqueur'],\n", + " 'green olives': ['almond-stuffed green olives',\n", + " 'almond-stuffed green olives',\n", + " 'green italian olives',\n", + " 'jalapeno-stuffed green olives'],\n", + " 'sweet almonds': ['almonds', 'almonds'],\n", + " 'liquid aloe vera': ['aloe juice', 'aloe juice', 'aloe vera gel'],\n", + " 'green mangoes': ['alphonso mangoes', 'alphonso mangoes', 'mangoes'],\n", + " 'amaranth grain': ['amaranth', 'amaranth'],\n", + " 'amaranth': ['amaranth grain', 'amaranth grain'],\n", + " 'amaretti cookies': ['amaretti cookie', 'amaretti cookie'],\n", + " 'cookie crumbs': ['amaretti cookie crumbs',\n", + " 'amaretti cookie crumbs',\n", + " 'cake crumbs',\n", + " 'chocolate cookie crumbs',\n", + " 'oatmeal cookie crumbs'],\n", + " 'amaretti cookie': ['amaretti cookies', 'amaretti cookies'],\n", + " 'amaretto liqueur': ['amaretto',\n", + " 'amaretto',\n", + " 'amaretto cream liqueur',\n", + " 'amaretto di saronno liqueur',\n", + " 'cointreau liqueur',\n", + " 'disaronno liquor'],\n", + " 'french vanilla flavored coffee creamer': ['amaretto flavored coffee creamer',\n", + " 'amaretto flavored coffee creamer',\n", + " 'french vanilla liquid coffee creamer',\n", + " 'french vanilla non-dairy coffee creamer'],\n", + " 'amaretto cream liqueur': ['amaretto liqueur',\n", + " 'amaretto liqueur',\n", + " 'amarula cream liqueur'],\n", + " 'amaretto': ['amaretto syrup', 'amaretto syrup'],\n", + " 'non-dairy liquid coffee creamer': ['amaretto-flavored nondairy liquid creamer',\n", + " 'amaretto-flavored nondairy liquid creamer',\n", + " 'non-dairy coffee creamer'],\n", + " 'reduced-fat american cheese': ['american cheese', 'american cheese'],\n", + " 'american cheese': ['american cheese spread',\n", + " 'american cheese spread',\n", + " 'reduced-fat american cheese'],\n", + " 'ground ancho chili pepper': ['ancho chili',\n", + " 'ancho chili',\n", + " 'ground chipotle chile pepper'],\n", + " 'ancho chili': ['ancho chili puree',\n", + " 'ancho chili puree',\n", + " 'ground ancho chili pepper'],\n", + " 'dry ancho chilies': ['ancho chilies',\n", + " 'ancho chilies',\n", + " 'dry mexican chilies'],\n", + " 'dried anchovies': ['anchovies',\n", + " 'anchovies',\n", + " 'dried anchovy',\n", + " 'salted anchovies'],\n", + " 'anchovy packed in oil': ['anchovies packed in oil',\n", + " 'anchovies packed in oil'],\n", + " 'anchovy fillet': ['anchovy',\n", + " 'anchovy',\n", + " 'anchovy fillets',\n", + " 'salt-packed anchovy fillet'],\n", + " 'anchovy': ['anchovy essence', 'anchovy essence', 'anchovy paste'],\n", + " 'anchovy fillets': ['anchovy fillet', 'anchovy fillet'],\n", + " 'anchovies packed in oil': ['anchovy packed in oil', 'anchovy packed in oil'],\n", + " 'kalamata olives': ['anchovy-stuffed olives',\n", + " 'anchovy-stuffed olives',\n", + " 'kalamata olive'],\n", + " 'andouille sausage': ['andouille chicken sausage',\n", + " 'andouille chicken sausage',\n", + " 'andouille sausages'],\n", + " 'andouille chicken sausage': ['andouille sausage',\n", + " 'andouille sausage',\n", + " 'andouille turkey sausage',\n", + " 'johnsonville andouille dinner sausage'],\n", + " 'queso anejo': ['anejo cheese', 'anejo cheese'],\n", + " 'bakers angel flake sweetened coconut': ['angel flake coconut',\n", + " 'angel flake coconut'],\n", + " 'angel food cake mix': ['angel food cake', 'angel food cake'],\n", + " 'angel food cake': ['angel food cake mix', 'angel food cake mix'],\n", + " 'cooked angel hair pasta': ['angel hair pasta', 'angel hair pasta'],\n", + " 'angel hair pasta': ['angel hair pasta with herbs mix',\n", + " 'angel hair pasta with herbs mix',\n", + " 'cooked angel hair pasta'],\n", + " 'angelica leaves': ['angelica leaf', 'angelica leaf'],\n", + " 'angelica leaf': ['angelica leaves', 'angelica leaves'],\n", + " 'bitters': ['angostura bitters', 'angostura bitters', 'orange bitters'],\n", + " 'low-sodium worcestershire sauce': ['angostura low-sodium worcestershire sauce',\n", + " 'angostura low-sodium worcestershire sauce',\n", + " 'reduced-sodium worcestershire sauce'],\n", + " 'anise flavoring': ['anise', 'anise', 'anise extract'],\n", + " 'anise': ['anise flavoring', 'anise flavoring', 'dried anise'],\n", + " 'anise seeds': ['anise seed', 'anise seed'],\n", + " 'anise seed': ['anise seeds', 'anise seeds'],\n", + " 'anjou pears': ['anjou pear', 'anjou pear'],\n", + " 'anjou pear': ['anjou pears', 'anjou pears'],\n", + " 'achiote seeds': ['annatto seeds', 'annatto seeds'],\n", + " 'gjetost cheese': ['appenzeller cheese',\n", + " 'appenzeller cheese',\n", + " 'burrata cheese',\n", + " 'reblochon cheese'],\n", + " 'apples': ['apple', 'apple'],\n", + " 'brandy': ['apple brandy', 'apple brandy'],\n", + " 'fruit butter': ['apple butter', 'apple butter'],\n", + " 'cider': ['apple cider', 'apple cider'],\n", + " 'cider vinegar': ['apple cider vinegar', 'apple cider vinegar'],\n", + " 'honey nut cheerios': ['apple cinnamon cheerios',\n", + " 'apple cinnamon cheerios',\n", + " 'banana nut cheerios'],\n", + " 'granola cereal': ['apple cinnamon granola cereal',\n", + " 'apple cinnamon granola cereal',\n", + " 'raisin granola'],\n", + " 'fruit jelly': ['apple jelly', 'apple jelly', 'peach jelly'],\n", + " 'fruit juice': ['apple juice',\n", + " 'apple juice',\n", + " 'berry juice',\n", + " 'vegetable juice'],\n", + " 'fruit juice concentrate': ['apple juice concentrate',\n", + " 'apple juice concentrate'],\n", + " 'fruit liqueur': ['apple liqueur', 'apple liqueur'],\n", + " 'pie apple': ['apple pie', 'apple pie', 'pie apples'],\n", + " 'no-sugar-added apple pie filling': ['apple pie filling',\n", + " 'apple pie filling'],\n", + " 'apple pie filling': ['apple pie filling with cinnamon',\n", + " 'apple pie filling with cinnamon',\n", + " 'french apple pie filling',\n", + " 'light apple pie filling',\n", + " 'no-sugar-added apple pie filling',\n", + " 'peach pie filling',\n", + " 'pie filling',\n", + " 'pumpkin pie filling'],\n", + " 'peach schnapps': ['apple schnapps',\n", + " 'apple schnapps',\n", + " 'peach liqueur',\n", + " 'peach vodka'],\n", + " 'apples in syrup': ['apple syrup', 'apple syrup'],\n", + " 'tart cooking apple': ['apple tart mix', 'apple tart mix'],\n", + " 'green apple vodka': ['apple vodka', 'apple vodka'],\n", + " 'fruit yogurt': ['apple yogurt',\n", + " 'apple yogurt',\n", + " 'banana yogurt',\n", + " 'mango yogurt'],\n", + " 'pineapple-orange juice concentrate': ['apple-raspberry juice concentrate',\n", + " 'apple-raspberry juice concentrate'],\n", + " 'center-cut bacon': ['apple-smoked bacon',\n", + " 'apple-smoked bacon',\n", + " 'bacon',\n", + " 'low-sodium bacon',\n", + " 'reduced-fat bacon',\n", + " 'reduced-sodium bacon',\n", + " 'rindless bacon'],\n", + " 'apple': ['apples', 'apples'],\n", + " 'apples for pies': ['apples for pie', 'apples for pie'],\n", + " 'apples for pie': ['apples for pies', 'apples for pies'],\n", + " 'apple syrup': ['apples in syrup', 'apples in syrup', 'fruit syrup'],\n", + " 'no-sugar-added applesauce': ['applesauce', 'applesauce'],\n", + " 'fresh apricot': ['apricot', 'apricot'],\n", + " 'apricot preserves': ['apricot conserve',\n", + " 'apricot conserve',\n", + " 'apricot fruit spread',\n", + " 'low-sugar apricot preserves'],\n", + " 'peach gelatin': ['apricot gelatin', 'apricot gelatin'],\n", + " 'dried apricot halves': ['apricot halves', 'apricot halves', 'dried apricot'],\n", + " 'no-sugar-added apricot jam': ['apricot jam', 'apricot jam'],\n", + " 'peach jell-o': ['apricot jell-o', 'apricot jell-o'],\n", + " 'marmalade': ['apricot marmalade', 'apricot marmalade', 'orange marmalade'],\n", + " 'apricot conserve': ['apricot preserves', 'apricot preserves'],\n", + " 'candied apricots': ['apricots', 'apricots', 'fresh apricots'],\n", + " 'apricots in syrup': ['apricots in light syrup', 'apricots in light syrup'],\n", + " 'apricots in light syrup': ['apricots in syrup', 'apricots in syrup'],\n", + " 'lebanese bread': ['arabic bread', 'arabic bread'],\n", + " 'kombu seaweed': ['arame seaweed',\n", + " 'arame seaweed',\n", + " 'dulse seaweed',\n", + " 'fresh seaweed',\n", + " 'wakame seaweed'],\n", + " 'arbol chiles': ['arbol chile', 'arbol chile', 'chiles de arbol'],\n", + " 'chiles de arbol': ['arbol chiles', 'arbol chiles'],\n", + " 'mexican chili powder': ['arbol chili powder',\n", + " 'arbol chili powder',\n", + " 'mccormick hot mexican style chili powder'],\n", + " 'seasoning': ['aroma seasoning', 'aroma seasoning', 'seasoning salt'],\n", + " 'orangecello liqueur': ['arrack liqueur', 'arrack liqueur'],\n", + " 'artichokes': ['artichoke', 'artichoke'],\n", + " 'artichoke bottoms': ['artichoke bottom', 'artichoke bottom'],\n", + " 'artichoke bottom': ['artichoke bottoms', 'artichoke bottoms'],\n", + " 'artichoke hearts': ['artichoke heart',\n", + " 'artichoke heart',\n", + " 'marinated artichoke hearts',\n", + " 'pickled artichoke hearts',\n", + " 'water-packed artichoke hearts'],\n", + " 'artichoke heart': ['artichoke hearts', 'artichoke hearts'],\n", + " 'pickled artichoke hearts': ['artichoke hearts in brine',\n", + " 'artichoke hearts in brine'],\n", + " 'artichoke': ['artichokes', 'artichokes'],\n", + " 'vanilla flavoring': ['artificial vanilla flavoring',\n", + " 'artificial vanilla flavoring'],\n", + " 'arugula leaf': ['arugula', 'arugula', 'arugula leaves'],\n", + " 'arugula leaves': ['arugula leaf', 'arugula leaf'],\n", + " 'parmesan salad dressing': ['asiago caesar salad dressing',\n", + " 'asiago caesar salad dressing'],\n", + " 'fontina cheese': ['asiago cheese',\n", + " 'asiago cheese',\n", + " 'fontina',\n", + " 'jarlsberg cheese'],\n", + " 'asiago cheese rolls': ['asiago cheese bagels', 'asiago cheese bagels'],\n", + " 'parmesan croutons': ['asiago cheese croutons', 'asiago cheese croutons'],\n", + " 'asiago cheese': ['asiago cheese rolls', 'asiago cheese rolls'],\n", + " 'manouri cheese': ['asiago-parmesan cheese',\n", + " 'asiago-parmesan cheese',\n", + " 'butterkase cheese',\n", + " 'cambozola cheese',\n", + " 'emmenthaler cheese',\n", + " 'fontinella cheese',\n", + " 'friulano cheese',\n", + " 'kasseri cheese',\n", + " 'montasio cheese',\n", + " 'munchee cheese',\n", + " 'piave cheese',\n", + " 'rondele cheese',\n", + " 'stravecchio cheese',\n", + " 'tilsit cheese'],\n", + " 'thai red chili peppers': ['asian chili peppers',\n", + " 'asian chili peppers',\n", + " 'thai peppers'],\n", + " 'chinese chili sauce': ['asian chili sauce', 'asian chili sauce'],\n", + " 'chinese noodles': ['asian noodles',\n", + " 'asian noodles',\n", + " 'chinese egg noodles',\n", + " 'chinese wheat noodles',\n", + " 'fresh chinese noodles',\n", + " 'fried chinese noodles',\n", + " 'hokkien noodles',\n", + " 'shanghai noodles'],\n", + " 'rice flour': ['asian rice flour', 'asian rice flour', 'brown rice flour'],\n", + " 'thai seasoning': ['asian seasoning', 'asian seasoning'],\n", + " 'green asparagus': ['asparagus', 'asparagus', 'white asparagus'],\n", + " 'asparagus spears': ['asparagus spear',\n", + " 'asparagus spear',\n", + " 'reduced-sodium asparagus spears'],\n", + " 'reduced-sodium asparagus spears': ['asparagus spears', 'asparagus spears'],\n", + " 'assorted fresh vegetables': ['assorted fresh vegetable',\n", + " 'assorted fresh vegetable'],\n", + " 'assorted fresh vegetable': ['assorted fresh vegetables',\n", + " 'assorted fresh vegetables'],\n", + " 'mixed herbs': ['assorted herbs',\n", + " 'assorted herbs',\n", + " 'mixed french herbs',\n", + " 'mixed fresh herbs'],\n", + " 'scalloped potatoes mix': ['au gratin potato mix', 'au gratin potato mix'],\n", + " 'au gratin potato mix': ['au gratin potatoes',\n", + " 'au gratin potatoes',\n", + " 'scalloped potatoes mix'],\n", + " 'aubergines': ['aubergine', 'aubergine', 'eggplant'],\n", + " 'eggplant': ['aubergines', 'aubergines', 'eggplant spread'],\n", + " 'avocados': ['avocado', 'avocado'],\n", + " 'frozen avocado dip': ['avocado dip', 'avocado dip'],\n", + " 'avocado': ['avocados', 'avocados'],\n", + " 'baby artichokes': ['baby artichoke', 'baby artichoke'],\n", + " 'baby artichoke': ['baby artichokes', 'baby artichokes'],\n", + " 'arugula': ['baby arugula', 'baby arugula'],\n", + " 'asparagus': ['baby asparagus',\n", + " 'baby asparagus',\n", + " 'canned asparagus',\n", + " 'fresh asparagus',\n", + " 'green asparagus'],\n", + " 'baby back rib racks': ['baby back rib rack', 'baby back rib rack'],\n", + " 'baby back rib rack': ['baby back rib racks', 'baby back rib racks'],\n", + " 'back ribs': ['baby back ribs', 'baby back ribs', 'ribs'],\n", + " 'banana baby food': ['baby banana puree', 'baby banana puree'],\n", + " 'beef liver': ['baby beef liver', 'baby beef liver'],\n", + " 'beets': ['baby beets',\n", + " 'baby beets',\n", + " 'canned beets',\n", + " 'powdered beets',\n", + " 'red beets'],\n", + " 'baby bella mushrooms': ['baby bella mushroom', 'baby bella mushroom'],\n", + " 'baby bella mushroom': ['baby bella mushrooms', 'baby bella mushrooms'],\n", + " 'bok choy': ['baby bok choy', 'baby bok choy', 'choy sum', 'gai choy'],\n", + " 'butter beans': ['baby butter beans',\n", + " 'baby butter beans',\n", + " 'dried butter beans'],\n", + " 'calamari': ['baby calamari', 'baby calamari'],\n", + " 'shoestring carrots': ['baby carrots', 'baby carrots'],\n", + " 'baby chickens': ['baby chicken', 'baby chicken'],\n", + " 'baby chicken': ['baby chickens', 'baby chickens'],\n", + " 'littleneck clams': ['baby clams',\n", + " 'baby clams',\n", + " 'cherrystone clams',\n", + " 'clams in shell',\n", + " 'hard-shelled clams'],\n", + " 'sweet corn': ['baby corn',\n", + " 'baby corn',\n", + " 'candy corn',\n", + " 'cream-style sweet corn',\n", + " 'fresh corn'],\n", + " 'baby dill pickles': ['baby dill pickle', 'baby dill pickle'],\n", + " 'baby dill pickle': ['baby dill pickles', 'baby dill pickles'],\n", + " 'baby eggplants': ['baby eggplant', 'baby eggplant', 'eggplants'],\n", + " 'baby eggplant': ['baby eggplants', 'baby eggplants'],\n", + " 'french beans': ['baby french beans',\n", + " 'baby french beans',\n", + " 'fresh french beans'],\n", + " 'baby peas': ['baby green peas',\n", + " 'baby green peas',\n", + " 'snap peas',\n", + " 'sweet peas',\n", + " 'tiny peas'],\n", + " 'mixed baby greens': ['baby greens', 'baby greens', 'mixed greens'],\n", + " 'leaf lettuce': ['baby leaf lettuce',\n", + " 'baby leaf lettuce',\n", + " 'green leaf lettuce',\n", + " 'lettuce',\n", + " 'lettuce leaves'],\n", + " 'leeks': ['baby leeks', 'baby leeks', 'dried leeks', 'leek'],\n", + " 'dried baby lima beans': ['baby lima beans', 'baby lima beans'],\n", + " 'octopus': ['baby octopus', 'baby octopus'],\n", + " 'sweet onion': ['baby onion', 'baby onion', 'fresh onion', 'onion'],\n", + " 'onions': ['baby onions', 'baby onions', 'sweet onions'],\n", + " 'oysters': ['baby oysters', 'baby oysters'],\n", + " 'baby green peas': ['baby peas', 'baby peas', 'green peas'],\n", + " 'plums': ['baby plums', 'baby plums'],\n", + " 'portabella mushrooms': ['baby portabella mushrooms',\n", + " 'baby portabella mushrooms',\n", + " 'dried portabella mushrooms',\n", + " 'portabella mushroom'],\n", + " 'baby red potatoes': ['baby potatoes', 'baby potatoes', 'baby red potato'],\n", + " 'red sweet peppers': ['baby red peppers',\n", + " 'baby red peppers',\n", + " 'red peppers',\n", + " 'sweet red cherry peppers',\n", + " 'sweet red peppers'],\n", + " 'baby red potato': ['baby red potatoes', 'baby red potatoes'],\n", + " 'butterfinger candy bars': ['baby ruth candy bars',\n", + " 'baby ruth candy bars',\n", + " 'butterfinger bbs',\n", + " 'miniature butterfinger candy bars'],\n", + " 'salad leaves': ['baby salad leaves', 'baby salad leaves'],\n", + " 'small shrimp': ['baby shrimp', 'baby shrimp'],\n", + " 'baby spinach leaves': ['baby spinach', 'baby spinach'],\n", + " 'spinach leaves': ['baby spinach leaves',\n", + " 'baby spinach leaves',\n", + " 'fresh spinach leaves',\n", + " 'raw spinach leaves'],\n", + " 'baby sweet corn cobs': ['baby sweet corn cob',\n", + " 'baby sweet corn cob',\n", + " 'sweet corn cobs'],\n", + " 'sweet corn cobs': ['baby sweet corn cobs',\n", + " 'baby sweet corn cobs',\n", + " 'corn cobs',\n", + " 'miniature corn cobs'],\n", + " 'swiss cheese': ['baby swiss cheese', 'baby swiss cheese'],\n", + " 'fire-roasted tomatoes': ['baby tomatoes',\n", + " 'baby tomatoes',\n", + " 'low-sodium tomatoes'],\n", + " 'turnip': ['baby turnip', 'baby turnip', 'turnip greens'],\n", + " 'turnips': ['baby turnips', 'baby turnips'],\n", + " 'bacardi light rum': ['bacardi 151 rum',\n", + " 'bacardi 151 rum',\n", + " 'bacardi dark rum',\n", + " 'bacardi limon',\n", + " 'bacardi peach red rum'],\n", + " 'bacardi dark rum': ['bacardi light rum', 'bacardi light rum'],\n", + " 'baby back ribs': ['back ribs', 'back ribs'],\n", + " 'king crab meat': ['backfin crab meat',\n", + " 'backfin crab meat',\n", + " 'blue crab meat'],\n", + " 'bacon pieces': ['bacon bits', 'bacon bits', 'bacon piece'],\n", + " 'cheddar cheese': ['bacon cheddar cheese',\n", + " 'bacon cheddar cheese',\n", + " 'cheddar cheese powder',\n", + " 'cheddar cheese spread',\n", + " 'light cheddar cheese',\n", + " 'shredded cheddar cheese',\n", + " 'white cheddar cheese'],\n", + " 'fatty bacon': ['bacon fat', 'bacon fat'],\n", + " 'bacon piece': ['bacon pieces', 'bacon pieces'],\n", + " 'low-fat bacon ranch dressing': ['bacon ranch dressing',\n", + " 'bacon ranch dressing',\n", + " 'low-fat ranch dressing'],\n", + " 'bagels': ['bagel',\n", + " 'bagel',\n", + " 'blueberry bagels',\n", + " 'miniature bagels',\n", + " 'onion bagels'],\n", + " 'cinnamon bagel chips': ['bagel chips', 'bagel chips'],\n", + " 'bagel': ['bagels', 'bagels'],\n", + " 'french baguette': ['baguette', 'baguette', 'french baguettes'],\n", + " 'kabsa spice mix': ['baharat spice mix', 'baharat spice mix'],\n", + " 'baileys irish cream': ['baileys caramel irish cream',\n", + " 'baileys caramel irish cream',\n", + " 'baileys original irish cream'],\n", + " 'baileys original irish cream': ['baileys irish cream',\n", + " 'baileys irish cream'],\n", + " 'baileys caramel irish cream': ['baileys mint chocolate irish cream liqueur',\n", + " 'baileys mint chocolate irish cream liqueur'],\n", + " 'brown beans': ['baked beans', 'baked beans', 'brown sugar baked beans'],\n", + " 'corn tortilla chips': ['baked corn tortilla chips',\n", + " 'baked corn tortilla chips',\n", + " 'blue corn tortilla chips',\n", + " 'corn chips',\n", + " 'tortilla chips',\n", + " 'white corn tortilla chips'],\n", + " 'potato chips': ['baked potato chips',\n", + " 'baked potato chips',\n", + " 'chips',\n", + " 'potato crisps',\n", + " 'vegetable chips',\n", + " 'vinegar potato chips'],\n", + " 'fried tofu': ['baked tofu', 'baked tofu'],\n", + " 'angel flake coconut': ['bakers angel flake sweetened coconut',\n", + " 'bakers angel flake sweetened coconut'],\n", + " 'german chocolate': ['bakers germans chocolate',\n", + " 'bakers germans chocolate',\n", + " 'german sweet chocolate'],\n", + " 'bakers semi-sweet chocolate': ['bakers semi-sweet baking chocolate',\n", + " 'bakers semi-sweet baking chocolate'],\n", + " 'bakers semi-sweet baking chocolate': ['bakers semi-sweet chocolate',\n", + " 'bakers semi-sweet chocolate',\n", + " 'semisweet baking chocolate'],\n", + " 'bakers unsweetened chocolate squares': ['bakers unsweetened chocolate square',\n", + " 'bakers unsweetened chocolate square',\n", + " 'unsweetened chocolate squares'],\n", + " 'bakers unsweetened chocolate square': ['bakers unsweetened chocolate squares',\n", + " 'bakers unsweetened chocolate squares',\n", + " 'unsweetened chocolate square'],\n", + " 'cake yeast': ['bakers yeast', 'bakers yeast', 'fresh yeast cake'],\n", + " 'baking apples': ['baking apple', 'baking apple', 'cooking apples'],\n", + " 'cooking apples': ['baking apples', 'baking apples'],\n", + " 'dark baking chocolate': ['baking chocolate',\n", + " 'baking chocolate',\n", + " 'dark cooking chocolate'],\n", + " 'white chocolate baking squares': ['baking chocolate squares',\n", + " 'baking chocolate squares',\n", + " 'white chocolate baking square'],\n", + " 'unsweetened baking cocoa': ['baking cocoa', 'baking cocoa'],\n", + " 'baking hens': ['baking hen', 'baking hen'],\n", + " 'baking hen': ['baking hens', 'baking hens'],\n", + " 'baking potatoes': ['baking potato', 'baking potato'],\n", + " 'baking potato': ['baking potatoes', 'baking potatoes'],\n", + " 'double-acting baking powder': ['baking powder',\n", + " 'baking powder',\n", + " 'featherweight baking powder',\n", + " 'sodium-free baking powder'],\n", + " 'bicarbonate of soda': ['baking soda', 'baking soda'],\n", + " 'bulgarian yogurt': ['balkan style yogurt', 'balkan style yogurt'],\n", + " 'balsamic vinaigrette': ['balsamic dressing',\n", + " 'balsamic dressing',\n", + " 'light balsamic vinaigrette salad dressing',\n", + " 'low-carb balsamic vinaigrette'],\n", + " 'balsamic vinegar': ['balsamic glaze',\n", + " 'balsamic glaze',\n", + " 'fat-free balsamic vinegar',\n", + " 'garlic-infused balsamic vinegar',\n", + " 'raspberry balsamic vinegar',\n", + " 'white balsamic vinegar'],\n", + " 'balsamic dressing': ['balsamic syrup',\n", + " 'balsamic syrup',\n", + " 'balsamic vinaigrette'],\n", + " 'white balsamic vinegar': ['balsamic vinegar', 'balsamic vinegar'],\n", + " 'bamboo shoots': ['bamboo shoot', 'bamboo shoot'],\n", + " 'bamboo shoot': ['bamboo shoots', 'bamboo shoots'],\n", + " 'bamboo skewers': ['bamboo skewer', 'bamboo skewer'],\n", + " 'bamboo skewer': ['bamboo skewers', 'bamboo skewers'],\n", + " 'bananas': ['banana', 'banana'],\n", + " 'baby banana puree': ['banana baby food', 'banana baby food'],\n", + " 'banana flower': ['banana blossom', 'banana blossom', 'banana flowers'],\n", + " 'banana bread mix': ['banana bread', 'banana bread'],\n", + " 'banana bread': ['banana bread mix', 'banana bread mix', 'banana nut bread'],\n", + " 'coconut cake mix': ['banana cake mix', 'banana cake mix'],\n", + " 'plantain chips': ['banana chips', 'banana chips'],\n", + " 'banana instant pudding': ['banana cream instant pudding',\n", + " 'banana cream instant pudding',\n", + " 'instant banana pudding mix'],\n", + " 'banana flowers': ['banana flower', 'banana flower'],\n", + " 'banana cream instant pudding': ['banana instant pudding',\n", + " 'banana instant pudding'],\n", + " 'banana leaves': ['banana leaf', 'banana leaf', 'plantain leaves'],\n", + " 'banana leaf': ['banana leaves', 'banana leaves'],\n", + " 'banana schnapps': ['banana liqueur', 'banana liqueur'],\n", + " 'banana nut muffin mix': ['banana muffin mix', 'banana muffin mix'],\n", + " 'capn crunch cereal': ['banana nut crunch cereal',\n", + " 'banana nut crunch cereal',\n", + " 'cinnamon toast crunch cereal',\n", + " 'trix cereal'],\n", + " 'banana muffin mix': ['banana nut muffin mix', 'banana nut muffin mix'],\n", + " 'hot banana pepper': ['banana pepper', 'banana pepper'],\n", + " 'banana pepper': ['banana pepper juice',\n", + " 'banana pepper juice',\n", + " 'hot banana pepper'],\n", + " 'banana pepper rings': ['banana pepper ring', 'banana pepper ring'],\n", + " 'banana pepper ring': ['banana pepper rings', 'banana pepper rings'],\n", + " 'hot banana peppers': ['banana peppers', 'banana peppers'],\n", + " 'coconut rum': ['banana rum', 'banana rum', 'pineapple rum'],\n", + " 'apple schnapps': ['banana schnapps',\n", + " 'banana schnapps',\n", + " 'butterscotch schnapps',\n", + " 'cinnamon schnapps',\n", + " 'peach schnapps',\n", + " 'schnapps',\n", + " 'sour apple schnapps',\n", + " 'vanilla schnapps'],\n", + " 'yellow squash': ['banana squash', 'banana squash', 'orange squash'],\n", + " 'banana': ['bananas', 'bananas'],\n", + " 'baked beans': ['barbecue baked beans',\n", + " 'barbecue baked beans',\n", + " 'brown beans',\n", + " 'long beans'],\n", + " 'baked potato chips': ['barbecue potato chips',\n", + " 'barbecue potato chips',\n", + " 'jalapeno potato chips',\n", + " 'potato chips',\n", + " 'reduced-fat potato chips'],\n", + " 'spicy bbq sauce': ['barbecue sauce', 'barbecue sauce'],\n", + " 'skewers': ['barbecue skewers', 'barbecue skewers', 'wooden skewers'],\n", + " 'cooked pork': ['barbecued pork', 'barbecued pork', 'pork', 'smoked pork'],\n", + " 'barilla linguine': ['barilla castellane',\n", + " 'barilla castellane',\n", + " 'barilla lasagna'],\n", + " 'barilla lasagna': ['barilla linguine', 'barilla linguine'],\n", + " 'barilla sweet peppers & garlic sauce': ['barilla mushroom & garlic sauce',\n", + " 'barilla mushroom & garlic sauce'],\n", + " 'barilla mushroom & garlic sauce': ['barilla sweet peppers & garlic sauce',\n", + " 'barilla sweet peppers & garlic sauce',\n", + " 'mushroom marinara sauce'],\n", + " 'pot barley': ['barley', 'barley'],\n", + " 'barley malt syrup': ['barley malt',\n", + " 'barley malt',\n", + " 'malt syrup',\n", + " 'malted barley syrup'],\n", + " 'malted barley syrup': ['barley malt syrup', 'barley malt syrup'],\n", + " 'pearl barley': ['barley pearls', 'barley pearls', 'cooked pearl barley'],\n", + " 'grouper fillets': ['barramundi fillets',\n", + " 'barramundi fillets',\n", + " 'basa fillets',\n", + " 'hake fillets',\n", + " 'wahoo fillets'],\n", + " 'bartlett pears': ['bartlett pear', 'bartlett pear'],\n", + " 'bartlett pear': ['bartlett pears', 'bartlett pears'],\n", + " 'homemade mayonnaise': ['basic mayonnaise recipe', 'basic mayonnaise recipe'],\n", + " 'meatloaf mix': ['basic meatloaf',\n", + " 'basic meatloaf',\n", + " 'meatloaf',\n", + " 'meatloaf mixture'],\n", + " 'pizza dough': ['basic pizza dough', 'basic pizza dough'],\n", + " 'basil chiffonade': ['basil', 'basil'],\n", + " 'basil': ['basil chiffonade', 'basil chiffonade', 'ground basil'],\n", + " 'dry basil leaves': ['basil leaves', 'basil leaves', 'dried basil leaves'],\n", + " 'basil olive oil': ['basil oil', 'basil oil'],\n", + " 'basil oil': ['basil olive oil', 'basil olive oil'],\n", + " 'pesto sauce': ['basil pesto',\n", + " 'basil pesto',\n", + " 'pesto sauce mix',\n", + " 'red pesto sauce'],\n", + " 'basil sprigs': ['basil sprig', 'basil sprig'],\n", + " 'basil sprig': ['basil sprigs',\n", + " 'basil sprigs',\n", + " 'powdered basil',\n", + " 'sweet basil'],\n", + " 'sun-dried tomato vinaigrette dressing': ['basil vinaigrette',\n", + " 'basil vinaigrette',\n", + " 'smoky tomato vinaigrette',\n", + " 'sun-dried tomato dressing',\n", + " 'sundried tomato & oregano salad dressing'],\n", + " 'brown basmati rice': ['basmati rice', 'basmati rice'],\n", + " 'basmati rice': ['basmati rice pilaf',\n", + " 'basmati rice pilaf',\n", + " 'brown basmati rice',\n", + " 'cooked basmati rice'],\n", + " 'sea bass fillet': ['bass fillet', 'bass fillet', 'filet of fresh sea bass'],\n", + " 'sea bass fillets': ['bass fillets', 'bass fillets', 'sea bream fillets'],\n", + " 'liquid soap': ['bath soap', 'bath soap', 'liquid dish soap'],\n", + " 'german-style sweet sauerkraut': ['bavarian-style sweet sauerkraut',\n", + " 'bavarian-style sweet sauerkraut'],\n", + " 'fresh bay leaf': ['bay leaf', 'bay leaf', 'fresh bay leaves'],\n", + " 'fresh bay leaves': ['bay leaves', 'bay leaves', 'fresh bay leaf'],\n", + " 'bay scallops': ['bay scallop', 'bay scallop'],\n", + " 'bay scallop': ['bay scallops', 'bay scallops'],\n", + " 'square bean curd': ['bean curd', 'bean curd'],\n", + " 'black bean dip': ['bean dip', 'bean dip'],\n", + " 'hot bean paste': ['bean paste', 'bean paste'],\n", + " 'ground bean sauce': ['bean sauce', 'bean sauce'],\n", + " 'fresh bean sprouts': ['bean sprouts', 'bean sprouts'],\n", + " 'bean thread vermicelli': ['bean thread noodles', 'bean thread noodles'],\n", + " 'bean thread noodles': ['bean thread vermicelli', 'bean thread vermicelli'],\n", + " 'condensed bean with bacon soup': ['bean with bacon soup',\n", + " 'bean with bacon soup'],\n", + " 'haricot beans': ['beans', 'beans', 'runner beans'],\n", + " 'pinto beans in chili sauce': ['beans in chili sauce',\n", + " 'beans in chili sauce',\n", + " 'pinto beans with jalapeno peppers'],\n", + " 'bearnaise sauce mix': ['bearnaise sauce', 'bearnaise sauce'],\n", + " 'bearnaise sauce': ['bearnaise sauce mix', 'bearnaise sauce mix'],\n", + " 'sodium-free margarine': ['becel margarine',\n", + " 'becel margarine',\n", + " 'cholesterol-free margarine',\n", + " 'fleischmanns margarine',\n", + " 'low-cholesterol margarine'],\n", + " 'garlic bechamel': ['bechamel sauce', 'bechamel sauce'],\n", + " 'lipton beef and onion soup mix': ['beef and onion soup mix',\n", + " 'beef and onion soup mix'],\n", + " 'beef ribs': ['beef back ribs', 'beef back ribs', 'beef rib'],\n", + " 'lean beef bacon': ['beef bacon', 'beef bacon', 'lean bacon'],\n", + " 'beef roast': ['beef blade roast',\n", + " 'beef blade roast',\n", + " 'beef tip roast',\n", + " 'roast beef',\n", + " 'rolled roast beef'],\n", + " 'blade steak': ['beef blade steak', 'beef blade steak', 'blade steaks'],\n", + " 'beef bones': ['beef bone', 'beef bone'],\n", + " 'beef bone': ['beef bones', 'beef bones', 'beef neck bone'],\n", + " 'beef marrow': ['beef bones with marrow', 'beef bones with marrow'],\n", + " 'beef bouillon powder': ['beef bouillon',\n", + " 'beef bouillon',\n", + " 'beef stock powder',\n", + " 'low-sodium beef bouillon powder'],\n", + " 'chicken bouillon concentrate': ['beef bouillon concentrate',\n", + " 'beef bouillon concentrate'],\n", + " 'low-sodium beef bouillon cube': ['beef bouillon cube', 'beef bouillon cube'],\n", + " 'low-sodium beef bouillon cubes': ['beef bouillon cubes',\n", + " 'beef bouillon cubes',\n", + " 'low-sodium beef bouillon cube'],\n", + " 'low-sodium beef bouillon granules': ['beef bouillon granules',\n", + " 'beef bouillon granules'],\n", + " 'beef bouillon': ['beef bouillon paste',\n", + " 'beef bouillon paste',\n", + " 'instant beef bouillon',\n", + " 'sodium-free beef bouillon'],\n", + " 'low-sodium beef bouillon powder': ['beef bouillon powder',\n", + " 'beef bouillon powder'],\n", + " 'pork brisket': ['beef brisket', 'beef brisket'],\n", + " 'meat broth': ['beef broth', 'beef broth'],\n", + " 'hamburger patties': ['beef burgers', 'beef burgers', 'hamburger patty'],\n", + " 'beef cheeks': ['beef cheek', 'beef cheek'],\n", + " 'beef cheek': ['beef cheeks', 'beef cheeks'],\n", + " 'lean beef chuck': ['beef chuck', 'beef chuck'],\n", + " 'beef consomme soup': ['beef consomme', 'beef consomme'],\n", + " 'beef consomme': ['beef consomme soup',\n", + " 'beef consomme soup',\n", + " 'condensed beef consomme'],\n", + " 'beef cube steaks': ['beef cube steak',\n", + " 'beef cube steak',\n", + " 'cube steaks',\n", + " 'pork cube steaks'],\n", + " 'beef cube steak': ['beef cube steaks', 'beef cube steaks', 'cube steak'],\n", + " 'beef bouillon cubes': ['beef double bouillon cubes',\n", + " 'beef double bouillon cubes',\n", + " 'low-sodium beef bouillon cubes'],\n", + " 'meat drippings': ['beef drippings',\n", + " 'beef drippings',\n", + " 'drippings',\n", + " 'poultry drippings'],\n", + " 'flank steak': ['beef flank steak',\n", + " 'beef flank steak',\n", + " 'flank steaks',\n", + " 'lean flank steak',\n", + " 'topside steak'],\n", + " 'beef gravy mix': ['beef gravy', 'beef gravy'],\n", + " 'beef gravy': ['beef gravy granules',\n", + " 'beef gravy granules',\n", + " 'beef gravy mix',\n", + " 'franco-american beef gravy',\n", + " 'roast beef in gravy'],\n", + " 'beef hot dogs': ['beef hot dog', 'beef hot dog'],\n", + " 'beef hot dog': ['beef hot dogs', 'beef hot dogs'],\n", + " 'beef kidneys': ['beef kidney', 'beef kidney'],\n", + " 'beef kidney': ['beef kidneys', 'beef kidneys'],\n", + " 'kielbasa': ['beef kielbasa', 'beef kielbasa'],\n", + " 'baby beef liver': ['beef liver', 'beef liver'],\n", + " 'beef steaks': ['beef loin steaks', 'beef loin steaks', 'steaks'],\n", + " 'meat marinade': ['beef marinade',\n", + " 'beef marinade',\n", + " 'chipotle-flavored marinade',\n", + " 'marinade'],\n", + " 'beef bones with marrow': ['beef marrow',\n", + " 'beef marrow',\n", + " 'mutton bones with marrow'],\n", + " 'beef silverside': ['beef mince', 'beef mince'],\n", + " 'meat ravioli': ['beef ravioli', 'beef ravioli'],\n", + " 'beef rib roast': ['beef rib eye roast',\n", + " 'beef rib eye roast',\n", + " 'bone-in beef rib roast'],\n", + " 'beef rib eye roast': ['beef rib roast', 'beef rib roast'],\n", + " 'beef back ribs': ['beef ribs', 'beef ribs'],\n", + " 'roast beef': ['beef roast', 'beef roast'],\n", + " 'beef stew seasoning': ['beef roast seasoning', 'beef roast seasoning'],\n", + " 'bottom round beef roast': ['beef round rump roast', 'beef round rump roast'],\n", + " 'beef top round steak': ['beef round steak', 'beef round steak'],\n", + " 'beef round tip steaks': ['beef round tip steak', 'beef round tip steak'],\n", + " 'beef round tip steak': ['beef round tip steaks',\n", + " 'beef round tip steaks',\n", + " 'round tip steak'],\n", + " 'rump steak': ['beef rump', 'beef rump'],\n", + " 'salami': ['beef salami', 'beef salami', 'turkey salami'],\n", + " 'sausage meat': ['beef sausage', 'beef sausage'],\n", + " 'beef sausage': ['beef sausages',\n", + " 'beef sausages',\n", + " 'sausage meat',\n", + " 'smoked beef sausage'],\n", + " 'boneless beef shank': ['beef shank', 'beef shank'],\n", + " 'short rib of beef': ['beef short rib', 'beef short rib'],\n", + " 'beef short rib': ['beef short ribs', 'beef short ribs', 'short rib of beef'],\n", + " 'beef short ribs': ['beef short ribs with bones',\n", + " 'beef short ribs with bones'],\n", + " 'boneless beef shoulder': ['beef shoulder',\n", + " 'beef shoulder',\n", + " 'boneless beef loin'],\n", + " 'beef mince': ['beef silverside', 'beef silverside'],\n", + " 'sirloin beef': ['beef sirloin', 'beef sirloin', 'sirloin beef'],\n", + " 'sirloin steak': ['beef sirloin steak',\n", + " 'beef sirloin steak',\n", + " 'steak fillet',\n", + " 'tri-tip steak'],\n", + " 'sirloin steaks': ['beef sirloin steaks', 'beef sirloin steaks'],\n", + " 'sirloin tip steak': ['beef sirloin tip',\n", + " 'beef sirloin tip',\n", + " 'sirloin tip steaks'],\n", + " 'vegetable beef soup mix': ['beef soup mix',\n", + " 'beef soup mix',\n", + " 'vegetable beef soup'],\n", + " 'beef sirloin steak': ['beef steak',\n", + " 'beef steak',\n", + " 'moose sirloin steak',\n", + " 'sirloin steak'],\n", + " 'beef sirloin steaks': ['beef steaks',\n", + " 'beef steaks',\n", + " 'beef t-bone steaks',\n", + " 'lean sirloin steaks',\n", + " 'sirloin steaks'],\n", + " 'beef stew meat': ['beef stew',\n", + " 'beef stew',\n", + " 'lean stew meat',\n", + " 'pork stew meat'],\n", + " 'beef stew': ['beef stew meat',\n", + " 'beef stew meat',\n", + " 'chicken stew',\n", + " 'stew meat'],\n", + " 'beef roast seasoning': ['beef stew seasoning', 'beef stew seasoning'],\n", + " 'white beef stock': ['beef stock', 'beef stock'],\n", + " 'vegetarian beef stock cube': ['beef stock cube', 'beef stock cube'],\n", + " 'beef bouillon granules': ['beef stock granules',\n", + " 'beef stock granules',\n", + " 'low-sodium beef bouillon granules',\n", + " 'sodium-free beef bouillon granules'],\n", + " 'suet': ['beef suet', 'beef suet', 'vegetable suet'],\n", + " 'tamales': ['beef tamales', 'beef tamales', 'chicken tamales'],\n", + " 'chicken taquitos': ['beef taquitos', 'beef taquitos'],\n", + " 'beef tenderloin steak': ['beef tenderloin',\n", + " 'beef tenderloin',\n", + " 'beef tenderloin steaks'],\n", + " 'boneless beef tenderloin': ['beef tenderloin fillets',\n", + " 'beef tenderloin fillets'],\n", + " 'beef tenderloin steaks': ['beef tenderloin steak', 'beef tenderloin steak'],\n", + " 'beef tongues': ['beef tongue', 'beef tongue'],\n", + " 'beef tongue': ['beef tongues', 'beef tongues'],\n", + " 'beef round steak': ['beef top round steak', 'beef top round steak'],\n", + " 'cheese tortellini': ['beef tortellini',\n", + " 'beef tortellini',\n", + " 'frozen cheese tortellini',\n", + " 'mushroom tortellini',\n", + " 'tortellini',\n", + " 'tortellini cheese pasta'],\n", + " 'chili-flavored ramen noodles': ['beef-flavor ramen noodles',\n", + " 'beef-flavor ramen noodles',\n", + " 'oriental-flavor instant ramen noodles'],\n", + " 'beefsteak tomatoes': ['beefsteak tomato', 'beefsteak tomato'],\n", + " 'beefsteak tomato': ['beefsteak tomatoes', 'beefsteak tomatoes'],\n", + " 'condensed mushroom soup': ['beefy mushroom soup',\n", + " 'beefy mushroom soup',\n", + " 'condensed golden mushroom soup',\n", + " 'reduced-calorie condensed mushroom soup'],\n", + " 'lager beer': ['beer', 'beer'],\n", + " 'beer sticks': ['beer stick', 'beer stick'],\n", + " 'beer stick': ['beer sticks', 'beer sticks'],\n", + " 'red beet': ['beet', 'beet'],\n", + " 'beet': ['beet juice',\n", + " 'beet juice',\n", + " 'beet sugar',\n", + " 'raw beet',\n", + " 'red beet',\n", + " 'silver beet'],\n", + " 'beet leaves': ['beet leaf', 'beet leaf'],\n", + " 'beet leaf': ['beet leaves', 'beet leaves'],\n", + " 'beets with greens': ['beet with greens',\n", + " 'beet with greens',\n", + " 'beets with tops'],\n", + " 'red beets': ['beets', 'beets', 'yellow beets'],\n", + " 'beet with greens': ['beets with greens', 'beets with greens'],\n", + " 'sweet bell pepper': ['bell pepper', 'bell pepper', 'sweet pepper'],\n", + " 'green bell peppers': ['bell peppers',\n", + " 'bell peppers',\n", + " 'green peppers',\n", + " 'shishito green peppers'],\n", + " 'bermuda onions': ['bermuda onion', 'bermuda onion'],\n", + " 'bermuda onion': ['bermuda onions', 'bermuda onions'],\n", + " 'berry gelatin': ['berry blue gelatin mix',\n", + " 'berry blue gelatin mix',\n", + " 'blackberry gelatin',\n", + " 'blueberry gelatin'],\n", + " 'unsweetened kool-aid powdered drink mix': ['berry blue unsweetened kool-aid powdered drink mix',\n", + " 'berry blue unsweetened kool-aid powdered drink mix',\n", + " 'kool-aid lemon-lime powdered drink mix',\n", + " 'sweetened kool-aid drink mix'],\n", + " 'blueberry gelatin': ['berry gelatin', 'berry gelatin'],\n", + " 'blueberry yogurt': ['berry yogurt', 'berry yogurt'],\n", + " 'besan flour': ['besan', 'besan'],\n", + " 'besan': ['besan flour', 'besan flour'],\n", + " 'betty crocker fudge brownie mix': ['betty crocker double chocolate chunk cookie mix',\n", + " 'betty crocker double chocolate chunk cookie mix',\n", + " 'duncan hines chewy fudge brownie mix'],\n", + " 'betty crocker super moist white cake mix': ['betty crocker fluffy white frosting mix',\n", + " 'betty crocker fluffy white frosting mix'],\n", + " 'fudge brownie mix': ['betty crocker fudge brownie mix',\n", + " 'betty crocker fudge brownie mix',\n", + " 'pillsbury fudge brownie mix'],\n", + " 'betty crocker rich & creamy chocolate ready to spread frosting': ['betty crocker lemon ready to spread frosting',\n", + " 'betty crocker lemon ready to spread frosting'],\n", + " 'betty crocker lemon ready to spread frosting': ['betty crocker rich & creamy chocolate ready to spread frosting',\n", + " 'betty crocker rich & creamy chocolate ready to spread frosting'],\n", + " 'betty crocker super moist chocolate cake mix': ['betty crocker super moist cake mix',\n", + " 'betty crocker super moist cake mix'],\n", + " 'betty crocker super moist cake mix': ['betty crocker super moist chocolate cake mix',\n", + " 'betty crocker super moist chocolate cake mix',\n", + " 'betty crocker super moist lemon cake mix',\n", + " 'betty crocker super moist white cake mix'],\n", + " 'betty crocker yellow cake mix': ['betty crocker super moist yellow cake mix',\n", + " 'betty crocker super moist yellow cake mix'],\n", + " 'betty crocker super moist yellow cake mix': ['betty crocker yellow cake mix',\n", + " 'betty crocker yellow cake mix'],\n", + " 'butterhead lettuce': ['bibb lettuce',\n", + " 'bibb lettuce',\n", + " 'frisee lettuce',\n", + " 'red-leaf lettuce'],\n", + " 'baking soda': ['bicarbonate of soda', 'bicarbonate of soda'],\n", + " 'bing cherry': ['bing cherries', 'bing cherries'],\n", + " 'bing cherries': ['bing cherry', 'bing cherry'],\n", + " 'birds eye chiles': ['birds eye chile', 'birds eye chile'],\n", + " 'dried birds eye chiles': ['birds eye chiles',\n", + " 'birds eye chiles',\n", + " 'dried birds eye chile'],\n", + " 'hazelnut biscotti': ['biscotti', 'biscotti'],\n", + " 'biscotti': ['biscotti liqueur', 'biscotti liqueur', 'hazelnut biscotti'],\n", + " 'digestive biscuit': ['biscuit', 'biscuit', 'digestive biscuits'],\n", + " 'cookie dough': ['biscuit dough', 'biscuit dough'],\n", + " 'tea biscuit mix': ['biscuit mix', 'biscuit mix'],\n", + " 'tea biscuits': ['biscuits', 'biscuits'],\n", + " 'beef tenderloin fillets': ['bison tenderloin fillets',\n", + " 'bison tenderloin fillets'],\n", + " 'bisquick baking mix': ['bisquick',\n", + " 'bisquick',\n", + " 'bisquick reduced-fat baking mix',\n", + " 'original bisquick mix'],\n", + " 'bisquick reduced-fat baking mix': ['bisquick baking mix',\n", + " 'bisquick baking mix'],\n", + " 'bisto powder': ['bisto', 'bisto'],\n", + " 'bisto': ['bisto powder', 'bisto powder'],\n", + " 'mounds candy bars': ['bit-o-honey candy bars', 'bit-o-honey candy bars'],\n", + " 'reduced-fat cheese crackers': ['bite-size cheddar cheese crackers',\n", + " 'bite-size cheddar cheese crackers',\n", + " 'reduced-fat crackers'],\n", + " 'fresh mozzarella balls': ['bite-size fresh mozzarella cheese balls',\n", + " 'bite-size fresh mozzarella cheese balls',\n", + " 'fresh mozzarella ball'],\n", + " 'almond oil': ['bitter almond oil', 'bitter almond oil'],\n", + " 'lemon soda': ['bitter lemon soda', 'bitter lemon soda', 'lime soda'],\n", + " 'bitter melons': ['bitter melon', 'bitter melon'],\n", + " 'bitter melon': ['bitter melons', 'bitter melons'],\n", + " 'angostura bitters': ['bitters', 'bitters'],\n", + " 'bittersweet chocolate': ['bittersweet baking chocolate',\n", + " 'bittersweet baking chocolate',\n", + " 'bittersweet dark chocolate'],\n", + " 'bittersweet dark chocolate': ['bittersweet chocolate',\n", + " 'bittersweet chocolate'],\n", + " 'bittersweet chocolate pieces': ['bittersweet chocolate piece',\n", + " 'bittersweet chocolate piece'],\n", + " 'bittersweet chocolate piece': ['bittersweet chocolate pieces',\n", + " 'bittersweet chocolate pieces'],\n", + " 'bittersweet chocolate squares': ['bittersweet chocolate square',\n", + " 'bittersweet chocolate square'],\n", + " 'bittersweet chocolate square': ['bittersweet chocolate squares',\n", + " 'bittersweet chocolate squares'],\n", + " 'red beans and rice mix': ['black bean and rice mix',\n", + " 'black bean and rice mix'],\n", + " 'bean dip': ['black bean dip', 'black bean dip', 'frito-lay bean dip'],\n", + " 'chinese bean garlic sauce': ['black bean garlic sauce',\n", + " 'black bean garlic sauce'],\n", + " 'bean paste': ['black bean paste',\n", + " 'black bean paste',\n", + " 'chinese bean paste',\n", + " 'hot bean paste',\n", + " 'red bean paste',\n", + " 'sweet bean paste'],\n", + " 'hot black bean sauce': ['black bean sauce', 'black bean sauce'],\n", + " 'canned black beans': ['black beans',\n", + " 'black beans',\n", + " 'canned red beans',\n", + " 'canned white beans',\n", + " 'dried black beans'],\n", + " 'black beans with lime juice': ['black beans with jalapenos and lime juice',\n", + " 'black beans with jalapenos and lime juice'],\n", + " 'black beans with jalapenos and lime juice': ['black beans with lime juice',\n", + " 'black beans with lime juice'],\n", + " 'brown bread': ['black bread', 'black bread'],\n", + " 'black cardamom pods': ['black cardamom pod', 'black cardamom pod'],\n", + " 'black cardamom pod': ['black cardamom pods', 'black cardamom pods'],\n", + " 'caviar': ['black caviar', 'black caviar', 'lumpfish caviar'],\n", + " 'dark cherries': ['black cherries', 'black cherries'],\n", + " 'cherry gelatin': ['black cherry gelatin',\n", + " 'black cherry gelatin',\n", + " 'red gelatin'],\n", + " 'cherry jell-o': ['black cherry jell-o', 'black cherry jell-o'],\n", + " 'cod steaks': ['black cod steaks', 'black cod steaks'],\n", + " 'strong black coffee': ['black coffee', 'black coffee'],\n", + " 'black ground cumin': ['black cumin', 'black cumin', 'ground cumin'],\n", + " 'cumin seeds': ['black cumin seeds', 'black cumin seeds', 'cumin seed'],\n", + " 'red currant jam': ['black currant jam',\n", + " 'black currant jam',\n", + " 'red currant preserves'],\n", + " 'currant jelly': ['black currant jelly',\n", + " 'black currant jelly',\n", + " 'grape jelly',\n", + " 'plum jelly'],\n", + " 'blackcurrant tea bags': ['black currant tea bags', 'black currant tea bags'],\n", + " 'red currants': ['black currants', 'black currants', 'currants'],\n", + " 'food coloring': ['black food coloring',\n", + " 'black food coloring',\n", + " 'blue food coloring',\n", + " 'pink food coloring'],\n", + " 'black mushrooms': ['black fungus mushrooms',\n", + " 'black fungus mushrooms',\n", + " 'chinese black mushrooms',\n", + " 'dried black mushrooms'],\n", + " 'gram dal': ['black gram dal', 'black gram dal'],\n", + " 'red grapes': ['black grapes', 'black grapes', 'grapes', 'red raisins'],\n", + " 'greek olive': ['black greek olive', 'black greek olive', 'olive'],\n", + " 'black olives': ['black greek olives',\n", + " 'black greek olives',\n", + " 'brine-cured black olives',\n", + " 'pitted black olives'],\n", + " 'black cumin': ['black ground cumin', 'black ground cumin'],\n", + " 'brown lentils': ['black lentils',\n", + " 'black lentils',\n", + " 'dried brown lentils',\n", + " 'orange lentils',\n", + " 'yellow lentils'],\n", + " 'licorice': ['black licorice', 'black licorice'],\n", + " 'red licorice strings': ['black licorice strings', 'black licorice strings'],\n", + " 'black mission figs': ['black mission fig', 'black mission fig'],\n", + " 'black mission fig': ['black mission figs', 'black mission figs'],\n", + " 'dried black mushrooms': ['black mushrooms',\n", + " 'black mushrooms',\n", + " 'dried black trumpet mushrooms'],\n", + " 'brown mustard seeds': ['black mustard seeds', 'black mustard seeds'],\n", + " 'black greek olives': ['black olives', 'black olives', 'greek olives'],\n", + " 'ground black pepper': ['black pepper', 'black pepper'],\n", + " 'boursin cheese': ['black pepper boursin cheese',\n", + " 'black pepper boursin cheese',\n", + " 'light boursin cheese'],\n", + " 'whole black peppercorns': ['black peppercorns',\n", + " 'black peppercorns',\n", + " 'whole black peppercorn'],\n", + " 'purple plums': ['black plums', 'black plums', 'blue plums'],\n", + " 'red raspberries': ['black raspberries', 'black raspberries', 'raspberries'],\n", + " 'brown rice': ['black rice', 'black rice', 'red rice', 'sweet brown rice'],\n", + " 'white sambuca': ['black sambuca', 'black sambuca'],\n", + " 'black sesame seeds': ['black sesame seed',\n", + " 'black sesame seed',\n", + " 'white sesame seeds'],\n", + " 'black sesame seed': ['black sesame seeds', 'black sesame seeds'],\n", + " 'dark soy sauce': ['black soy sauce', 'black soy sauce', 'dark soya sauce'],\n", + " 'sticky rice': ['black sticky rice',\n", + " 'black sticky rice',\n", + " 'cooked sticky rice'],\n", + " 'strong black tea': ['black tea', 'black tea'],\n", + " 'tea bags': ['black tea bags', 'black tea bags', 'tea bag'],\n", + " 'green tea leaves': ['black tea leaves', 'black tea leaves'],\n", + " 'treacle': ['black treacle', 'black treacle'],\n", + " 'white truffle': ['black truffle', 'black truffle'],\n", + " 'chocolate truffles': ['black truffles', 'black truffles', 'truffles'],\n", + " 'dried black turtle beans': ['black turtle beans',\n", + " 'black turtle beans',\n", + " 'dried black turtle bean'],\n", + " 'white vinegar': ['black vinegar',\n", + " 'black vinegar',\n", + " 'chinkiang vinegar',\n", + " 'vinegar'],\n", + " 'walnuts': ['black walnuts',\n", + " 'black walnuts',\n", + " 'diamond walnuts',\n", + " 'english walnuts'],\n", + " 'dried black-eyed peas': ['black-eyed peas', 'black-eyed peas'],\n", + " 'ranch style black-eyed peas with jalapenos': ['black-eyed peas with jalapenos',\n", + " 'black-eyed peas with jalapenos',\n", + " 'ranch style black-eyed peas'],\n", + " 'fresh blackberries': ['blackberries', 'blackberries'],\n", + " 'blackberry liqueur': ['blackberry brandy',\n", + " 'blackberry brandy',\n", + " 'blackberry schnapps'],\n", + " 'blackberry yogurt': ['blackberry creme yogurt',\n", + " 'blackberry creme yogurt',\n", + " 'reduced-fat blackberry yogurt'],\n", + " 'blackberry jelly': ['blackberry jam', 'blackberry jam'],\n", + " 'blackberry jam': ['blackberry jelly', 'blackberry jelly'],\n", + " 'blackberry schnapps': ['blackberry liqueur', 'blackberry liqueur'],\n", + " 'blueberry pie filling': ['blackberry pie filling',\n", + " 'blackberry pie filling',\n", + " 'blueberry filling',\n", + " 'raspberry pie filling'],\n", + " 'seedless blackberry preserves': ['blackberry preserves',\n", + " 'blackberry preserves',\n", + " 'seedless blackberry jam',\n", + " 'seedless blackberry spread'],\n", + " 'raspberry sherbet': ['blackberry sherbet',\n", + " 'blackberry sherbet',\n", + " 'strawberry sherbet'],\n", + " 'boysenberry syrup': ['blackberry syrup', 'blackberry syrup'],\n", + " 'blackberry creme yogurt': ['blackberry yogurt', 'blackberry yogurt'],\n", + " 'black currant tea bags': ['blackcurrant tea bags', 'blackcurrant tea bags'],\n", + " 'roast chicken seasoning': ['blackened chicken seasoning',\n", + " 'blackened chicken seasoning'],\n", + " 'fish seasoning': ['blackened fish seasoning',\n", + " 'blackened fish seasoning',\n", + " 'seafood seasoning'],\n", + " 'steak seasoning': ['blackened steak seasoning',\n", + " 'blackened steak seasoning',\n", + " 'dry steak seasoning',\n", + " 'garlic steak seasoning',\n", + " 'meat seasoning'],\n", + " 'dark molasses': ['blackstrap molasses',\n", + " 'blackstrap molasses',\n", + " 'light molasses'],\n", + " 'blade roast': ['blade pot roast', 'blade pot roast'],\n", + " 'blade pot roast': ['blade roast', 'blade roast'],\n", + " 'beef blade steak': ['blade steak', 'blade steak'],\n", + " 'blanched slivered almond': ['blanched almond', 'blanched almond'],\n", + " 'blanched slivered almonds': ['blanched almonds', 'blanched almonds'],\n", + " 'blanched almond': ['blanched slivered almond', 'blanched slivered almond'],\n", + " 'blanched almonds': ['blanched slivered almonds',\n", + " 'blanched slivered almonds'],\n", + " 'sultana raisins': ['bleached sultana raisins',\n", + " 'bleached sultana raisins',\n", + " 'sultana raisin'],\n", + " 'chili sauce mix': ['blended red chili sauce', 'blended red chili sauce'],\n", + " 'scotch whisky': ['blended scotch whisky', 'blended scotch whisky', 'scotch'],\n", + " 'blue cheese dressing': ['bleu cheese salad dressing',\n", + " 'bleu cheese salad dressing',\n", + " 'blue cheese dressing mix',\n", + " 'light blue cheese dressing'],\n", + " 'blue cheese': ['bleu cheese spread', 'bleu cheese spread'],\n", + " 'orange juice': ['blood orange juice',\n", + " 'blood orange juice',\n", + " 'citrus juice',\n", + " 'fresh orange juice',\n", + " 'no-sugar-added orange juice'],\n", + " 'oranges': ['blood oranges', 'blood oranges', 'sweet oranges'],\n", + " 'blood sausage': ['blood pudding sausage', 'blood pudding sausage'],\n", + " 'blood pudding sausage': ['blood sausage', 'blood sausage'],\n", + " 'bleu cheese spread': ['blue cheese', 'blue cheese'],\n", + " 'light blue cheese dressing': ['blue cheese dressing',\n", + " 'blue cheese dressing'],\n", + " 'white corn tortillas': ['blue corn tortillas',\n", + " 'blue corn tortillas',\n", + " 'white corn tortilla'],\n", + " 'white cornmeal': ['blue cornmeal', 'blue cornmeal'],\n", + " 'live blue crabs': ['blue crabs', 'blue crabs', 'live blue crab'],\n", + " 'curacao': ['blue curacao', 'blue curacao'],\n", + " 'blue curacao': ['blue curacao syrup',\n", + " 'blue curacao syrup',\n", + " 'curacao',\n", + " 'orange curacao'],\n", + " 'red gatorade': ['blue gatorade', 'blue gatorade'],\n", + " 'green grapes': ['blue grapes', 'blue grapes'],\n", + " 'green mussels': ['blue mussels', 'blue mussels'],\n", + " 'red potatoes': ['blue potatoes',\n", + " 'blue potatoes',\n", + " 'red bliss potatoes',\n", + " 'red sweet potatoes'],\n", + " 'cod fish fillet': ['blue-eye cod fillet', 'blue-eye cod fillet'],\n", + " 'fresh blueberries': ['blueberries',\n", + " 'blueberries',\n", + " 'canned blueberries',\n", + " 'dried blueberries'],\n", + " 'blueberries in light syrup': ['blueberries in heavy syrup',\n", + " 'blueberries in heavy syrup'],\n", + " 'blueberries in heavy syrup': ['blueberries in light syrup',\n", + " 'blueberries in light syrup'],\n", + " 'blueberry sorbet': ['blueberry ice cream', 'blueberry ice cream'],\n", + " 'boysenberry jam': ['blueberry jam', 'blueberry jam', 'boysenberry syrup'],\n", + " 'blueberry schnapps': ['blueberry liqueur', 'blueberry liqueur'],\n", + " 'raspberry muffin mix': ['blueberry muffin mix',\n", + " 'blueberry muffin mix',\n", + " 'strawberry muffin mix'],\n", + " 'raspberry pie filling': ['blueberry pie filling',\n", + " 'blueberry pie filling',\n", + " 'raspberry pastry filling',\n", + " 'strawberry pie filling'],\n", + " 'blueberry jam': ['blueberry preserves', 'blueberry preserves'],\n", + " 'raspberry schnapps': ['blueberry schnapps',\n", + " 'blueberry schnapps',\n", + " 'strawberry schnapps'],\n", + " 'raspberry sorbet': ['blueberry sorbet',\n", + " 'blueberry sorbet',\n", + " 'strawberry sorbet'],\n", + " 'raspberry vinegar': ['blueberry vinegar', 'blueberry vinegar'],\n", + " 'berry yogurt': ['blueberry yogurt', 'blueberry yogurt'],\n", + " 'bluefish fillet': ['bluefish', 'bluefish', 'bluefish fillets'],\n", + " 'bluefish fillets': ['bluefish fillet', 'bluefish fillet'],\n", + " 'red wine vinaigrette': ['blush wine vinaigrette dressing',\n", + " 'blush wine vinaigrette dressing',\n", + " 'light red wine vinaigrette',\n", + " 'reduced-fat red wine vinaigrette',\n", + " 'white wine vinaigrette'],\n", + " 'boboli pizza crusts': ['boboli pizza crust', 'boboli pizza crust'],\n", + " 'boboli pizza crust': ['boboli pizza crusts', 'boboli pizza crusts'],\n", + " 'whole wheat pizza crust': ['boboli whole wheat pizza crust',\n", + " 'boboli whole wheat pizza crust',\n", + " 'whole wheat pizza dough'],\n", + " 'short-grain brown rice': ['boil-in-the-bag brown rice',\n", + " 'boil-in-the-bag brown rice'],\n", + " 'boil-in-the-bag brown rice': ['boil-in-the-bag rice',\n", + " 'boil-in-the-bag rice',\n", + " 'short-grain brown rice'],\n", + " 'cooked ham': ['boiled ham', 'boiled ham', 'ground ham', 'ham', 'smoked ham'],\n", + " 'boiling potatoes': ['boiled potatoes', 'boiled potatoes', 'boiling potato'],\n", + " 'cooking onions': ['boiling onions', 'boiling onions'],\n", + " 'boiled potatoes': ['boiling potatoes',\n", + " 'boiling potatoes',\n", + " 'roasted potatoes',\n", + " 'shoestring potatoes'],\n", + " 'gai choy': ['bok choy', 'bok choy'],\n", + " 'bologna sausage': ['bologna', 'bologna'],\n", + " 'bologna': ['bologna sausage', 'bologna sausage', 'light bologna'],\n", + " 'honey-baked ham': ['bone-in ham',\n", + " 'bone-in ham',\n", + " 'capacola ham',\n", + " 'honey-roasted ham'],\n", + " 'boneless pork roast': ['bone-in pork roast',\n", + " 'bone-in pork roast',\n", + " 'boneless boston pork roast',\n", + " 'boneless pork cushion roast',\n", + " 'boneless pork loin roast'],\n", + " 'boned veal breasts': ['boned leg of veal', 'boned leg of veal'],\n", + " 'boned leg of veal': ['boned veal breasts', 'boned veal breasts'],\n", + " 'boneless salmon fillet': ['boneless atlantic salmon fillet',\n", + " 'boneless atlantic salmon fillet'],\n", + " 'beef brisket': ['boneless beef brisket',\n", + " 'boneless beef brisket',\n", + " 'corned beef brisket',\n", + " 'pork brisket',\n", + " 'veal brisket'],\n", + " 'lean boneless beef chuck': ['boneless beef chuck',\n", + " 'boneless beef chuck',\n", + " 'boneless lean beef',\n", + " 'lean beef chuck'],\n", + " 'boneless beef chuck shoulder pot roast': ['boneless beef chuck roast',\n", + " 'boneless beef chuck roast'],\n", + " 'boneless beef chuck roast': ['boneless beef chuck shoulder pot roast',\n", + " 'boneless beef chuck shoulder pot roast',\n", + " 'boneless chuck roast'],\n", + " 'boneless beef chuck steaks': ['boneless beef chuck steak',\n", + " 'boneless beef chuck steak'],\n", + " 'boneless beef chuck steak': ['boneless beef chuck steaks',\n", + " 'boneless beef chuck steaks'],\n", + " 'boneless beef cubes': ['boneless beef cube', 'boneless beef cube'],\n", + " 'boneless beef cube': ['boneless beef cubes', 'boneless beef cubes'],\n", + " 'bone-in beef rib roast': ['boneless beef rib roast',\n", + " 'boneless beef rib roast'],\n", + " 'boneless beef short ribs': ['boneless beef ribs',\n", + " 'boneless beef ribs',\n", + " 'boneless beef short rib'],\n", + " 'cooked boneless beef roast': ['boneless beef roast', 'boneless beef roast'],\n", + " 'boneless beef top round steak': ['boneless beef round steak',\n", + " 'boneless beef round steak',\n", + " 'boneless beef top round'],\n", + " 'boneless beef roast': ['boneless beef rump roast',\n", + " 'boneless beef rump roast',\n", + " 'cooked boneless beef roast'],\n", + " 'beef shank': ['boneless beef shank', 'boneless beef shank'],\n", + " 'boneless beef short rib': ['boneless beef short ribs',\n", + " 'boneless beef short ribs'],\n", + " 'boneless beef loin': ['boneless beef shoulder', 'boneless beef shoulder'],\n", + " 'boneless sirloin': ['boneless beef sirloin', 'boneless beef sirloin'],\n", + " 'boneless beef round steak': ['boneless beef steak',\n", + " 'boneless beef steak',\n", + " 'boneless beef top round steak',\n", + " 'boneless eye of round beef steak',\n", + " 'boneless round steak'],\n", + " 'boneless beef steak': ['boneless beef steaks',\n", + " 'boneless beef steaks',\n", + " 'boneless steak'],\n", + " 'beef tenderloin': ['boneless beef tenderloin',\n", + " 'boneless beef tenderloin',\n", + " 'pork tenderloin'],\n", + " 'boneless beef top loin steaks': ['boneless beef top loin steak',\n", + " 'boneless beef top loin steak',\n", + " 'boneless beef top round steaks'],\n", + " 'boneless beef top loin steak': ['boneless beef top loin steaks',\n", + " 'boneless beef top loin steaks'],\n", + " 'boneless beef top sirloin steaks': ['boneless beef top sirloin steak',\n", + " 'boneless beef top sirloin steak'],\n", + " 'boneless beef top sirloin steak': ['boneless beef top sirloin steaks',\n", + " 'boneless beef top sirloin steaks'],\n", + " 'boneless strip steaks': ['boneless blade steaks', 'boneless blade steaks'],\n", + " 'boneless round roast': ['boneless bottom round roast',\n", + " 'boneless bottom round roast',\n", + " 'boneless cross-rib roast'],\n", + " 'boneless pork loin chop': ['boneless butterfly pork loin chop',\n", + " 'boneless butterfly pork loin chop',\n", + " 'boneless pork chop'],\n", + " 'boneless pork loin chops': ['boneless butterfly pork loin chops',\n", + " 'boneless butterfly pork loin chops',\n", + " 'boneless pork chops',\n", + " 'pork loin chops with bone'],\n", + " 'boneless center cut pork chops': ['boneless center cut pork chop',\n", + " 'boneless center cut pork chop'],\n", + " 'boneless center cut pork chop': ['boneless center cut pork chops',\n", + " 'boneless center cut pork chops'],\n", + " 'boneless pork loin roast': ['boneless center cut pork loin roast',\n", + " 'boneless center cut pork loin roast',\n", + " 'boneless pork blade roast',\n", + " 'boneless pork roast'],\n", + " 'boneless chicken breast': ['boneless chicken',\n", + " 'boneless chicken',\n", + " 'boneless chicken breasts'],\n", + " 'boneless chicken breasts': ['boneless chicken breast',\n", + " 'boneless chicken breast'],\n", + " 'boneless chicken breast halves': ['boneless chicken breast half',\n", + " 'boneless chicken breast half'],\n", + " 'boneless chicken breast half': ['boneless chicken breast halves',\n", + " 'boneless chicken breast halves'],\n", + " 'boneless skinless chicken thighs': ['boneless chicken thighs',\n", + " 'boneless chicken thighs',\n", + " 'boneless skinless chicken legs'],\n", + " 'boneless ribs': ['boneless country-style ribs',\n", + " 'boneless country-style ribs',\n", + " 'boneless short ribs'],\n", + " 'boneless duck breasts': ['boneless duck breast',\n", + " 'boneless duck breast',\n", + " 'boneless skinless duck breasts'],\n", + " 'boneless skinless duck breast halves': ['boneless duck breast halves',\n", + " 'boneless duck breast halves'],\n", + " 'boneless duck breast': ['boneless duck breasts',\n", + " 'boneless duck breasts',\n", + " 'boneless duck leg',\n", + " 'boneless duck meat'],\n", + " 'boneless fish fillets': ['boneless fish fillet',\n", + " 'boneless fish fillet',\n", + " 'fresh boneless fish fillets'],\n", + " 'boneless fish fillet': ['boneless fish fillets', 'boneless fish fillets'],\n", + " 'bone-in ham': ['boneless ham', 'boneless ham'],\n", + " 'boneless leg of lamb': ['boneless lamb', 'boneless lamb'],\n", + " 'boneless lamb': ['boneless lamb loin',\n", + " 'boneless lamb loin',\n", + " 'boneless lamb roast',\n", + " 'boneless lamb shoulder',\n", + " 'boneless leg of lamb',\n", + " 'lamb bone'],\n", + " 'boneless lean lamb': ['boneless lamb stewing meat',\n", + " 'boneless lamb stewing meat',\n", + " 'lean boneless leg of lamb'],\n", + " 'lean boneless lamb': ['boneless lean lamb',\n", + " 'boneless lean lamb',\n", + " 'lean boneless lamb'],\n", + " 'lean boneless pork': ['boneless lean pork',\n", + " 'boneless lean pork',\n", + " 'lean boneless pork'],\n", + " 'boneless lean pork': ['boneless pork',\n", + " 'boneless pork',\n", + " 'lean boneless pork loin'],\n", + " 'boneless pork': ['boneless pork butt',\n", + " 'boneless pork butt',\n", + " 'boneless pork filets'],\n", + " 'boneless pork loin steaks': ['boneless pork butt shank steaks',\n", + " 'boneless pork butt shank steaks',\n", + " 'boneless pork steaks',\n", + " 'pork loin steaks'],\n", + " 'pork cutlets': ['boneless pork cutlets',\n", + " 'boneless pork cutlets',\n", + " 'pork cutlet'],\n", + " 'boneless pork top loin': ['boneless pork loin', 'boneless pork loin'],\n", + " 'boneless pork chop': ['boneless pork loin chop', 'boneless pork loin chop'],\n", + " 'boneless pork chops': ['boneless pork loin chops',\n", + " 'boneless pork loin chops'],\n", + " 'boneless pork steaks': ['boneless pork loin steaks',\n", + " 'boneless pork loin steaks',\n", + " 'pork butterfly steaks'],\n", + " 'pork rib roast': ['boneless pork rib roast', 'boneless pork rib roast'],\n", + " 'boneless beef ribs': ['boneless pork ribs',\n", + " 'boneless pork ribs',\n", + " 'boneless ribs'],\n", + " 'lean boneless pork shoulder': ['boneless pork shoulder',\n", + " 'boneless pork shoulder',\n", + " 'lean pork shoulder'],\n", + " 'boneless sirloin pork chop': ['boneless pork sirloin',\n", + " 'boneless pork sirloin'],\n", + " 'boneless sirloin tip roast': ['boneless pork sirloin tip roast',\n", + " 'boneless pork sirloin tip roast',\n", + " 'sirloin tip roast'],\n", + " 'boneless pork loin': ['boneless pork top loin', 'boneless pork top loin'],\n", + " 'boneless rib-eye steak': ['boneless rib-eye',\n", + " 'boneless rib-eye',\n", + " 'boneless rib-eye steaks'],\n", + " 'boneless rib-eye': ['boneless rib-eye roast',\n", + " 'boneless rib-eye roast',\n", + " 'boneless rib-eye steak'],\n", + " 'boneless rib-eye steaks': ['boneless rib-eyes', 'boneless rib-eyes'],\n", + " 'boneless bottom round roast': ['boneless round roast',\n", + " 'boneless round roast'],\n", + " 'boneless skinless salmon fillet': ['boneless salmon fillet',\n", + " 'boneless salmon fillet',\n", + " 'boneless skinless salmon',\n", + " 'boneless skinless salmon fillets',\n", + " 'skinless salmon fillet'],\n", + " 'boneless skinless salmon fillets': ['boneless salmon fillets',\n", + " 'boneless salmon fillets',\n", + " 'boneless skinless salmon fillet'],\n", + " 'boneless steak': ['boneless shell steak', 'boneless shell steak'],\n", + " 'boneless beef sirloin': ['boneless sirloin',\n", + " 'boneless sirloin',\n", + " 'boneless venison sirloin',\n", + " 'lean boneless sirloin',\n", + " 'round bone sirloin'],\n", + " 'boneless pork sirloin': ['boneless sirloin pork chop',\n", + " 'boneless sirloin pork chop'],\n", + " 'pork sirloin chops': ['boneless sirloin pork chops',\n", + " 'boneless sirloin pork chops'],\n", + " 'boneless sirloin steaks': ['boneless sirloin steak',\n", + " 'boneless sirloin steak'],\n", + " 'boneless sirloin steak': ['boneless sirloin steaks',\n", + " 'boneless sirloin steaks'],\n", + " 'sirloin tip roast': ['boneless sirloin tip roast',\n", + " 'boneless sirloin tip roast',\n", + " 'top sirloin roast'],\n", + " 'boneless skinless chicken breast': ['boneless skinless chicken',\n", + " 'boneless skinless chicken',\n", + " 'boneless skinless chicken breasts'],\n", + " 'boneless skinless chicken breasts': ['boneless skinless chicken breast',\n", + " 'boneless skinless chicken breast',\n", + " 'boneless skinless chicken cutlets',\n", + " 'boneless skinless smoked chicken breasts'],\n", + " 'boneless skinless chicken breast halves': ['boneless skinless chicken breast half',\n", + " 'boneless skinless chicken breast half',\n", + " 'skinless chicken breast halves'],\n", + " 'boneless skinless chicken breast half': ['boneless skinless chicken breast halves',\n", + " 'boneless skinless chicken breast halves'],\n", + " 'boneless skinless chicken cutlets': ['boneless skinless chicken cutlet',\n", + " 'boneless skinless chicken cutlet',\n", + " 'breaded chicken cutlets'],\n", + " 'skinless chicken pieces': ['boneless skinless chicken pieces',\n", + " 'boneless skinless chicken pieces',\n", + " 'chicken pieces',\n", + " 'skinless chicken piece'],\n", + " 'boneless chicken thighs': ['boneless skinless chicken thighs',\n", + " 'boneless skinless chicken thighs'],\n", + " 'boneless duck breast halves': ['boneless skinless duck breast halves',\n", + " 'boneless skinless duck breast halves',\n", + " 'duck breast halves'],\n", + " 'skinless boneless pheasant breast halves': ['boneless skinless pheasant breasts',\n", + " 'boneless skinless pheasant breasts'],\n", + " 'boneless skinless salmon': ['boneless skinless pink salmon',\n", + " 'boneless skinless pink salmon'],\n", + " 'skinless turkey thighs': ['boneless skinless turkey thighs',\n", + " 'boneless skinless turkey thighs',\n", + " 'skinless turkey legs',\n", + " 'turkey thighs'],\n", + " 'boneless skinned chicken breasts': ['boneless skinned chicken breast',\n", + " 'boneless skinned chicken breast'],\n", + " 'boneless skinned chicken breast': ['boneless skinned chicken breasts',\n", + " 'boneless skinned chicken breasts'],\n", + " 'boneless blade steaks': ['boneless strip steaks', 'boneless strip steaks'],\n", + " 'butterball boneless breast of turkey': ['boneless turkey breast',\n", + " 'boneless turkey breast'],\n", + " 'boneless turkey breast halves': ['boneless turkey breast half',\n", + " 'boneless turkey breast half'],\n", + " 'boneless turkey breast half': ['boneless turkey breast halves',\n", + " 'boneless turkey breast halves'],\n", + " 'boneless veal shoulder': ['boneless veal loin',\n", + " 'boneless veal loin',\n", + " 'veal shoulder'],\n", + " 'veal round roast': ['boneless veal rump roast',\n", + " 'boneless veal rump roast',\n", + " 'veal roast'],\n", + " 'veal shoulder': ['boneless veal shoulder', 'boneless veal shoulder'],\n", + " 'veal steak': ['boneless veal steaks',\n", + " 'boneless veal steaks',\n", + " 'veal round steak',\n", + " 'veal tenderloin'],\n", + " 'white fish fillet': ['boneless white fish',\n", + " 'boneless white fish',\n", + " 'white fish fillets'],\n", + " 'albacore tuna': ['bonito tuna',\n", + " 'bonito tuna',\n", + " 'sashimi-grade tuna',\n", + " 'starkist tuna'],\n", + " 'epazote leaves': ['borage leaves', 'borage leaves'],\n", + " 'cannellini beans': ['borlotti beans', 'borlotti beans'],\n", + " 'bosc pears': ['bosc pear', 'bosc pear'],\n", + " 'bosc pear': ['bosc pears', 'bosc pears'],\n", + " 'boston lettuce leaf': ['boston lettuce',\n", + " 'boston lettuce',\n", + " 'boston lettuce leaves'],\n", + " 'boston lettuce leaves': ['boston lettuce leaf', 'boston lettuce leaf'],\n", + " 'clam broth': ['bottled clam broth', 'bottled clam broth'],\n", + " 'clam juice': ['bottled clam juice', 'bottled clam juice'],\n", + " 'fresh garlic': ['bottled garlic',\n", + " 'bottled garlic',\n", + " 'dried garlic',\n", + " 'fresh white garlic'],\n", + " 'fresh lemon juice': ['bottled lemon juice',\n", + " 'bottled lemon juice',\n", + " 'fresh lemon',\n", + " 'fresh meyer lemon juice',\n", + " 'frozen lemon juice',\n", + " 'lemon juice'],\n", + " 'vinaigrette dressing': ['bottled vinaigrette dressing',\n", + " 'bottled vinaigrette dressing',\n", + " 'honey-balsamic vinaigrette',\n", + " 'vinaigrette'],\n", + " 'tap water': ['bottled water', 'bottled water'],\n", + " 'beef round rump roast': ['bottom round beef roast',\n", + " 'bottom round beef roast'],\n", + " 'top round steak': ['bottom round steak',\n", + " 'bottom round steak',\n", + " 'round steak'],\n", + " 'top round steaks': ['bottom round steaks',\n", + " 'bottom round steaks',\n", + " 'round steaks'],\n", + " 'andouille sausages': ['boudin sausages', 'boudin sausages'],\n", + " 'vegetable bouillon': ['bouillon', 'bouillon', 'tomato bouillon'],\n", + " 'vegetable bouillon cube': ['bouillon cube', 'bouillon cube'],\n", + " 'vegetable bouillon cubes': ['bouillon cubes', 'bouillon cubes'],\n", + " 'bourbon whiskey': ['bourbon',\n", + " 'bourbon',\n", + " 'jim beam bourbon whiskey',\n", + " 'whiskey'],\n", + " 'bourbon': ['bourbon whiskey', 'bourbon whiskey'],\n", + " 'light boursin cheese': ['boursin cheese', 'boursin cheese'],\n", + " 'cooked bow tie pasta': ['bow tie pasta', 'bow tie pasta'],\n", + " 'strawberry jam': ['boysenberry jam',\n", + " 'boysenberry jam',\n", + " 'reduced-calorie strawberry jam'],\n", + " 'braeburn apples': ['braeburn apple', 'braeburn apple'],\n", + " 'braeburn apple': ['braeburn apples', 'braeburn apples'],\n", + " 'braggs liquid aminos': ['braggs aminos', 'braggs aminos'],\n", + " 'braggs aminos': ['braggs liquid aminos', 'braggs liquid aminos'],\n", + " 'wheat bran flakes': ['bran flakes',\n", + " 'bran flakes',\n", + " 'oat bran flakes',\n", + " 'wheat flakes'],\n", + " 'oat bran flour': ['bran flour', 'bran flour', 'oat flour'],\n", + " 'apple brandy': ['brandy', 'brandy'],\n", + " 'braunschweiger sausage': ['braunschweiger liver sausage',\n", + " 'braunschweiger liver sausage'],\n", + " 'braunschweiger liver sausage': ['braunschweiger sausage',\n", + " 'braunschweiger sausage',\n", + " 'liver sausage'],\n", + " 'brazil nuts': ['brazil nut', 'brazil nut'],\n", + " 'brazil nut': ['brazil nuts', 'brazil nuts'],\n", + " 'grain bread': ['bread', 'bread', 'mixed grain bread'],\n", + " 'bread and butter pickles': ['bread and butter pickle juice',\n", + " 'bread and butter pickle juice'],\n", + " 'bread and butter pickle juice': ['bread and butter pickles',\n", + " 'bread and butter pickles'],\n", + " 'bread bowls': ['bread bowl', 'bread bowl'],\n", + " 'bread bowl': ['bread bowls', 'bread bowls'],\n", + " 'soft bread cubes': ['bread cubes', 'bread cubes'],\n", + " 'french bread dough': ['bread dough', 'bread dough', 'french bread'],\n", + " 'wheat bread flour': ['bread flour', 'bread flour'],\n", + " 'bread machine flour': ['bread machine dough',\n", + " 'bread machine dough',\n", + " 'white bread machine flour'],\n", + " 'white bread machine flour': ['bread machine flour', 'bread machine flour'],\n", + " 'yeast bread dough': ['bread machine yeast', 'bread machine yeast'],\n", + " 'pizza crust': ['bread pizza crust',\n", + " 'bread pizza crust',\n", + " 'pizza crusts',\n", + " 'thin pizza crust'],\n", + " 'bread rounds': ['bread round', 'bread round', 'pumpernickel rounds'],\n", + " 'bread round': ['bread rounds', 'bread rounds'],\n", + " 'dry breadcrumbs': ['breadcrumbs',\n", + " 'breadcrumbs',\n", + " 'dried breadcrumbs',\n", + " 'fine dry breadcrumbs',\n", + " 'panko breadcrumbs',\n", + " 'soft breadcrumbs',\n", + " 'toasted breadcrumbs'],\n", + " 'breaded chicken patties': ['breaded chicken nuggets',\n", + " 'breaded chicken nuggets'],\n", + " 'breaded chicken cutlets': ['breaded chicken patties',\n", + " 'breaded chicken patties',\n", + " 'breaded chicken tenders',\n", + " 'chicken cutlets'],\n", + " 'breaded fish fillets': ['breaded fish fillet', 'breaded fish fillet'],\n", + " 'breaded fish fillet': ['breaded fish fillets', 'breaded fish fillets'],\n", + " 'breadsticks': ['breadstick', 'breadstick', 'soft breadsticks'],\n", + " 'soft breadsticks': ['breadsticks', 'breadsticks'],\n", + " 'cereal': ['breakfast cereal', 'breakfast cereal', 'grain cereal'],\n", + " 'hot sausage': ['breakfast sausage',\n", + " 'breakfast sausage',\n", + " 'sausage',\n", + " 'summer sausage'],\n", + " 'sausage links': ['breakfast sausage links',\n", + " 'breakfast sausage links',\n", + " 'link sausage'],\n", + " 'sausage patties': ['breakfast sausage patties',\n", + " 'breakfast sausage patties',\n", + " 'turkey sausage patties'],\n", + " 'light sour cream': ['breakstones sour cream',\n", + " 'breakstones sour cream',\n", + " 'knudsen sour cream',\n", + " 'sour cream'],\n", + " 'sea bream': ['bream', 'bream'],\n", + " 'veal cutlets': ['breasts of veal',\n", + " 'breasts of veal',\n", + " 'veal cutlet',\n", + " 'veal fillets'],\n", + " 'black tea': ['brewed black tea', 'brewed black tea', 'strong black tea'],\n", + " 'brewed espresso': ['brewed coffee', 'brewed coffee', 'ground espresso'],\n", + " 'decaffeinated espresso': ['brewed decaffeinated coffee',\n", + " 'brewed decaffeinated coffee'],\n", + " 'brewed coffee': ['brewed espresso', 'brewed espresso'],\n", + " 'brewed tea': ['brewed green tea', 'brewed green tea'],\n", + " 'brewed black tea': ['brewed tea', 'brewed tea'],\n", + " 'camembert cheese': ['brie cheese',\n", + " 'brie cheese',\n", + " 'light camembert cheese',\n", + " 'manchego cheese'],\n", + " 'brioche rolls': ['brioche bread', 'brioche bread'],\n", + " 'brioche bread': ['brioche rolls', 'brioche rolls'],\n", + " 'broad beans': ['broad bean', 'broad bean'],\n", + " 'dried broad beans': ['broad beans', 'broad beans'],\n", + " 'broad egg noodles': ['broad egg noodle',\n", + " 'broad egg noodle',\n", + " 'wide egg noodles'],\n", + " 'wide egg noodles': ['broad egg noodles',\n", + " 'broad egg noodles',\n", + " 'yolk-free wide egg noodles'],\n", + " 'broccoli florets': ['broccoli',\n", + " 'broccoli',\n", + " 'broccoli sprouts',\n", + " 'cooked broccoli'],\n", + " 'cream of broccoli soup': ['broccoli cheese soup',\n", + " 'broccoli cheese soup',\n", + " 'condensed cream of broccoli soup',\n", + " 'cream of broccoli soup mix',\n", + " 'cream of chicken and broccoli soup',\n", + " 'reduced-fat cream of broccoli soup'],\n", + " 'broccoli slaw mix': ['broccoli coleslaw mix', 'broccoli coleslaw mix'],\n", + " 'broccoli sprouts': ['broccoli florets', 'broccoli florets'],\n", + " 'broccoli coleslaw mix': ['broccoli slaw mix', 'broccoli slaw mix'],\n", + " 'broccoli spears': ['broccoli spear', 'broccoli spear'],\n", + " 'broccoli spear': ['broccoli spears', 'broccoli spears'],\n", + " 'broccoli stems': ['broccoli stem', 'broccoli stem'],\n", + " 'broccoli stem': ['broccoli stems', 'broccoli stems'],\n", + " 'broiler chickens': ['broiler chicken', 'broiler chicken'],\n", + " 'broiler chicken': ['broiler chickens', 'broiler chickens'],\n", + " 'broken pretzels': ['broken pretzel', 'broken pretzel'],\n", + " 'broken pretzel': ['broken pretzels', 'broken pretzels'],\n", + " 'chicken broth': ['broth',\n", + " 'broth',\n", + " 'chicken broth soup',\n", + " 'duck broth',\n", + " 'homemade chicken broth',\n", + " 'light chicken broth',\n", + " 'rich chicken broth'],\n", + " 'cooked brown and wild rice mix': ['brown and wild rice mix',\n", + " 'brown and wild rice mix'],\n", + " 'bean sauce': ['brown bean sauce', 'brown bean sauce', 'ground bean sauce'],\n", + " 'black bread': ['brown bread', 'brown bread'],\n", + " 'dry brown breadcrumbs': ['brown breadcrumbs', 'brown breadcrumbs'],\n", + " 'brown button mushrooms': ['brown button mushroom',\n", + " 'brown button mushroom',\n", + " 'button mushrooms',\n", + " 'fresh button mushrooms',\n", + " 'white button mushrooms'],\n", + " 'white button mushrooms': ['brown button mushrooms',\n", + " 'brown button mushrooms'],\n", + " 'cardamom pods': ['brown cardamom pods',\n", + " 'brown cardamom pods',\n", + " 'cardamom pod'],\n", + " 'brown gravy mix': ['brown gravy',\n", + " 'brown gravy',\n", + " 'gravy mix',\n", + " 'reduced-sodium brown gravy mix'],\n", + " 'brown gravy': ['brown gravy mix', 'brown gravy mix'],\n", + " 'dried brown lentils': ['brown lentils', 'brown lentils'],\n", + " 'dark mustard': ['brown mustard', 'brown mustard', 'sweet dark mustard'],\n", + " 'mustard seeds': ['brown mustard seeds',\n", + " 'brown mustard seeds',\n", + " 'white mustard seeds',\n", + " 'whole mustard seeds',\n", + " 'yellow mustard seeds'],\n", + " 'green onion': ['brown onion', 'brown onion', 'whole green onion'],\n", + " 'onion soup mix': ['brown onion soup mix',\n", + " 'brown onion soup mix',\n", + " 'dry onion soup mix',\n", + " 'french onion soup mix',\n", + " 'tomato & onion soup mix'],\n", + " 'green onions': ['brown onions', 'brown onions', 'whole green onions'],\n", + " 'brown paper bags': ['brown paper bag', 'brown paper bag'],\n", + " 'brown paper bag': ['brown paper bags', 'brown paper bags'],\n", + " 'cooked brown rice': ['brown rice',\n", + " 'brown rice',\n", + " 'cooked short-grain brown rice'],\n", + " 'rice syrup': ['brown rice syrup', 'brown rice syrup'],\n", + " 'thai rice noodles': ['brown rice udon noodles', 'brown rice udon noodles'],\n", + " 'rice vinegar': ['brown rice vinegar', 'brown rice vinegar'],\n", + " 'brown sesame seeds': ['brown sesame seed',\n", + " 'brown sesame seed',\n", + " 'sesame seeds'],\n", + " 'brown sesame seed': ['brown sesame seeds', 'brown sesame seeds'],\n", + " 'dark brown sugar': ['brown sugar',\n", + " 'brown sugar',\n", + " 'light brown sugar',\n", + " 'soft brown sugar'],\n", + " 'cinnamon syrup': ['brown sugar cinnamon syrup',\n", + " 'brown sugar cinnamon syrup'],\n", + " 'sugar cubes': ['brown sugar cubes', 'brown sugar cubes', 'sugar cube'],\n", + " 'sugar substitute': ['brown sugar substitute',\n", + " 'brown sugar substitute',\n", + " 'equal sugar substitute',\n", + " 'liquid sugar substitute'],\n", + " 'sugar twin': ['brown sugar twin', 'brown sugar twin'],\n", + " 'herb stuffing mix': ['brownberry herb stuffing mix',\n", + " 'brownberry herb stuffing mix',\n", + " 'herb seasoned stuffing mix'],\n", + " 'brownie mix': ['brownie', 'brownie'],\n", + " 'chocolate chunk brownie mix': ['brownie mix',\n", + " 'brownie mix',\n", + " 'double chocolate brownie mix'],\n", + " 'walnut brownie mix': ['brownie mix with walnuts',\n", + " 'brownie mix with walnuts'],\n", + " 'fresh brussels sprout': ['brussels sprout', 'brussels sprout'],\n", + " 'fresh brussels sprouts': ['brussels sprouts',\n", + " 'brussels sprouts',\n", + " 'frozen brussels sprouts'],\n", + " 'buckwheat noodles': ['buckwheat noodle', 'buckwheat noodle'],\n", + " 'buckwheat noodle': ['buckwheat noodles', 'buckwheat noodles'],\n", + " 'ten-grain pancake mix': ['buckwheat pancake mix',\n", + " 'buckwheat pancake mix',\n", + " 'pancake mix'],\n", + " 'budweiser beer': ['bud light beer',\n", + " 'bud light beer',\n", + " 'coors beer',\n", + " 'heineken lager beer'],\n", + " 'bud light beer': ['budweiser beer', 'budweiser beer'],\n", + " 'beef flank steak': ['buffalo flank steak', 'buffalo flank steak'],\n", + " 'mozzarella cheese': ['buffalo mozzarella',\n", + " 'buffalo mozzarella',\n", + " 'fresh mozzarella cheese',\n", + " 'light mozzarella cheese',\n", + " 'mozzarella cheddar blend cheese',\n", + " 'mozzarella curd',\n", + " 'pre-shredded mozzarella cheese',\n", + " 'smoked mozzarella cheese'],\n", + " 'chicken wing sauce': ['buffalo wing sauce', 'buffalo wing sauce'],\n", + " 'bugles original flavor snacks': ['bugles nacho flavor snacks',\n", + " 'bugles nacho flavor snacks'],\n", + " 'bugles nacho flavor snacks': ['bugles original flavor snacks',\n", + " 'bugles original flavor snacks'],\n", + " 'bulbs of garlic': ['bulb of garlic', 'bulb of garlic'],\n", + " 'bulb of garlic': ['bulbs of garlic', 'bulbs of garlic'],\n", + " 'scallion bulbs': ['bulbs shallots', 'bulbs shallots'],\n", + " 'bulgur wheat': ['bulgar wheat', 'bulgar wheat', 'cracked bulgur wheat'],\n", + " 'balkan style yogurt': ['bulgarian yogurt', 'bulgarian yogurt'],\n", + " 'bulgar wheat': ['bulgur wheat', 'bulgur wheat'],\n", + " 'bulk sausage': ['bulk italian sausage',\n", + " 'bulk italian sausage',\n", + " 'bulk pork sausage',\n", + " 'spicy bulk sausage',\n", + " 'sweet bulk sausage'],\n", + " 'sweet bulk sausage': ['bulk sausage', 'bulk sausage'],\n", + " 'buns': ['bun', 'bun'],\n", + " 'sandwich buns': ['buns', 'buns', 'sandwich bun'],\n", + " 'tilsit cheese': ['burata cheese', 'burata cheese'],\n", + " 'burgundy wine': ['burgundy cooking wine',\n", + " 'burgundy cooking wine',\n", + " 'red burgundy wine'],\n", + " 'red burgundy wine': ['burgundy wine', 'burgundy wine'],\n", + " 'taco seasoning mix': ['burrito seasoning mix',\n", + " 'burrito seasoning mix',\n", + " 'mccormick taco seasoning mix',\n", + " 'reduced-sodium taco seasoning mix',\n", + " 'taco seasoning'],\n", + " 'burrito-size flour tortillas': ['burrito-size flour tortilla',\n", + " 'burrito-size flour tortilla'],\n", + " 'burrito-size flour tortilla': ['burrito-size flour tortillas',\n", + " 'burrito-size flour tortillas'],\n", + " 'burrito-size whole wheat tortillas': ['burrito-size whole wheat tortilla',\n", + " 'burrito-size whole wheat tortilla',\n", + " 'whole wheat tortillas'],\n", + " 'burrito-size whole wheat tortilla': ['burrito-size whole wheat tortillas',\n", + " 'burrito-size whole wheat tortillas'],\n", + " 'bushs red beans': ['bush beans', 'bush beans'],\n", + " 'chili-ready tomatoes': ['bush tomatoes',\n", + " 'bush tomatoes',\n", + " 'fire-roasted tomatoes',\n", + " 'italian-style tomatoes',\n", + " 'mexican-style tomatoes',\n", + " 'salsa-style tomatoes'],\n", + " 'irish whiskey': ['bushmills whiskey', 'bushmills whiskey'],\n", + " 'bush beans': ['bushs red beans', 'bushs red beans'],\n", + " 'liquid butter': ['butter', 'butter'],\n", + " 'dried butter beans': ['butter beans', 'butter beans'],\n", + " 'chocolate cake mix with pudding': ['butter cake mix with pudding',\n", + " 'butter cake mix with pudding',\n", + " 'german chocolate cake mix with pudding',\n", + " 'strawberry cake mix with pudding',\n", + " 'white cake mix with pudding'],\n", + " 'chicken stock paste': ['butter chicken paste', 'butter chicken paste'],\n", + " 'butter cookies': ['butter cookie', 'butter cookie'],\n", + " 'butter cookie': ['butter cookies', 'butter cookies'],\n", + " 'croissants': ['butter croissants', 'butter croissants', 'plain croissants'],\n", + " 'butter flavor shortening': ['butter flavor crisco', 'butter flavor crisco'],\n", + " 'butter flavor crisco': ['butter flavor shortening',\n", + " 'butter flavor shortening'],\n", + " 'butter flavored crackers': ['butter flavored cracker',\n", + " 'butter flavored cracker'],\n", + " 'butter flavored cracker': ['butter flavored crackers',\n", + " 'butter flavored crackers'],\n", + " 'butter lettuce leaf': ['butter lettuce',\n", + " 'butter lettuce',\n", + " 'butter lettuce leaves'],\n", + " 'butter lettuce leaves': ['butter lettuce leaf', 'butter lettuce leaf'],\n", + " 'peas': ['butter peas', 'butter peas', 'english peas', 'field peas'],\n", + " 'pecan cake frosting': ['butter pecan cake mix',\n", + " 'butter pecan cake mix',\n", + " 'coconut pecan frosting'],\n", + " 'chocolate pound cake': ['butter pound cake',\n", + " 'butter pound cake',\n", + " 'chocolate cake'],\n", + " 'unsalted butter substitute': ['butter substitute', 'butter substitute'],\n", + " 'cooking spray': ['butter-flavored cooking spray',\n", + " 'butter-flavored cooking spray'],\n", + " 'reduced-fat butter-flavored cracker crumbs': ['butter-flavored cracker crumbs',\n", + " 'butter-flavored cracker crumbs'],\n", + " 'chocolate sprinkles': ['butter-flavored sprinkles',\n", + " 'butter-flavored sprinkles',\n", + " 'candy sprinkles'],\n", + " 'butternut flavoring': ['butter-nut flavoring',\n", + " 'butter-nut flavoring',\n", + " 'butternut flavoring'],\n", + " 'boneless turkey breast': ['butterball boneless breast of turkey',\n", + " 'butterball boneless breast of turkey'],\n", + " 'fat free oven-roasted turkey breast': ['butterball fat free turkey',\n", + " 'butterball fat free turkey'],\n", + " 'chocolate buttercream icing': ['buttercream frosting',\n", + " 'buttercream frosting'],\n", + " 'buttered bread crumbs': ['buttered bread crumb', 'buttered bread crumb'],\n", + " 'seasoned bread crumbs': ['buttered bread crumbs',\n", + " 'buttered bread crumbs',\n", + " 'japanese-style bread crumbs',\n", + " 'seasoned dry bread crumbs',\n", + " 'sweet bread crumbs'],\n", + " 'butterfinger candy bar': ['butterfinger bar',\n", + " 'butterfinger bar',\n", + " 'butterfinger candy bars'],\n", + " ...}" + ] + }, + "execution_count": 170, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "empty" + ] + }, + { + "cell_type": "code", + "execution_count": 155, + "id": "73a022c6-ca75-4ccd-8dba-f439b5b583be", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.8100000023841858" + ] + }, + "execution_count": 155, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "if z[\"score\"] > 0.85:\n", + " if z[\"ingredient\"] not in list(empty.keys()):\n", + " empty[z[\"ingredient\"]] = [z[\"similar_ingredient\"]]\n", + " \n", + " if z[\"ingredient\"] not in list(empty.values()):\n", + " empty[z[\"ingredient\"]].append(z[\"similar_ingredient\"])\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "id": "5c1bcab8-1881-4e9a-9afa-094ae8fd2e2e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
0
01% fat buttermilk
\n", + "
" + ], + "text/plain": [ + " 0\n", + "0 1% fat buttermilk" + ] + }, + "execution_count": 80, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pd.DataFrame([z.index[0]])" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "id": "367fea87-66ec-4281-8282-be380fac8ab8", + "metadata": {}, + "outputs": [], + "source": [ + "final = pd.concat([pd.DataFrame(z.nlargest(2)[1:]).reset_index().rename(columns={\"1% fat buttermilk\": \"score\"}), pd.DataFrame([z.index[0]])], axis=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 111, + "id": "c8039d80-ff6d-4384-a3cd-3add066ec45d", + "metadata": {}, + "outputs": [], + "source": [ + "final1 = final[1:]" + ] + }, + { + "cell_type": "code", + "execution_count": 112, + "id": "b4a1712d-a8a1-4724-8223-b51ea39b43f8", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
indexscore0
\n", + "
" + ], + "text/plain": [ + "Empty DataFrame\n", + "Columns: [index, score, 0]\n", + "Index: []" + ] + }, + "execution_count": 112, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "final1" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "id": "a7237cea-0a14-4f70-8ba0-91c40217fa73", + "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", + "
indexscore0
02% buttermilk0.811% fat buttermilk
02% buttermilk0.811% fat buttermilk
\n", + "
" + ], + "text/plain": [ + " index score 0\n", + "0 2% buttermilk 0.81 1% fat buttermilk\n", + "0 2% buttermilk 0.81 1% fat buttermilk" + ] + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pd.concat([final, final])" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "id": "06fe21f8-845b-4b3d-b9e5-a7de36a02402", + "metadata": {}, + "outputs": [], + "source": [ + "final1 = final[1:]" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "id": "3d95499e-ea11-4ba7-8b3e-3d5cab3e533d", + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "Wrong number of dimensions. values.ndim > ndim [2 > 1]", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[52], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mfoo1\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumns\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mto_series\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m[\u001b[49m\u001b[43marank\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvalues\u001b[49m\u001b[43m[\u001b[49m\u001b[43m:\u001b[49m\u001b[43m,\u001b[49m\u001b[43m:\u001b[49m\u001b[43m:\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[43m:\u001b[49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m:\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m]\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:1038\u001b[0m, in \u001b[0;36mSeries.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1035\u001b[0m key \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39masarray(key, dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mbool\u001b[39m)\n\u001b[1;32m 1036\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_values(key)\n\u001b[0;32m-> 1038\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_with\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:1075\u001b[0m, in \u001b[0;36mSeries._get_with\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1073\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloc[key]\n\u001b[1;32m 1074\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1075\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43miloc\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 1077\u001b[0m \u001b[38;5;66;03m# handle the dup indexing case GH#4246\u001b[39;00m\n\u001b[1;32m 1078\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloc[key]\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/indexing.py:1103\u001b[0m, in \u001b[0;36m_LocationIndexer.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1100\u001b[0m axis \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maxis \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m 1102\u001b[0m maybe_callable \u001b[38;5;241m=\u001b[39m com\u001b[38;5;241m.\u001b[39mapply_if_callable(key, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mobj)\n\u001b[0;32m-> 1103\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_getitem_axis\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmaybe_callable\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/indexing.py:1647\u001b[0m, in \u001b[0;36m_iLocIndexer._getitem_axis\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m 1645\u001b[0m \u001b[38;5;66;03m# a list of integers\u001b[39;00m\n\u001b[1;32m 1646\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m is_list_like_indexer(key):\n\u001b[0;32m-> 1647\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_list_axis\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1649\u001b[0m \u001b[38;5;66;03m# a single integer\u001b[39;00m\n\u001b[1;32m 1650\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1651\u001b[0m key \u001b[38;5;241m=\u001b[39m item_from_zerodim(key)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/indexing.py:1618\u001b[0m, in \u001b[0;36m_iLocIndexer._get_list_axis\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m 1601\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1602\u001b[0m \u001b[38;5;124;03mReturn Series values by list or array of integers.\u001b[39;00m\n\u001b[1;32m 1603\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1615\u001b[0m \u001b[38;5;124;03m`axis` can only be zero.\u001b[39;00m\n\u001b[1;32m 1616\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1617\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1618\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_take_with_is_copy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1619\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 1620\u001b[0m \u001b[38;5;66;03m# re-raise with different error message\u001b[39;00m\n\u001b[1;32m 1621\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpositional indexers are out-of-bounds\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:976\u001b[0m, in \u001b[0;36mSeries._take_with_is_copy\u001b[0;34m(self, indices, axis)\u001b[0m\n\u001b[1;32m 967\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_take_with_is_copy\u001b[39m(\u001b[38;5;28mself\u001b[39m, indices, axis: Axis \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Series:\n\u001b[1;32m 968\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 969\u001b[0m \u001b[38;5;124;03m Internal version of the `take` method that sets the `_is_copy`\u001b[39;00m\n\u001b[1;32m 970\u001b[0m \u001b[38;5;124;03m attribute to keep track of the parent dataframe (using in indexing\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 974\u001b[0m \u001b[38;5;124;03m See the docstring of `take` for full explanation of the parameters.\u001b[39;00m\n\u001b[1;32m 975\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 976\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtake\u001b[49m\u001b[43m(\u001b[49m\u001b[43mindices\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mindices\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:964\u001b[0m, in \u001b[0;36mSeries.take\u001b[0;34m(self, indices, axis, **kwargs)\u001b[0m\n\u001b[1;32m 961\u001b[0m new_index \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mindex\u001b[38;5;241m.\u001b[39mtake(indices)\n\u001b[1;32m 962\u001b[0m new_values \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_values\u001b[38;5;241m.\u001b[39mtake(indices)\n\u001b[0;32m--> 964\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_constructor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnew_values\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mindex\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnew_index\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfastpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 965\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\u001b[38;5;241m.\u001b[39m__finalize__(\u001b[38;5;28mself\u001b[39m, method\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtake\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:407\u001b[0m, in \u001b[0;36mSeries.__init__\u001b[0;34m(self, data, index, dtype, name, copy, fastpath)\u001b[0m\n\u001b[1;32m 405\u001b[0m manager \u001b[38;5;241m=\u001b[39m get_option(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmode.data_manager\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 406\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m manager \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mblock\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m--> 407\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mSingleBlockManager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_array\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mindex\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 408\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m manager \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124marray\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m 409\u001b[0m data \u001b[38;5;241m=\u001b[39m SingleArrayManager\u001b[38;5;241m.\u001b[39mfrom_array(data, index)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/managers.py:1880\u001b[0m, in \u001b[0;36mSingleBlockManager.from_array\u001b[0;34m(cls, array, index, refs)\u001b[0m\n\u001b[1;32m 1873\u001b[0m \u001b[38;5;129m@classmethod\u001b[39m\n\u001b[1;32m 1874\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mfrom_array\u001b[39m(\n\u001b[1;32m 1875\u001b[0m \u001b[38;5;28mcls\u001b[39m, array: ArrayLike, index: Index, refs: BlockValuesRefs \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1876\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m SingleBlockManager:\n\u001b[1;32m 1877\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1878\u001b[0m \u001b[38;5;124;03m Constructor for if we have an array that is not yet a Block.\u001b[39;00m\n\u001b[1;32m 1879\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 1880\u001b[0m block \u001b[38;5;241m=\u001b[39m \u001b[43mnew_block\u001b[49m\u001b[43m(\u001b[49m\u001b[43marray\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mplacement\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mslice\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mindex\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mndim\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrefs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrefs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1881\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mcls\u001b[39m(block, index)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/blocks.py:2391\u001b[0m, in \u001b[0;36mnew_block\u001b[0;34m(values, placement, ndim, refs)\u001b[0m\n\u001b[1;32m 2388\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(placement, BlockPlacement):\n\u001b[1;32m 2389\u001b[0m placement \u001b[38;5;241m=\u001b[39m BlockPlacement(placement)\n\u001b[0;32m-> 2391\u001b[0m \u001b[43mcheck_ndim\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalues\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mplacement\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mndim\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2393\u001b[0m klass \u001b[38;5;241m=\u001b[39m get_block_type(values\u001b[38;5;241m.\u001b[39mdtype)\n\u001b[1;32m 2395\u001b[0m values \u001b[38;5;241m=\u001b[39m maybe_coerce_values(values)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/blocks.py:2419\u001b[0m, in \u001b[0;36mcheck_ndim\u001b[0;34m(values, placement, ndim)\u001b[0m\n\u001b[1;32m 2400\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 2401\u001b[0m \u001b[38;5;124;03mndim inference and validation.\u001b[39;00m\n\u001b[1;32m 2402\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2414\u001b[0m \u001b[38;5;124;03mValueError : the number of dimensions do not match\u001b[39;00m\n\u001b[1;32m 2415\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 2417\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m values\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m>\u001b[39m ndim:\n\u001b[1;32m 2418\u001b[0m \u001b[38;5;66;03m# Check for both np.ndarray and ExtensionArray\u001b[39;00m\n\u001b[0;32m-> 2419\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 2420\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWrong number of dimensions. \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 2421\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mvalues.ndim > ndim [\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mvalues\u001b[38;5;241m.\u001b[39mndim\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m > \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mndim\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m]\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 2422\u001b[0m )\n\u001b[1;32m 2424\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m is_1d_only_ea_dtype(values\u001b[38;5;241m.\u001b[39mdtype):\n\u001b[1;32m 2425\u001b[0m \u001b[38;5;66;03m# TODO(EA2D): special case not needed with 2D EAs\u001b[39;00m\n\u001b[1;32m 2426\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m values\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m!=\u001b[39m ndim:\n", + "\u001b[0;31mValueError\u001b[0m: Wrong number of dimensions. values.ndim > ndim [2 > 1]" + ] + } + ], + "source": [ + "i for i in foo1.columns.to_series()[arank.values[:,::-1][:,1:2]]" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "a8745a9c-1962-464f-bead-de1fa808b10d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([34])" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "arank.values[:,::-1][:,1:2][0]" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "95231077-9746-44e0-8bfa-f5c40561e495", + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "Wrong number of dimensions. values.ndim > ndim [2 > 1]", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[21], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m arank \u001b[38;5;241m=\u001b[39m foo1\u001b[38;5;241m.\u001b[39mapply(np\u001b[38;5;241m.\u001b[39margsort, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)\n\u001b[0;32m----> 2\u001b[0m ranked_cols \u001b[38;5;241m=\u001b[39m \u001b[43mfoo1\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumns\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mto_series\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m[\u001b[49m\u001b[43marank\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvalues\u001b[49m\u001b[43m[\u001b[49m\u001b[43m:\u001b[49m\u001b[43m,\u001b[49m\u001b[43m:\u001b[49m\u001b[43m:\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[43m:\u001b[49m\u001b[43m,\u001b[49m\u001b[43m:\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 3\u001b[0m new_frame \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame(ranked_cols, index\u001b[38;5;241m=\u001b[39mfoo1\u001b[38;5;241m.\u001b[39mindex)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:1038\u001b[0m, in \u001b[0;36mSeries.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1035\u001b[0m key \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39masarray(key, dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mbool\u001b[39m)\n\u001b[1;32m 1036\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_values(key)\n\u001b[0;32m-> 1038\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_with\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:1075\u001b[0m, in \u001b[0;36mSeries._get_with\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1073\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloc[key]\n\u001b[1;32m 1074\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1075\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43miloc\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 1077\u001b[0m \u001b[38;5;66;03m# handle the dup indexing case GH#4246\u001b[39;00m\n\u001b[1;32m 1078\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloc[key]\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/indexing.py:1103\u001b[0m, in \u001b[0;36m_LocationIndexer.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1100\u001b[0m axis \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maxis \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m 1102\u001b[0m maybe_callable \u001b[38;5;241m=\u001b[39m com\u001b[38;5;241m.\u001b[39mapply_if_callable(key, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mobj)\n\u001b[0;32m-> 1103\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_getitem_axis\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmaybe_callable\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/indexing.py:1647\u001b[0m, in \u001b[0;36m_iLocIndexer._getitem_axis\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m 1645\u001b[0m \u001b[38;5;66;03m# a list of integers\u001b[39;00m\n\u001b[1;32m 1646\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m is_list_like_indexer(key):\n\u001b[0;32m-> 1647\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_list_axis\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1649\u001b[0m \u001b[38;5;66;03m# a single integer\u001b[39;00m\n\u001b[1;32m 1650\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1651\u001b[0m key \u001b[38;5;241m=\u001b[39m item_from_zerodim(key)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/indexing.py:1618\u001b[0m, in \u001b[0;36m_iLocIndexer._get_list_axis\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m 1601\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1602\u001b[0m \u001b[38;5;124;03mReturn Series values by list or array of integers.\u001b[39;00m\n\u001b[1;32m 1603\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1615\u001b[0m \u001b[38;5;124;03m`axis` can only be zero.\u001b[39;00m\n\u001b[1;32m 1616\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1617\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1618\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_take_with_is_copy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1619\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 1620\u001b[0m \u001b[38;5;66;03m# re-raise with different error message\u001b[39;00m\n\u001b[1;32m 1621\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpositional indexers are out-of-bounds\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:976\u001b[0m, in \u001b[0;36mSeries._take_with_is_copy\u001b[0;34m(self, indices, axis)\u001b[0m\n\u001b[1;32m 967\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_take_with_is_copy\u001b[39m(\u001b[38;5;28mself\u001b[39m, indices, axis: Axis \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Series:\n\u001b[1;32m 968\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 969\u001b[0m \u001b[38;5;124;03m Internal version of the `take` method that sets the `_is_copy`\u001b[39;00m\n\u001b[1;32m 970\u001b[0m \u001b[38;5;124;03m attribute to keep track of the parent dataframe (using in indexing\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 974\u001b[0m \u001b[38;5;124;03m See the docstring of `take` for full explanation of the parameters.\u001b[39;00m\n\u001b[1;32m 975\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 976\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtake\u001b[49m\u001b[43m(\u001b[49m\u001b[43mindices\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mindices\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:964\u001b[0m, in \u001b[0;36mSeries.take\u001b[0;34m(self, indices, axis, **kwargs)\u001b[0m\n\u001b[1;32m 961\u001b[0m new_index \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mindex\u001b[38;5;241m.\u001b[39mtake(indices)\n\u001b[1;32m 962\u001b[0m new_values \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_values\u001b[38;5;241m.\u001b[39mtake(indices)\n\u001b[0;32m--> 964\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_constructor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnew_values\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mindex\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnew_index\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfastpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 965\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\u001b[38;5;241m.\u001b[39m__finalize__(\u001b[38;5;28mself\u001b[39m, method\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtake\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/series.py:407\u001b[0m, in \u001b[0;36mSeries.__init__\u001b[0;34m(self, data, index, dtype, name, copy, fastpath)\u001b[0m\n\u001b[1;32m 405\u001b[0m manager \u001b[38;5;241m=\u001b[39m get_option(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmode.data_manager\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 406\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m manager \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mblock\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m--> 407\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mSingleBlockManager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_array\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mindex\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 408\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m manager \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124marray\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m 409\u001b[0m data \u001b[38;5;241m=\u001b[39m SingleArrayManager\u001b[38;5;241m.\u001b[39mfrom_array(data, index)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/managers.py:1880\u001b[0m, in \u001b[0;36mSingleBlockManager.from_array\u001b[0;34m(cls, array, index, refs)\u001b[0m\n\u001b[1;32m 1873\u001b[0m \u001b[38;5;129m@classmethod\u001b[39m\n\u001b[1;32m 1874\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mfrom_array\u001b[39m(\n\u001b[1;32m 1875\u001b[0m \u001b[38;5;28mcls\u001b[39m, array: ArrayLike, index: Index, refs: BlockValuesRefs \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1876\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m SingleBlockManager:\n\u001b[1;32m 1877\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1878\u001b[0m \u001b[38;5;124;03m Constructor for if we have an array that is not yet a Block.\u001b[39;00m\n\u001b[1;32m 1879\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 1880\u001b[0m block \u001b[38;5;241m=\u001b[39m \u001b[43mnew_block\u001b[49m\u001b[43m(\u001b[49m\u001b[43marray\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mplacement\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mslice\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mindex\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mndim\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrefs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrefs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1881\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mcls\u001b[39m(block, index)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/blocks.py:2391\u001b[0m, in \u001b[0;36mnew_block\u001b[0;34m(values, placement, ndim, refs)\u001b[0m\n\u001b[1;32m 2388\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(placement, BlockPlacement):\n\u001b[1;32m 2389\u001b[0m placement \u001b[38;5;241m=\u001b[39m BlockPlacement(placement)\n\u001b[0;32m-> 2391\u001b[0m \u001b[43mcheck_ndim\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalues\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mplacement\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mndim\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2393\u001b[0m klass \u001b[38;5;241m=\u001b[39m get_block_type(values\u001b[38;5;241m.\u001b[39mdtype)\n\u001b[1;32m 2395\u001b[0m values \u001b[38;5;241m=\u001b[39m maybe_coerce_values(values)\n", + "File \u001b[0;32m/hpc/group/rescomp/sg623/miniconda3/envs/tf/lib/python3.9/site-packages/pandas/core/internals/blocks.py:2419\u001b[0m, in \u001b[0;36mcheck_ndim\u001b[0;34m(values, placement, ndim)\u001b[0m\n\u001b[1;32m 2400\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 2401\u001b[0m \u001b[38;5;124;03mndim inference and validation.\u001b[39;00m\n\u001b[1;32m 2402\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2414\u001b[0m \u001b[38;5;124;03mValueError : the number of dimensions do not match\u001b[39;00m\n\u001b[1;32m 2415\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 2417\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m values\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m>\u001b[39m ndim:\n\u001b[1;32m 2418\u001b[0m \u001b[38;5;66;03m# Check for both np.ndarray and ExtensionArray\u001b[39;00m\n\u001b[0;32m-> 2419\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 2420\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWrong number of dimensions. \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 2421\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mvalues.ndim > ndim [\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mvalues\u001b[38;5;241m.\u001b[39mndim\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m > \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mndim\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m]\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 2422\u001b[0m )\n\u001b[1;32m 2424\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m is_1d_only_ea_dtype(values\u001b[38;5;241m.\u001b[39mdtype):\n\u001b[1;32m 2425\u001b[0m \u001b[38;5;66;03m# TODO(EA2D): special case not needed with 2D EAs\u001b[39;00m\n\u001b[1;32m 2426\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m values\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m!=\u001b[39m ndim:\n", + "\u001b[0;31mValueError\u001b[0m: Wrong number of dimensions. values.ndim > ndim [2 > 1]" + ] + } + ], + "source": [ + "arank = foo1.apply(np.argsort, axis=1)\n", + "ranked_cols = foo1.columns.to_series()[arank.values[:,::-1][:,:2]]\n", + "new_frame = pd.DataFrame(ranked_cols, index=foo1.index)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ea450de-a67e-45e0-a840-c21fccf273aa", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "tf", + "language": "python", + "name": "tf" + }, + "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.9.16" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}