{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "collapsed_sections": [ "VEShbcVt2GuZ", "brOafK8PS_ne" ] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "source": [ "# Import Library and Global Variable" ], "metadata": { "id": "nefm9Y5uQ6iu" } }, { "cell_type": "code", "source": [ "# !pip install beautifulsoup4" ], "metadata": { "id": "QuTQj8E6N_2p" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "import json\n", "import numpy as np\n", "import os\n", "import pandas as pd\n", "import random\n", "import re\n", "import requests\n", "import uuid\n", "import zipfile\n", "from bs4 import BeautifulSoup" ], "metadata": { "id": "YVsVcK90Q5ab" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Mount Google Drive\n", "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "id": "NTwBSJh9Q-Kl", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "702f2269-8efd-4c27-c7b6-9b411c02f9ca" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n" ] } ] }, { "cell_type": "code", "source": [ "# Export file\n", "def export_array_to_txt(array, filename):\n", " with open(f\"{filename}.txt\", \"w\") as file:\n", " file.write(\"\\n\".join(array))\n", "\n", "def export_dataframe(df, directory, name):\n", " if not os.path.exists(directory):\n", " os.mkdir(directory)\n", " excel_file_name = directory + '/' + name + '.xlsx'\n", " df.to_excel(excel_file_name, index=True)\n", "\n", " csv_file_name = directory + '/' + name + '.csv'\n", " df.to_csv(csv_file_name, index=False)\n", "\n", "def create_zip_file(directory):\n", " zip_filename = directory + '.zip'\n", "\n", " # create the zip file\n", " with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zip_file:\n", " for root, dirs, files in os.walk(directory):\n", " for file in files:\n", " file_path = os.path.join(root, file)\n", " zip_file.write(file_path)\n", "\n", " print(f\"{zip_filename} created successfully!\")" ], "metadata": { "id": "jVYotZ5HOClQ" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "# Get Recipe's URL" ], "metadata": { "id": "8Oj0q-2iphf8" } }, { "cell_type": "code", "source": [ "# Function to get recipe's URL from each pages\n", "def get_recipe_urls(url):\n", " page = requests.get(url)\n", " soup = BeautifulSoup(page.content, 'html.parser')\n", "\n", " urls = []\n", " recipe_cards = soup.find_all('div', class_='_recipe-card')\n", "\n", " for recipe_card in recipe_cards:\n", " link_element = recipe_card.find('h3', class_='card-title').find('a')\n", " urls.append(link_element['href'])\n", "\n", " return urls" ], "metadata": { "id": "8TF1iISUO0pz" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Get all URL\n", "recipe_urls = []\n", "base_url = 'https://www.masakapahariini.com/resep/'\n", "page_number = 134\n", "\n", "for n in range(1, page_number):\n", " url = base_url if n == 1 else base_url + 'page/' + str(n)\n", " recipe_urls += get_recipe_urls(url)" ], "metadata": { "id": "yPglWH9XO17n" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "recipe_urls" ], "metadata": { "id": "naF2ErtqQRvd" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "export_array_to_txt(recipe_urls, \"mahi_urls\")" ], "metadata": { "id": "pdx1RNEFxIi_" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "# Scrapping Data" ], "metadata": { "id": "AEOCfQ_Oplaq" } }, { "cell_type": "code", "source": [ "# Import URL file\n", "filename = \"/content/drive/MyDrive/EzCook/May 2023/mahi_urls.txt\"\n", "\n", "with open(filename, 'r') as file:\n", " contents = file.read()\n", " lines = contents.split('\\n')\n", " recipe_urls = [line.strip() for line in lines]" ], "metadata": { "id": "ymoP4lEzyS80" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Check output\n", "recipe_urls[1]" ], "metadata": { "id": "PnNVRsbiy4sI", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "88db328c-14b7-47da-fade-42719f6be0bf" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'https://www.masakapahariini.com/resep/resep-ayam-rendang/'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 6 } ] }, { "cell_type": "code", "source": [ "# Check URL index\n", "url_to_find = \"https://www.masakapahariini.com/resep/resep-pepes-ikan-mas/\"\n", "\n", "try:\n", " index = recipe_urls.index(url_to_find)\n", " print(f\"Found URL at index {index}\")\n", "except ValueError:\n", " print(f\"URL '{url_to_find}' not found in list\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "XLvS_EKjiwcM", "outputId": "0c556d55-71a2-488a-902f-88d11c5f150e" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Found URL at index 86\n" ] } ] }, { "cell_type": "code", "source": [ "def generate_id_by_title(df):\n", " # Get unique titles from dataframe\n", " unique_titles = df['title'].unique()\n", "\n", " # Generate new IDs for each unique title\n", " new_ids = {title: random.randint(10_000_000_000, 99_999_999_999) for title in unique_titles}\n", "\n", " # Check that all new IDs are unique\n", " while len(set(new_ids.values())) != len(unique_titles):\n", " # Generate new IDs for any non-unique titles\n", " for title in unique_titles:\n", " if new_ids.count(title) > 1:\n", " new_ids[title] = random.randint(10_000_000_000, 99_999_999_999)\n", "\n", " # Map new IDs to dataframe\n", " df['id'] = df['title'].map(new_ids)\n", " return df" ], "metadata": { "id": "EMvpGw2WyIU1" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "class RecipeScraper:\n", " def __init__(self):\n", " self.page = None\n", " self.soup = None\n", "\n", " def get_soup(self, url):\n", " self.page = requests.get(url)\n", " self.soup = BeautifulSoup(self.page.content, 'html.parser')\n", "\n", " def extract_text(self, scripts):\n", " return [script.text.strip() for script in scripts]\n", "\n", " def extract_amount(self, scripts):\n", " return [script.get('data-base-quantity') for script in scripts]\n", "\n", " def extract_instructions(self, scripts):\n", " instructions = []\n", " for instruction in scripts:\n", " content = instruction.find('div', {'class': 'content'})\n", " if content.find('p'):\n", " p_element = content.find('p')\n", " text = p_element.get_text().strip()\n", " else:\n", " text = content.get_text().strip()\n", " instructions.append(text)\n", "\n", " return instructions\n", "\n", " def combine_ingredients(self, amounts, ingredients):\n", " combined = []\n", " for i in range(len(amounts)):\n", " data = str(amounts[i]) + \" \" + ingredients[i].replace('\\t', '').replace('\\n', '')\n", " data = ' '.join(data.split())\n", " combined.append(data)\n", " return combined\n", "\n", " def scrape_recipe(self, url):\n", " self.get_soup(url)\n", "\n", " title = self.soup.find('title')\n", " image_url = self.soup.find(\"img\", {\"class\": \"image\"})[\"src\"]\n", " time = self.soup.find('a', href=lambda href: href and 'time' in href).text.strip()\n", " servings = self.soup.find(\"div\", {\"id\": \"portions-value\"}).text.strip()\n", " difficulty = self.soup.find(\"a\", {\"class\": \"icon_difficulty\"}).text.strip()\n", " calories = self.soup.find(\"a\", {\"class\": \"icon_fire\"}).text.strip() if self.soup.find(\"a\", {\"class\": \"icon_fire\"}) else 0\n", " ingredients = self.extract_text(self.soup.find_all('div', {'class': 'item'}))\n", " amount = self.extract_amount(self.soup.find_all('div', {'class': 'part'}))\n", " ingredients = self.combine_ingredients(amount, ingredients)\n", " instructions = self.extract_instructions(self.soup.find('div', {'class': '_recipe-steps'}).find_all('div', {'class': 'step'}))\n", " tags = self.extract_text(self.soup.find_all(\"a\", {\"class\": \"tag\"}))\n", "\n", " return {\n", " 'title': re.split(r\" - | \\| | untuk | yang\", title.text, 1)[0],\n", " 'image_url': image_url,\n", " 'time': time,\n", " 'servings': servings,\n", " 'calories': calories,\n", " 'difficulty': difficulty,\n", " 'ingredients': ingredients,\n", " 'instructions': instructions,\n", " 'source_url': url,\n", " 'tags': tags,\n", " }\n" ], "metadata": { "id": "fHwU4O67H_8i" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "scraper = RecipeScraper()\n", "df = pd.DataFrame([scraper.scrape_recipe(url) for url in recipe_urls])\n", "df.drop_duplicates(subset=['title', 'source_url'], inplace=True)\n", "df.reset_index(drop=True, inplace=True)\n", "df = generate_id_by_title(df)" ], "metadata": { "id": "XFmHrgESKjOc" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df.tail()" ], "metadata": { "id": "f_vBsCl636LE" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "export_dataframe(df, 'mahi_raw', 'recipe-raw')\n", "create_zip_file('mahi_raw')" ], "metadata": { "id": "GcVWQAMDop_8", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "ea7284c8-de1b-4472-b4cb-60faed8cf0f2" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "mahi_raw.zip created successfully!\n" ] } ] }, { "cell_type": "code", "source": [ "# Change the sequence\n", "df_recipes = df[['id', 'title', 'source_url', 'image_url', 'time', 'servings', 'calories', 'difficulty', 'instructions', 'tags']]\n", "df_ingredients = df.loc[:, ['id', 'ingredients']]" ], "metadata": { "id": "5ajk5Pqj0B1X" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# df_ingredients['ingredients']" ], "metadata": { "id": "fOetUk6J1lkk" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "export_dataframe(df_recipes, 'mahi_c1', 'recipes-c1')\n", "export_dataframe(df_ingredients, 'mahi_c1', 'ingredients-c1')\n", "\n", "create_zip_file('mahi_c1')" ], "metadata": { "id": "bAeNTS20yWwX", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "d485eae8-e9f9-47c0-fbd8-4b62883dda58" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "mahi_c1.zip created successfully!\n" ] } ] }, { "cell_type": "markdown", "source": [ "# Replace Ingredients Value\n" ], "metadata": { "id": "3AiBVtamZTBq" } }, { "cell_type": "code", "source": [ "import ast\n", "\n", "# Read file\n", "df_ingredients = pd.read_csv('/content/drive/MyDrive/EzCook/June 2023/ingredients-c1.csv', sep=',')\n", "\n", "# Replace \"/\"\n", "df_ingredients['ingredients'] = df_ingredients['ingredients'].apply(lambda x: ast.literal_eval(x))\n", "df_ingredients = df_ingredients.explode('ingredients')\n", "df_ingredients['ingredients'] = df_ingredients['ingredients'].str.replace(' / ', '/')\n", "\n", "# Reset index\n", "df_ingredients = df_ingredients.reset_index()\n", "df_ingredients = df_ingredients.drop('index', axis=1)" ], "metadata": { "id": "t0rTzUNFC8j9" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Split amount and ingredients\n", "df_ingredients[\"amount\"] = df_ingredients[\"ingredients\"].str.extract(r'^(\\d+(?:\\.\\d+)?\\s?\\d*/?\\d*)')\n", "df_ingredients[\"ingredients\"] = df_ingredients[\"ingredients\"].str.replace(r'^\\d+(?:\\.\\d+)?\\s?\\d*/?\\d*\\s?', '')" ], "metadata": { "id": "5TnnYe9H06dS", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "8e0c8b16-db25-4039-9d3e-9cd66c331580" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ ":3: FutureWarning: The default value of regex will change from True to False in a future version.\n", " df_ingredients[\"ingredients\"] = df_ingredients[\"ingredients\"].str.replace(r'^\\d+(?:\\.\\d+)?\\s?\\d*/?\\d*\\s?', '')\n" ] } ] }, { "cell_type": "code", "source": [ "df_ingredients.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "id": "DQrFu-3Oy2l9", "outputId": "3d49b8e0-bfb1-44c9-9e34-c2b5a7ce4774" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount\n", "0 55496940902 g kentang ukuran besar, kupas 500 \n", "1 55496940902 sdm Royco Kaldu Jamur 1 \n", "2 55496940902 siung bawang putih, memarkan 5 \n", "3 55496940902 L air, untuk merebus 1.5 \n", "4 55496940902 Minyak, untuk menggoreng 0 " ], "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", "
idingredientsamount
055496940902g kentang ukuran besar, kupas500
155496940902sdm Royco Kaldu Jamur1
255496940902siung bawang putih, memarkan5
355496940902L air, untuk merebus1.5
455496940902Minyak, untuk menggoreng0
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 22 } ] }, { "cell_type": "code", "source": [ "df_ingredients[\"ingredients\"] = df_ingredients[\"ingredients\"].str.replace(r'\\([^)]*\\)', '')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "dQUsVNVFMjDy", "outputId": "9b84e783-6865-4d88-8fae-1ed2ffbdc631" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ ":1: FutureWarning: The default value of regex will change from True to False in a future version.\n", " df_ingredients[\"ingredients\"] = df_ingredients[\"ingredients\"].str.replace(r'\\([^)]*\\)', '')\n" ] } ] }, { "cell_type": "code", "source": [ "# export_dataframe(df_ingredients, 'mahi_ingredients', 'ingredients-c11')\n", "# create_zip_file('mahi_ingredients')" ], "metadata": { "id": "5rau1qhsjEx7" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "# Replace First Word" ], "metadata": { "id": "VEShbcVt2GuZ" } }, { "cell_type": "code", "source": [ "# df_ingredients[df_ingredients['ingredients'].str.contains('biji')]\n", "# df_ingredients[df_ingredients['ingredients'].str.split().str[0] == 'cup']\n", "\n", "df_satuan = pd.DataFrame(df_ingredients['ingredients'].str.split().str[0].drop_duplicates().values, columns=['satuan'])\n", "# satuan = df_ingredients['ingredients'].str.split().str[0].drop_duplicates().values\n", "# satuan.to_excel('satuan.xlsx', index=False)\n", "# satuan" ], "metadata": { "id": "RchH-NrTcsFi" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_satuan" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 423 }, "id": "xGcOWzg6gxTK", "outputId": "79b098ee-144d-4e0a-eb92-2fb78e2b7484" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " satuan\n", "0 g\n", "1 sdm\n", "2 siung\n", "3 L\n", "4 Minyak,\n", ".. ...\n", "302 Susu\n", "303 Merica\n", "304 telur,\n", "305 Mayones\n", "306 timun\n", "\n", "[307 rows x 1 columns]" ], "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", "
satuan
0g
1sdm
2siung
3L
4Minyak,
......
302Susu
303Merica
304telur,
305Mayones
306timun
\n", "

307 rows × 1 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 27 } ] }, { "cell_type": "code", "source": [ "code = {\n", " 'batang': 'batang',\n", " 'buah': 'buah',\n", " 'biji': 'biji',\n", " 'butir': 'butir',\n", " 'cangkir': 'cangkir',\n", " 'cc': 'cc',\n", " 'cm': 'centimeter',\n", " 'cup': 'cup',\n", " 'ekor': 'ekor',\n", " 'g': 'gram',\n", " 'gelas': 'gelas',\n", " 'ikat': 'ikat',\n", " 'kotak': 'kotak',\n", " 'L': 'liter',\n", " 'mangkok': 'mangkok',\n", " 'ml': 'mililiter',\n", " 'ons': 'ons',\n", " 'pak': 'pak',\n", " 'pack': 'pack',\n", " 'papan': 'papan',\n", " 'pasang': 'pasang',\n", " 'piring': 'piring',\n", " 'porsi': 'porsi',\n", " 'ruas': 'ruas',\n", " 'scoop': 'scoop',\n", " 'sdm': 'sendok makan',\n", " 'sdt': 'sendok teh',\n", " 'stik': 'stik',\n", " 'siung': 'siung',\n", " 'tetes': 'tetes',\n", " 'bungkus': 'bungkus',\n", " 'kg': 'kilogram',\n", " 'lembar': 'lembar',\n", " 'potong': 'potong',\n", " 'sachet': 'sachet',\n", " 'tangkai': 'tangkai',\n", "}" ], "metadata": { "id": "FP50O7dY-veb" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_unit = pd.DataFrame.from_dict(code, orient='index')\n", "df_unit = df_unit.reset_index()\n", "df_unit = df_unit.rename(columns={\"index\": \"code\", 0: \"name\"})\n", "df_unit['id'] = df_unit.index + 1\n", "df_unit = df_unit[['id', 'code', 'name']]\n", "\n", "# list_satuan.to_excel('satuan.xlsx')\n", "# list_satuan.to_csv('satuan.csv')" ], "metadata": { "id": "4m5q16v0KbOS" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "code_map = df_unit.set_index('code').T.to_dict('index')\n", "# code_map['id']" ], "metadata": { "id": "4A0d_1X6eWjZ" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients['unit_id'] = df_ingredients['ingredients'].str.split(' ').str[0].str.split(',').str[0]\n", "df_ingredients.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "id": "IUgFyvNuRKZ8", "outputId": "01c1cc31-970c-40ec-af3a-d39e041eadde" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount unit_id\n", "0 55496940902 g kentang ukuran besar, kupas 500 g\n", "1 55496940902 sdm Royco Kaldu Jamur 1 sdm\n", "2 55496940902 siung bawang putih, memarkan 5 siung\n", "3 55496940902 L air, untuk merebus 1.5 L\n", "4 55496940902 Minyak, untuk menggoreng 0 Minyak" ], "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", "
idingredientsamountunit_id
055496940902g kentang ukuran besar, kupas500g
155496940902sdm Royco Kaldu Jamur1sdm
255496940902siung bawang putih, memarkan5siung
355496940902L air, untuk merebus1.5L
455496940902Minyak, untuk menggoreng0Minyak
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 49 } ] }, { "cell_type": "code", "source": [ "df_ingredients['unit_id'] = df_ingredients['unit_id'].replace({'liter': 'L'}, regex=True)\n", "df_ingredients['unit_id'] = df_ingredients['unit_id'].replace({'gram': 'g'}, regex=True)\n", "df_ingredients['unit_id'] = df_ingredients['unit_id'].replace({'gr': 'g'}, regex=True)" ], "metadata": { "id": "5qGnFg7OE3Jq" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "id": "cuZY89C8PL8Z", "outputId": "c4cad841-d0ef-42b1-d8fc-c32f2da98ecc" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount unit_id\n", "0 55496940902 g kentang ukuran besar, kupas 500 g\n", "1 55496940902 sdm Royco Kaldu Jamur 1 sdm\n", "2 55496940902 siung bawang putih, memarkan 5 siung\n", "3 55496940902 L air, untuk merebus 1.5 L\n", "4 55496940902 Minyak, untuk menggoreng 0 Minyak" ], "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", "
idingredientsamountunit_id
055496940902g kentang ukuran besar, kupas500g
155496940902sdm Royco Kaldu Jamur1sdm
255496940902siung bawang putih, memarkan5siung
355496940902L air, untuk merebus1.5L
455496940902Minyak, untuk menggoreng0Minyak
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 51 } ] }, { "cell_type": "code", "source": [ "code_map_lower = {k.lower(): v for k, v in code_map['id'].items()}\n", "df_ingredients['unit_id'] = df_ingredients['unit_id'].astype(str).str.lower().map(code_map_lower)" ], "metadata": { "id": "Avu6yI1qUcLb" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "id": "RU7F4gekf5pb", "outputId": "fa41aef6-5f15-4e6f-b237-cfd06dfa12d7" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount unit_id\n", "0 55496940902 g kentang ukuran besar, kupas 500 10.0\n", "1 55496940902 sdm Royco Kaldu Jamur 1 26.0\n", "2 55496940902 siung bawang putih, memarkan 5 29.0\n", "3 55496940902 L air, untuk merebus 1.5 14.0\n", "4 55496940902 Minyak, untuk menggoreng 0 NaN" ], "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", "
idingredientsamountunit_id
055496940902g kentang ukuran besar, kupas50010.0
155496940902sdm Royco Kaldu Jamur126.0
255496940902siung bawang putih, memarkan529.0
355496940902L air, untuk merebus1.514.0
455496940902Minyak, untuk menggoreng0NaN
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 53 } ] }, { "cell_type": "code", "source": [ "df_unit" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "qMBx4kw6hB4L", "outputId": "724c03e7-1d2f-4ad9-ef8b-e38e35f6d1f3" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id code name\n", "0 1 batang batang\n", "1 2 buah buah\n", "2 3 biji biji\n", "3 4 butir butir\n", "4 5 cangkir cangkir\n", "5 6 cc cc\n", "6 7 cm centimeter\n", "7 8 cup cup\n", "8 9 ekor ekor\n", "9 10 g gram\n", "10 11 gelas gelas\n", "11 12 ikat ikat\n", "12 13 kotak kotak\n", "13 14 L liter\n", "14 15 mangkok mangkok\n", "15 16 ml mililiter\n", "16 17 ons ons\n", "17 18 pak pak\n", "18 19 pack pack\n", "19 20 papan papan\n", "20 21 pasang pasang\n", "21 22 piring piring\n", "22 23 porsi porsi\n", "23 24 ruas ruas\n", "24 25 scoop scoop\n", "25 26 sdm sendok makan\n", "26 27 sdt sendok teh\n", "27 28 stik stik\n", "28 29 siung siung\n", "29 30 tetes tetes\n", "30 31 bungkus bungkus\n", "31 32 kg kilogram\n", "32 33 lembar lembar\n", "33 34 potong potong\n", "34 35 sachet sachet\n", "35 36 tangkai tangkai" ], "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", "
idcodename
01batangbatang
12buahbuah
23bijibiji
34butirbutir
45cangkircangkir
56cccc
67cmcentimeter
78cupcup
89ekorekor
910ggram
1011gelasgelas
1112ikatikat
1213kotakkotak
1314Lliter
1415mangkokmangkok
1516mlmililiter
1617onsons
1718pakpak
1819packpack
1920papanpapan
2021pasangpasang
2122piringpiring
2223porsiporsi
2324ruasruas
2425scoopscoop
2526sdmsendok makan
2627sdtsendok teh
2728stikstik
2829siungsiung
2930tetestetes
3031bungkusbungkus
3132kgkilogram
3233lembarlembar
3334potongpotong
3435sachetsachet
3536tangkaitangkai
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 54 } ] }, { "cell_type": "code", "source": [ "export_dataframe(df_ingredients, 'mahi_c2', 'ingredients-c2')\n", "export_dataframe(df_unit, 'mahi_c2', 'satuan-c2')\n", "\n", "create_zip_file('mahi_c2')" ], "metadata": { "id": "mt6nhoQ0ifhu", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "23599649-3b65-476a-a000-67abf6e1e585" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "mahi_c2.zip created successfully!\n" ] } ] }, { "cell_type": "markdown", "source": [ "# Drop Unit Name on First Word + Get State" ], "metadata": { "id": "GZPICN2u72lW" } }, { "cell_type": "code", "source": [ "# Mount Google Drive\n", "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "dGWEnYO573cy", "outputId": "1e64940e-fe3f-4c88-9d8f-75045a793c40" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n" ] } ] }, { "cell_type": "code", "source": [ "import pandas as pd\n", "import numpy as np" ], "metadata": { "id": "FcLWylT478h2" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Read file\n", "# df_ingredients = pd.read_csv('/content/drive/MyDrive/EzCook/May 2023/ingredients-c2.csv', sep=',')\n", "# df_unit = pd.read_csv('/content/drive/MyDrive/EzCook/satuan_c3.csv', sep=',')" ], "metadata": { "id": "BR69oLx579Bb" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# if unit id is not null, delete first word\n", "df_ingredients['ingredients'] = np.where(df_ingredients['unit_id'].notna(), df_ingredients['ingredients'].str.split(n=1).str[1], df_ingredients['ingredients'])" ], "metadata": { "id": "pBBQjwvn8e7a" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients['state'] = df_ingredients['ingredients'].str.split(',', n=1).str[1]\n", "df_ingredients['ingredients'] = df_ingredients['ingredients'].str.split(',', n=1).str[0]" ], "metadata": { "id": "_rySVhMq-MIY" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# df_ingredients.head(100)\n", "df_ingredients[df_ingredients['ingredients'].str.contains('\\u2019')]" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "ezUWYPTT-pTL", "outputId": "630d368d-c861-4cee-9076-adb97c30459a" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount \\\n", "152 11817808076 Hellmann’s Real Mayonnaise 0 \n", "197 91398292597 Hellmann’s Real Mayonnaise 3 \n", "1084 45168210867 Hellmann’s Real Mayonnaise 4 \n", "1169 86212210256 Hellmann’s Real Mayonnaise 5 \n", "1834 55385763087 Hellmann’s Real Mayonnaise 5 \n", "2209 75802958080 Hellmann’s Real Mayonnaise 150 \n", "2974 77774305212 Hellmann’s Real Mayonnaise 4 \n", "3155 30787072082 Hellmann’s Real Mayonnaise 10 \n", "3662 17939171727 Hellmann’s Real Mayonnaise 6 \n", "3672 90272773374 Wall’s Classic Vanilla Ice Cream 0 \n", "3766 77494090168 Wall’s Chocolate & Vanilla Chocolate Chip 6 \n", "6065 14326277867 Hellmann’s Real Mayonnaise 8 \n", "6470 99356543707 Hellmann’s Real Mayonnaise 100 \n", "7108 74146229513 Hellmann’s Real Mayonnaise 0 \n", "7574 97812594148 Hellmann’s Real Mayonnaise 4 \n", "7591 31892560731 Wall’s Neopolitana Ice Cream 2 \n", "7954 48980956913 Wall’s Choco Nutty Crunch 1 \n", "7958 47010691709 Wall’s Oreo Cookies & Cream Chocolate 1 \n", "7965 73372921412 Wall’s Classic Vanilla Ice Cream 1 \n", "7969 25478379723 Wall’s Oreo Cookies & Cream Chocolate 50 \n", "7973 25478379723 Wall’s Oreo Cookies & Cream Chocolate 0 \n", "7976 71847371283 Wall’s Classic Vanilla Ice Cream 3 \n", "7977 71847371283 secukupnya Wall’s Classic Vanilla Ice Cream 0 \n", "7983 38697064040 Wall’s Neopolitana Ice Cream 2 \n", "8166 17513523975 Hellmann’s Real Mayonnaise 0 \n", "8222 40285267713 Hellmann’s Real Mayonnaise 250 \n", "8388 36484660339 pint kecil Wall’s Black Forest Cake 1 \n", "8391 35932723760 Wall’s Strawberry Cheesecake Ice Cream 4 \n", "8405 63651086598 Wall’s Chocolate & Vanilla Chocolate Chip 2 2 \n", "8406 56403941042 Wall’s Chocolate & Vanilla Chocolate Chip 2 \n", "8783 10891467559 Wall’s Avocado Choco & Mocha Ice Cream 0 \n", "8786 19963291667 Wall’s Neopolitana Ice Cream 3 \n", "8793 84260007179 Wall’s Oreo Cookies & Cream Vanilla 2 \n", "8797 43734217304 Wall’s Strawberry Cheesecake Ice Cream 2 \n", "8803 25870770751 Wall’s Chocolate Deluxe Ice Cream 3 \n", "8816 52090688195 Wall’s Solero Trio Ice Cream 3 \n", "9544 41948787362 Hellmann’s Real Mayonnaise 200 \n", "9661 42335288819 Hellmann’s Real Mayonnaise 5 \n", "9733 45317624667 Hellmann’s Real Mayonnaise 0 \n", "10173 95640120710 Hellmann’s Real Mayonnaise 100 \n", "10408 88680760468 Hellmann’s Real Mayonnaise 150 \n", "10452 82379358987 Hellmann’s Real Mayonnaise 2 \n", "10778 44367984547 Wall’s Es Dung Dung Kacang Hijau 4 \n", "11091 15031721909 Wall’s Es Dung Dung Kacang Merah 400 \n", "11847 28683873513 Wall’s Strawberry Cheesecake Ice Cream 2 \n", "11865 64601005949 Wall’s Solero Trio Ice Cream 1 \n", "12448 44336052869 Hellmann’s Real Mayonnaise 5 \n", "14597 81964244958 Hellmann’s Real Mayonnaise 3 \n", "\n", " unit_id state \n", "152 NaN NaN \n", "197 26.0 NaN \n", "1084 26.0 NaN \n", "1169 26.0 NaN \n", "1834 26.0 NaN \n", "2209 10.0 NaN \n", "2974 26.0 NaN \n", "3155 26.0 NaN \n", "3662 26.0 NaN \n", "3672 NaN NaN \n", "3766 25.0 NaN \n", "6065 26.0 NaN \n", "6470 10.0 NaN \n", "7108 NaN NaN \n", "7574 26.0 NaN \n", "7591 25.0 NaN \n", "7954 19.0 NaN \n", "7958 19.0 NaN \n", "7965 25.0 NaN \n", "7969 10.0 NaN \n", "7973 NaN NaN \n", "7976 25.0 NaN \n", "7977 NaN NaN \n", "7983 25.0 NaN \n", "8166 NaN NaN \n", "8222 16.0 NaN \n", "8388 NaN NaN \n", "8391 25.0 NaN \n", "8405 25.0 NaN \n", "8406 25.0 NaN \n", "8783 NaN NaN \n", "8786 25.0 NaN \n", "8793 25.0 NaN \n", "8797 25.0 NaN \n", "8803 25.0 NaN \n", "8816 25.0 NaN \n", "9544 10.0 NaN \n", "9661 26.0 NaN \n", "9733 NaN NaN \n", "10173 10.0 NaN \n", "10408 10.0 NaN \n", "10452 26.0 NaN \n", "10778 2.0 NaN \n", "11091 16.0 NaN \n", "11847 25.0 NaN \n", "11865 25.0 NaN \n", "12448 26.0 NaN \n", "14597 26.0 NaN " ], "text/html": [ "\n", "
\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idingredientsamountunit_idstate
15211817808076Hellmann’s Real Mayonnaise0NaNNaN
19791398292597Hellmann’s Real Mayonnaise326.0NaN
108445168210867Hellmann’s Real Mayonnaise426.0NaN
116986212210256Hellmann’s Real Mayonnaise526.0NaN
183455385763087Hellmann’s Real Mayonnaise526.0NaN
220975802958080Hellmann’s Real Mayonnaise15010.0NaN
297477774305212Hellmann’s Real Mayonnaise426.0NaN
315530787072082Hellmann’s Real Mayonnaise1026.0NaN
366217939171727Hellmann’s Real Mayonnaise626.0NaN
367290272773374Wall’s Classic Vanilla Ice Cream0NaNNaN
376677494090168Wall’s Chocolate & Vanilla Chocolate Chip625.0NaN
606514326277867Hellmann’s Real Mayonnaise826.0NaN
647099356543707Hellmann’s Real Mayonnaise10010.0NaN
710874146229513Hellmann’s Real Mayonnaise0NaNNaN
757497812594148Hellmann’s Real Mayonnaise426.0NaN
759131892560731Wall’s Neopolitana Ice Cream225.0NaN
795448980956913Wall’s Choco Nutty Crunch119.0NaN
795847010691709Wall’s Oreo Cookies & Cream Chocolate119.0NaN
796573372921412Wall’s Classic Vanilla Ice Cream125.0NaN
796925478379723Wall’s Oreo Cookies & Cream Chocolate5010.0NaN
797325478379723Wall’s Oreo Cookies & Cream Chocolate0NaNNaN
797671847371283Wall’s Classic Vanilla Ice Cream325.0NaN
797771847371283secukupnya Wall’s Classic Vanilla Ice Cream0NaNNaN
798338697064040Wall’s Neopolitana Ice Cream225.0NaN
816617513523975Hellmann’s Real Mayonnaise0NaNNaN
822240285267713Hellmann’s Real Mayonnaise25016.0NaN
838836484660339pint kecil Wall’s Black Forest Cake1NaNNaN
839135932723760Wall’s Strawberry Cheesecake Ice Cream425.0NaN
840563651086598Wall’s Chocolate & Vanilla Chocolate Chip2 225.0NaN
840656403941042Wall’s Chocolate & Vanilla Chocolate Chip225.0NaN
878310891467559Wall’s Avocado Choco & Mocha Ice Cream0NaNNaN
878619963291667Wall’s Neopolitana Ice Cream325.0NaN
879384260007179Wall’s Oreo Cookies & Cream Vanilla225.0NaN
879743734217304Wall’s Strawberry Cheesecake Ice Cream225.0NaN
880325870770751Wall’s Chocolate Deluxe Ice Cream325.0NaN
881652090688195Wall’s Solero Trio Ice Cream325.0NaN
954441948787362Hellmann’s Real Mayonnaise20010.0NaN
966142335288819Hellmann’s Real Mayonnaise526.0NaN
973345317624667Hellmann’s Real Mayonnaise0NaNNaN
1017395640120710Hellmann’s Real Mayonnaise10010.0NaN
1040888680760468Hellmann’s Real Mayonnaise15010.0NaN
1045282379358987Hellmann’s Real Mayonnaise226.0NaN
1077844367984547Wall’s Es Dung Dung Kacang Hijau42.0NaN
1109115031721909Wall’s Es Dung Dung Kacang Merah40016.0NaN
1184728683873513Wall’s Strawberry Cheesecake Ice Cream225.0NaN
1186564601005949Wall’s Solero Trio Ice Cream125.0NaN
1244844336052869Hellmann’s Real Mayonnaise526.0NaN
1459781964244958Hellmann’s Real Mayonnaise326.0NaN
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 72 } ] }, { "cell_type": "code", "source": [ "df_ingredients[df_ingredients['ingredients'].isnull()]" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 143 }, "id": "0c9cub3DN8Bs", "outputId": "410ca10c-3037-4858-a23e-7129724933d5" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount unit_id state\n", "7448 70143063780 NaN 200 16.0 NaN\n", "12224 61286500969 NaN 1 27.0 NaN\n", "22466 63526196777 NaN 3 26.0 NaN" ], "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", "
idingredientsamountunit_idstate
744870143063780NaN20016.0NaN
1222461286500969NaN127.0NaN
2246663526196777NaN326.0NaN
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 66 } ] }, { "cell_type": "code", "source": [ "df_ingredients = df_ingredients.drop([7448, 12224, 22466])" ], "metadata": { "id": "cSB4nFmrNoj6" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "export_dataframe(df_ingredients, 'mahi_c3', 'ingredients-c3')\n", "\n", "create_zip_file('mahi_c3')" ], "metadata": { "id": "R_naIg0w-wtE", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "10d43db8-cb35-4242-c3e9-108918d7dfcf" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "mahi_c3.zip created successfully!\n" ] } ] }, { "cell_type": "markdown", "source": [ "# Checkpoint 4\n", "Buat cari nama bahan aja" ], "metadata": { "id": "11A2UDAQaQJP" } }, { "cell_type": "markdown", "source": [ "# Replace Fraction" ], "metadata": { "id": "brOafK8PS_ne" } }, { "cell_type": "code", "source": [ "# Mount Google Drive\n", "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "id": "ia9nGD9dQy9B", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "da4a7848-1685-46c9-99c7-2f5c8d894727" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n" ] } ] }, { "cell_type": "code", "source": [ "import pandas as pd\n", "import numpy as np" ], "metadata": { "id": "wmXGIfmoTCY2" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Read file\n", "df_ingredients = pd.read_csv('/content/drive/MyDrive/EzCook/ingredients-c3.csv', sep=',')\n", "df_ingredients" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 424 }, "id": "U6JSTwIPTC93", "outputId": "c2a1d5cf-cd1f-46df-8147-ca4f648a5b11" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount unit_id \\\n", "0 19667128120 Daun pisang NaN NaN \n", "1 19667128120 Minyak NaN NaN \n", "2 19667128120 Tepung ketan NaN NaN \n", "3 19667128120 tepung ketan 300 9.0 \n", "4 19667128120 Buavita Guava 200 13.0 \n", "... ... ... ... ... \n", "21035 69526158105 garam ½ 20.0 \n", "21036 69526158105 minyak sayur 1 19.0 \n", "21037 69526158105 daun bawang 1 1.0 \n", "21038 69526158105 seledri 1 1.0 \n", "21039 69526158105 bawang merah goreng NaN NaN \n", "\n", " state \n", "0 gunting mengikuti ukuran cetakan kue ku \n", "1 untuk olesan \n", "2 untuk taburan \n", "3 NaN \n", "4 NaN \n", "... ... \n", "21035 NaN \n", "21036 NaN \n", "21037 iris tipis \n", "21038 iris tipis \n", "21039 NaN \n", "\n", "[21040 rows x 5 columns]" ], "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", "
idingredientsamountunit_idstate
019667128120Daun pisangNaNNaNgunting mengikuti ukuran cetakan kue ku
119667128120MinyakNaNNaNuntuk olesan
219667128120Tepung ketanNaNNaNuntuk taburan
319667128120tepung ketan3009.0NaN
419667128120Buavita Guava20013.0NaN
..................
2103569526158105garam½20.0NaN
2103669526158105minyak sayur119.0NaN
2103769526158105daun bawang11.0iris tipis
2103869526158105seledri11.0iris tipis
2103969526158105bawang merah gorengNaNNaNNaN
\n", "

21040 rows × 5 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 138 } ] }, { "cell_type": "code", "source": [ "df_ingredients['amount'][df_ingredients['amount'].isin([\"½\"])] = 0.5\n", "df_ingredients['amount'][df_ingredients['amount'].isin([\"⅓\"])] = 0.33\n", "df_ingredients['amount'][df_ingredients['amount'].isin([\"¼\"])] = 0.25\n", "df_ingredients['amount'][df_ingredients['amount'].isin([\"⅛\"])] = 0.125\n", "df_ingredients['amount'][df_ingredients['amount'].isin([\"¾\"])] = 0.75" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "QgHf-e6PTGed", "outputId": "726aa271-be91-4016-9731-d220e8de5317" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " \"\"\"Entry point for launching an IPython kernel.\n", "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " \n", "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:3: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " This is separate from the ipykernel package so we can avoid doing imports until\n", "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:4: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " after removing the cwd from sys.path.\n", "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:5: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " \"\"\"\n" ] } ] }, { "cell_type": "code", "source": [ "df_ingredients" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 424 }, "id": "UMyFgRd2TyDl", "outputId": "5ae969cb-e523-46ca-d260-81b2d5d1078a" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id ingredients amount unit_id \\\n", "0 19667128120 Daun pisang NaN NaN \n", "1 19667128120 Minyak NaN NaN \n", "2 19667128120 Tepung ketan NaN NaN \n", "3 19667128120 tepung ketan 300 9.0 \n", "4 19667128120 Buavita Guava 200 13.0 \n", "... ... ... ... ... \n", "21035 69526158105 garam 0.5 20.0 \n", "21036 69526158105 minyak sayur 1 19.0 \n", "21037 69526158105 daun bawang 1 1.0 \n", "21038 69526158105 seledri 1 1.0 \n", "21039 69526158105 bawang merah goreng NaN NaN \n", "\n", " state \n", "0 gunting mengikuti ukuran cetakan kue ku \n", "1 untuk olesan \n", "2 untuk taburan \n", "3 NaN \n", "4 NaN \n", "... ... \n", "21035 NaN \n", "21036 NaN \n", "21037 iris tipis \n", "21038 iris tipis \n", "21039 NaN \n", "\n", "[21040 rows x 5 columns]" ], "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", "
idingredientsamountunit_idstate
019667128120Daun pisangNaNNaNgunting mengikuti ukuran cetakan kue ku
119667128120MinyakNaNNaNuntuk olesan
219667128120Tepung ketanNaNNaNuntuk taburan
319667128120tepung ketan3009.0NaN
419667128120Buavita Guava20013.0NaN
..................
2103569526158105garam0.520.0NaN
2103669526158105minyak sayur119.0NaN
2103769526158105daun bawang11.0iris tipis
2103869526158105seledri11.0iris tipis
2103969526158105bawang merah gorengNaNNaNNaN
\n", "

21040 rows × 5 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 140 } ] }, { "cell_type": "code", "source": [ "save_file(df_ingredients, 'ingredients-c4')" ], "metadata": { "id": "n4o8JfReUkOs" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "id": "u7fUVLKMV4ek" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "# Splitting Judul" ], "metadata": { "id": "JMlZwt2YZkf9" } }, { "cell_type": "code", "source": [ "# Mount Google Drive\n", "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "8EGW9YvBZkIx", "outputId": "30e8be47-70b1-4101-ff28-cbb73acb6ee8" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n" ] } ] }, { "cell_type": "code", "source": [ "import pandas as pd\n", "import numpy as np" ], "metadata": { "id": "0EM_MGYgZ5Tq" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Read file\n", "df_recipes = pd.read_csv('/content/drive/MyDrive/EzCook/June 2023/recipes-c1.csv', sep=',')\n", "df_recipes.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 756 }, "id": "5bnQHzhNZ6N-", "outputId": "e1ff5546-c7d8-4ac5-8f1d-5b3fbc320235" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id title \\\n", "0 55496940902 Cara Membuat Kentang Goreng Renyah Tahan Lama \n", "1 16996267501 Resep Rendang Ayam \n", "2 44391341104 Resep Nastar Lembut Anti Gagal \n", "3 22338165911 Resep Putri Salju Kacang Mede \n", "4 33862184532 Resep Es Cincau Gula Aren Segar dan Kaya Serat \n", "\n", " source_url \\\n", "0 https://www.masakapahariini.com/resep/cara-mem... \n", "1 https://www.masakapahariini.com/resep/resep-ay... \n", "2 https://www.masakapahariini.com/resep/resep-na... \n", "3 https://www.masakapahariini.com/resep/resep-pu... \n", "4 https://www.masakapahariini.com/resep/resep-es... \n", "\n", " image_url time servings \\\n", "0 https://www.masakapahariini.com/wp-content/upl... 1j 30mnt 4 \n", "1 https://www.masakapahariini.com/wp-content/upl... 2jam 6 \n", "2 https://www.masakapahariini.com/wp-content/upl... 2jam 8 \n", "3 https://www.masakapahariini.com/wp-content/upl... 1j 30mnt 8 \n", "4 https://www.masakapahariini.com/wp-content/upl... 30mnt 4 \n", "\n", " calories difficulty instructions \\\n", "0 0 Cukup Rumit ['Potong kentang memanjang seperti ukuran kent... \n", "1 557Kkal Cukup Rumit ['Tumis bumbu halus hingga harum. Tambahkan ai... \n", "2 0 Cukup Rumit ['Selai nanas: Masak nanas parut, kayu manis, ... \n", "3 0 Cukup Rumit ['Panaskan oven pada suhu 150° C.', 'Kocok men... \n", "4 0 Mudah ['Seduh SariWangi Teh Asli bersama air panas d... \n", "\n", " tags \n", "0 ['Tidak Pedas', 'Low', 'Goreng', 'Gurih', 'Kom... \n", "1 ['Tumis', 'Ayam', 'Kurang dari 5 bahan', 'Medi... \n", "2 ['Manis', 'Tidak Pedas', 'Low', 'Asam', 'Idul ... \n", "3 ['Cukup Rumit', 'Panggang'] \n", "4 ['Minuman', 'Low', 'Manis', 'Appetizer', 'Prak... " ], "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", "
idtitlesource_urlimage_urltimeservingscaloriesdifficultyinstructionstags
055496940902Cara Membuat Kentang Goreng Renyah Tahan Lamahttps://www.masakapahariini.com/resep/cara-mem...https://www.masakapahariini.com/wp-content/upl...1j 30mnt40Cukup Rumit['Potong kentang memanjang seperti ukuran kent...['Tidak Pedas', 'Low', 'Goreng', 'Gurih', 'Kom...
116996267501Resep Rendang Ayamhttps://www.masakapahariini.com/resep/resep-ay...https://www.masakapahariini.com/wp-content/upl...2jam6557KkalCukup Rumit['Tumis bumbu halus hingga harum. Tambahkan ai...['Tumis', 'Ayam', 'Kurang dari 5 bahan', 'Medi...
244391341104Resep Nastar Lembut Anti Gagalhttps://www.masakapahariini.com/resep/resep-na...https://www.masakapahariini.com/wp-content/upl...2jam80Cukup Rumit['Selai nanas: Masak nanas parut, kayu manis, ...['Manis', 'Tidak Pedas', 'Low', 'Asam', 'Idul ...
322338165911Resep Putri Salju Kacang Medehttps://www.masakapahariini.com/resep/resep-pu...https://www.masakapahariini.com/wp-content/upl...1j 30mnt80Cukup Rumit['Panaskan oven pada suhu 150° C.', 'Kocok men...['Cukup Rumit', 'Panggang']
433862184532Resep Es Cincau Gula Aren Segar dan Kaya Serathttps://www.masakapahariini.com/resep/resep-es...https://www.masakapahariini.com/wp-content/upl...30mnt40Mudah['Seduh SariWangi Teh Asli bersama air panas d...['Minuman', 'Low', 'Manis', 'Appetizer', 'Prak...
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 108 } ] }, { "cell_type": "code", "source": [ "df_recipes['title'] = df_recipes['title'].str.split(',', n=1).str[0]\n", "df_recipes['title'] = df_recipes['title'].str.split('yang', n=1).str[0]" ], "metadata": { "id": "-qx_C2BhaJ0k" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes['title'][df_recipes['title'].str.contains(\"Resep\")] = df_recipes['title'].str.split('Resep', n=1).str[1]\n", "df_recipes['title'][df_recipes['title'].str.contains(\"Cara Memasak\")] = df_recipes['title'].str.split('Cara Memasak', n=1).str[1]\n", "df_recipes['title'][df_recipes['title'].str.contains(\"Cara Masak\")] = df_recipes['title'].str.split('Cara Masak', n=1).str[1]\n", "df_recipes['title'][df_recipes['title'].str.contains(\"Cara Membuat\")] = df_recipes['title'].str.split('Membuat', n=1).str[1]" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "XIvn9j-HjFX5", "outputId": "fbf174bc-bb6e-4cf9-de8a-beaacdb26eb9" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['title'][df_recipes['title'].str.contains(\"Resep\")] = df_recipes['title'].str.split('Resep', n=1).str[1]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['title'][df_recipes['title'].str.contains(\"Cara Memasak\")] = df_recipes['title'].str.split('Cara Memasak', n=1).str[1]\n", ":3: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['title'][df_recipes['title'].str.contains(\"Cara Masak\")] = df_recipes['title'].str.split('Cara Masak', n=1).str[1]\n", ":4: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['title'][df_recipes['title'].str.contains(\"Cara Membuat\")] = df_recipes['title'].str.split('Membuat', n=1).str[1]\n" ] } ] }, { "cell_type": "code", "source": [ "df_recipes['calories'] = df_recipes['calories'].str.split('Kkal', n=1).str[0]" ], "metadata": { "id": "kqbGEt4Yd4tc" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes.at[308, 'time'] = '1jam'\n", "df_recipes.at[961, 'time'] = '1jam'\n", "df_recipes.at[1414, 'time'] = '30mnt'\n", "df_recipes.at[1427, 'time'] = '30mnt'\n", "df_recipes.at[1531, 'time'] = '1jam'" ], "metadata": { "id": "J1NVQZgYe8qA" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes['time'] = df_recipes['time'].str.split('mnt', n=1).str[0]" ], "metadata": { "id": "BEAqQfpFeNAt" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes['jam'] = 0" ], "metadata": { "id": "DRCAB0o9eiBh" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes['jam'][df_recipes['time'].str.contains(\"jam|j\")] = df_recipes['time'].str.split('jam|j', n=1).str[0]" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "AisFgV-3ffVE", "outputId": "646584ed-adf7-48c8-eb81-6a97a677c89b" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['jam'][df_recipes['time'].str.contains(\"jam|j\")] = df_recipes['time'].str.split('jam|j', n=1).str[0]\n" ] } ] }, { "cell_type": "code", "source": [ "df_recipes['time'][df_recipes['time'].str.contains(\"jam|j\")] = df_recipes['time'].str.split('jam|j', n=1).str[1]\n", "df_recipes['time'][df_recipes[\"time\"] == ''] = 0" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "GGLzXH5ehR2l", "outputId": "671c3df8-ae90-4c71-ae94-b24bf55b6562" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['time'][df_recipes['time'].str.contains(\"jam|j\")] = df_recipes['time'].str.split('jam|j', n=1).str[1]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['time'][df_recipes[\"time\"] == ''] = 0\n" ] } ] }, { "cell_type": "code", "source": [ "df_recipes.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 704 }, "id": "y43OEOHlIYWp", "outputId": "ee7ead2c-c327-4c66-f6d0-e39f3aa7357e" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id title \\\n", "0 55496940902 Kentang Goreng Renyah Tahan Lama \n", "1 16996267501 Rendang Ayam \n", "2 44391341104 Nastar Lembut Anti Gagal \n", "3 22338165911 Putri Salju Kacang Mede \n", "4 33862184532 Es Cincau Gula Aren Segar dan Kaya Serat \n", "\n", " source_url \\\n", "0 https://www.masakapahariini.com/resep/cara-mem... \n", "1 https://www.masakapahariini.com/resep/resep-ay... \n", "2 https://www.masakapahariini.com/resep/resep-na... \n", "3 https://www.masakapahariini.com/resep/resep-pu... \n", "4 https://www.masakapahariini.com/resep/resep-es... \n", "\n", " image_url time servings calories \\\n", "0 https://www.masakapahariini.com/wp-content/upl... 30 4 0 \n", "1 https://www.masakapahariini.com/wp-content/upl... 0 6 557 \n", "2 https://www.masakapahariini.com/wp-content/upl... 0 8 0 \n", "3 https://www.masakapahariini.com/wp-content/upl... 30 8 0 \n", "4 https://www.masakapahariini.com/wp-content/upl... 30 4 0 \n", "\n", " difficulty instructions \\\n", "0 Cukup Rumit ['Potong kentang memanjang seperti ukuran kent... \n", "1 Cukup Rumit ['Tumis bumbu halus hingga harum. Tambahkan ai... \n", "2 Cukup Rumit ['Selai nanas: Masak nanas parut, kayu manis, ... \n", "3 Cukup Rumit ['Panaskan oven pada suhu 150° C.', 'Kocok men... \n", "4 Mudah ['Seduh SariWangi Teh Asli bersama air panas d... \n", "\n", " tags jam \n", "0 ['Tidak Pedas', 'Low', 'Goreng', 'Gurih', 'Kom... 1 \n", "1 ['Tumis', 'Ayam', 'Kurang dari 5 bahan', 'Medi... 2 \n", "2 ['Manis', 'Tidak Pedas', 'Low', 'Asam', 'Idul ... 2 \n", "3 ['Cukup Rumit', 'Panggang'] 1 \n", "4 ['Minuman', 'Low', 'Manis', 'Appetizer', 'Prak... 0 " ], "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", "
idtitlesource_urlimage_urltimeservingscaloriesdifficultyinstructionstagsjam
055496940902Kentang Goreng Renyah Tahan Lamahttps://www.masakapahariini.com/resep/cara-mem...https://www.masakapahariini.com/wp-content/upl...3040Cukup Rumit['Potong kentang memanjang seperti ukuran kent...['Tidak Pedas', 'Low', 'Goreng', 'Gurih', 'Kom...1
116996267501Rendang Ayamhttps://www.masakapahariini.com/resep/resep-ay...https://www.masakapahariini.com/wp-content/upl...06557Cukup Rumit['Tumis bumbu halus hingga harum. Tambahkan ai...['Tumis', 'Ayam', 'Kurang dari 5 bahan', 'Medi...2
244391341104Nastar Lembut Anti Gagalhttps://www.masakapahariini.com/resep/resep-na...https://www.masakapahariini.com/wp-content/upl...080Cukup Rumit['Selai nanas: Masak nanas parut, kayu manis, ...['Manis', 'Tidak Pedas', 'Low', 'Asam', 'Idul ...2
322338165911Putri Salju Kacang Medehttps://www.masakapahariini.com/resep/resep-pu...https://www.masakapahariini.com/wp-content/upl...3080Cukup Rumit['Panaskan oven pada suhu 150° C.', 'Kocok men...['Cukup Rumit', 'Panggang']1
433862184532Es Cincau Gula Aren Segar dan Kaya Serathttps://www.masakapahariini.com/resep/resep-es...https://www.masakapahariini.com/wp-content/upl...3040Mudah['Seduh SariWangi Teh Asli bersama air panas d...['Minuman', 'Low', 'Manis', 'Appetizer', 'Prak...0
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 117 } ] }, { "cell_type": "code", "source": [ "df_recipes['time'] = df_recipes['time'].astype(\"int32\") + (df_recipes['jam'].astype(\"int32\") * 60)" ], "metadata": { "id": "4KkoZe73h5mo" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes['image_url'].loc[df_recipes['image_url'] == \"-\"] = 'default.jpg'" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ABUVcMhWe6sQ", "outputId": "908e330c-0ac2-4ad3-a965-c0901d511845" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_recipes['image_url'].loc[df_recipes['image_url'] == \"-\"] = 'default.jpg'\n" ] } ] }, { "cell_type": "code", "source": [ "# df_recipes['img_url'].loc[df_recipes['img_url'] == \"-\"] = 'default.jpg'" ], "metadata": { "id": "D0DjUuf1fP8P" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "!pip install python-slugify" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "FVO7YPt3faxF", "outputId": "7187bd21-339d-436b-a091-109e74d8977e" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", "Requirement already satisfied: python-slugify in /usr/local/lib/python3.10/dist-packages (8.0.1)\n", "Requirement already satisfied: text-unidecode>=1.3 in /usr/local/lib/python3.10/dist-packages (from python-slugify) (1.3)\n" ] } ] }, { "cell_type": "code", "source": [ "from slugify import slugify\n", "df_recipes['slug'] = df_recipes['title'].apply(lambda x :slugify(x))" ], "metadata": { "id": "UgF3ehzXfdap" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "R1H29-HLdrDT", "outputId": "ce3d0838-588f-4703-aeb4-29a70e0aaab6" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id title \\\n", "0 55496940902 Kentang Goreng Renyah Tahan Lama \n", "1 16996267501 Rendang Ayam \n", "2 44391341104 Nastar Lembut Anti Gagal \n", "3 22338165911 Putri Salju Kacang Mede \n", "4 33862184532 Es Cincau Gula Aren Segar dan Kaya Serat \n", "... ... ... \n", "1587 25620239892 Oseng-oseng Buncis \n", "1588 56963177846 Bakwan Sayur Renyah Tahan Lama \n", "1589 26253073220 Ayam Bakar Bumbu Rujak \n", "1590 85439463789 Martabak Mie Telur Kornet \n", "1591 98956365905 Bubur Ayam Hainan Menyehatkan \n", "\n", " source_url \\\n", "0 https://www.masakapahariini.com/resep/cara-mem... \n", "1 https://www.masakapahariini.com/resep/resep-ay... \n", "2 https://www.masakapahariini.com/resep/resep-na... \n", "3 https://www.masakapahariini.com/resep/resep-pu... \n", "4 https://www.masakapahariini.com/resep/resep-es... \n", "... ... \n", "1587 https://www.masakapahariini.com/resep/resep-os... \n", "1588 https://www.masakapahariini.com/resep/resep-ba... \n", "1589 https://www.masakapahariini.com/resep/resep-ay... \n", "1590 https://www.masakapahariini.com/resep/resep-ma... \n", "1591 https://www.masakapahariini.com/resep/resep-bu... \n", "\n", " image_url time servings \\\n", "0 https://www.masakapahariini.com/wp-content/upl... 90 4 \n", "1 https://www.masakapahariini.com/wp-content/upl... 120 6 \n", "2 https://www.masakapahariini.com/wp-content/upl... 120 8 \n", "3 https://www.masakapahariini.com/wp-content/upl... 90 8 \n", "4 https://www.masakapahariini.com/wp-content/upl... 30 4 \n", "... ... ... ... \n", "1587 https://www.masakapahariini.com/wp-content/upl... 25 2 \n", "1588 https://www.masakapahariini.com/wp-content/upl... 45 4 \n", "1589 https://www.masakapahariini.com/wp-content/upl... 75 4 \n", "1590 https://www.masakapahariini.com/wp-content/upl... 25 4 \n", "1591 https://www.masakapahariini.com/wp-content/upl... 45 4 \n", "\n", " calories difficulty instructions \\\n", "0 0 Cukup Rumit ['Potong kentang memanjang seperti ukuran kent... \n", "1 557 Cukup Rumit ['Tumis bumbu halus hingga harum. Tambahkan ai... \n", "2 0 Cukup Rumit ['Selai nanas: Masak nanas parut, kayu manis, ... \n", "3 0 Cukup Rumit ['Panaskan oven pada suhu 150° C.', 'Kocok men... \n", "4 0 Mudah ['Seduh SariWangi Teh Asli bersama air panas d... \n", "... ... ... ... \n", "1587 334 Mudah ['Panaskan wajan dan minyak. Tumis bawang puti... \n", "1588 0 Mudah ['Di dalam wadah: aduk tepung terigu, Royco Ka... \n", "1589 0 Mudah ['Bumbui ayam dengan sedikit garam, lalu pangg... \n", "1590 139 Mudah ['Campurkan Royco Kaldu Sapi, telur, mie, korn... \n", "1591 212 Mudah ['Panaskan minyak, tumis bawang putih dan jahe... \n", "\n", " tags jam \\\n", "0 ['Tidak Pedas', 'Low', 'Goreng', 'Gurih', 'Kom... 1 \n", "1 ['Tumis', 'Ayam', 'Kurang dari 5 bahan', 'Medi... 2 \n", "2 ['Manis', 'Tidak Pedas', 'Low', 'Asam', 'Idul ... 2 \n", "3 ['Cukup Rumit', 'Panggang'] 1 \n", "4 ['Minuman', 'Low', 'Manis', 'Appetizer', 'Prak... 0 \n", "... ... .. \n", "1587 ['Tumis', 'Manis', 'Tidak Pedas', 'Sedikit Ped... 0 \n", "1588 ['Tidak Pedas', 'Goreng', 'Gurih', 'Kompor', '... 0 \n", "1589 ['Ayam', 'Manis', 'Cukup Rumit', 'Gurih', 'Sed... 1 \n", "1590 ['Tidak Pedas', 'Goreng', 'Gurih', 'Sahur', 'K... 0 \n", "1591 ['Ayam', 'Tidak Pedas', 'Rebus', 'Kompor', 'Se... 0 \n", "\n", " slug \n", "0 kentang-goreng-renyah-tahan-lama \n", "1 rendang-ayam \n", "2 nastar-lembut-anti-gagal \n", "3 putri-salju-kacang-mede \n", "4 es-cincau-gula-aren-segar-dan-kaya-serat \n", "... ... \n", "1587 oseng-oseng-buncis \n", "1588 bakwan-sayur-renyah-tahan-lama \n", "1589 ayam-bakar-bumbu-rujak \n", "1590 martabak-mie-telur-kornet \n", "1591 bubur-ayam-hainan-menyehatkan \n", "\n", "[1592 rows x 12 columns]" ], "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", "
idtitlesource_urlimage_urltimeservingscaloriesdifficultyinstructionstagsjamslug
055496940902Kentang Goreng Renyah Tahan Lamahttps://www.masakapahariini.com/resep/cara-mem...https://www.masakapahariini.com/wp-content/upl...9040Cukup Rumit['Potong kentang memanjang seperti ukuran kent...['Tidak Pedas', 'Low', 'Goreng', 'Gurih', 'Kom...1kentang-goreng-renyah-tahan-lama
116996267501Rendang Ayamhttps://www.masakapahariini.com/resep/resep-ay...https://www.masakapahariini.com/wp-content/upl...1206557Cukup Rumit['Tumis bumbu halus hingga harum. Tambahkan ai...['Tumis', 'Ayam', 'Kurang dari 5 bahan', 'Medi...2rendang-ayam
244391341104Nastar Lembut Anti Gagalhttps://www.masakapahariini.com/resep/resep-na...https://www.masakapahariini.com/wp-content/upl...12080Cukup Rumit['Selai nanas: Masak nanas parut, kayu manis, ...['Manis', 'Tidak Pedas', 'Low', 'Asam', 'Idul ...2nastar-lembut-anti-gagal
322338165911Putri Salju Kacang Medehttps://www.masakapahariini.com/resep/resep-pu...https://www.masakapahariini.com/wp-content/upl...9080Cukup Rumit['Panaskan oven pada suhu 150° C.', 'Kocok men...['Cukup Rumit', 'Panggang']1putri-salju-kacang-mede
433862184532Es Cincau Gula Aren Segar dan Kaya Serathttps://www.masakapahariini.com/resep/resep-es...https://www.masakapahariini.com/wp-content/upl...3040Mudah['Seduh SariWangi Teh Asli bersama air panas d...['Minuman', 'Low', 'Manis', 'Appetizer', 'Prak...0es-cincau-gula-aren-segar-dan-kaya-serat
.......................................
158725620239892Oseng-oseng Buncishttps://www.masakapahariini.com/resep/resep-os...https://www.masakapahariini.com/wp-content/upl...252334Mudah['Panaskan wajan dan minyak. Tumis bawang puti...['Tumis', 'Manis', 'Tidak Pedas', 'Sedikit Ped...0oseng-oseng-buncis
158856963177846Bakwan Sayur Renyah Tahan Lamahttps://www.masakapahariini.com/resep/resep-ba...https://www.masakapahariini.com/wp-content/upl...4540Mudah['Di dalam wadah: aduk tepung terigu, Royco Ka...['Tidak Pedas', 'Goreng', 'Gurih', 'Kompor', '...0bakwan-sayur-renyah-tahan-lama
158926253073220Ayam Bakar Bumbu Rujakhttps://www.masakapahariini.com/resep/resep-ay...https://www.masakapahariini.com/wp-content/upl...7540Mudah['Bumbui ayam dengan sedikit garam, lalu pangg...['Ayam', 'Manis', 'Cukup Rumit', 'Gurih', 'Sed...1ayam-bakar-bumbu-rujak
159085439463789Martabak Mie Telur Kornethttps://www.masakapahariini.com/resep/resep-ma...https://www.masakapahariini.com/wp-content/upl...254139Mudah['Campurkan Royco Kaldu Sapi, telur, mie, korn...['Tidak Pedas', 'Goreng', 'Gurih', 'Sahur', 'K...0martabak-mie-telur-kornet
159198956365905Bubur Ayam Hainan Menyehatkanhttps://www.masakapahariini.com/resep/resep-bu...https://www.masakapahariini.com/wp-content/upl...454212Mudah['Panaskan minyak, tumis bawang putih dan jahe...['Ayam', 'Tidak Pedas', 'Rebus', 'Kompor', 'Se...0bubur-ayam-hainan-menyehatkan
\n", "

1592 rows × 12 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 126 } ] }, { "cell_type": "code", "source": [ "export_dataframe(df_ingredients, 'mahi_c3', 'ingredients-c3')\n", "\n", "create_zip_file('mahi_c3')" ], "metadata": { "id": "uJ0c3QFYpnrQ" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "# Replace urutan" ], "metadata": { "id": "WGjg0gcgXnWF" } }, { "cell_type": "code", "source": [ "import pandas as pd\n", "import numpy as np" ], "metadata": { "id": "6zbWEmRzYAUT" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Mount Google Drive\n", "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "WQ5u31g2pvOK", "outputId": "d1d876a9-24d7-4c05-c2f3-7eb40575330e" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n" ] } ] }, { "cell_type": "code", "source": [ "# Read file\n", "# df_recipes = pd.read_csv('/content/drive/MyDrive/EzCook/2023/recipes-c1.csv', sep=',')\n", "df_ingredients = pd.read_csv('/content/drive/MyDrive/EzCook/June 2023/ingredients-c3.csv', sep=',')" ], "metadata": { "id": "Gn71rk9Opvt0" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# df_recipes = df_recipes.drop([386, 831])" ], "metadata": { "id": "BGSE_Jmuq95R" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes = df_recipes[['id', 'title', 'source_url', 'image_url', 'servings', 'time', 'calories', 'difficulty', 'instructions', 'slug']]" ], "metadata": { "id": "0vImJrSarO9M" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 634 }, "id": "PTBIQZhrr7yG", "outputId": "4093e2b9-67e4-40ae-bea2-335dcbdf354c" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id title \\\n", "0 55496940902 Kentang Goreng Renyah Tahan Lama \n", "1 16996267501 Rendang Ayam \n", "2 44391341104 Nastar Lembut Anti Gagal \n", "3 22338165911 Putri Salju Kacang Mede \n", "4 33862184532 Es Cincau Gula Aren Segar dan Kaya Serat \n", "\n", " source_url \\\n", "0 https://www.masakapahariini.com/resep/cara-mem... \n", "1 https://www.masakapahariini.com/resep/resep-ay... \n", "2 https://www.masakapahariini.com/resep/resep-na... \n", "3 https://www.masakapahariini.com/resep/resep-pu... \n", "4 https://www.masakapahariini.com/resep/resep-es... \n", "\n", " image_url servings time calories \\\n", "0 https://www.masakapahariini.com/wp-content/upl... 4 90 0 \n", "1 https://www.masakapahariini.com/wp-content/upl... 6 120 557 \n", "2 https://www.masakapahariini.com/wp-content/upl... 8 120 0 \n", "3 https://www.masakapahariini.com/wp-content/upl... 8 90 0 \n", "4 https://www.masakapahariini.com/wp-content/upl... 4 30 0 \n", "\n", " difficulty instructions \\\n", "0 Cukup Rumit ['Potong kentang memanjang seperti ukuran kent... \n", "1 Cukup Rumit ['Tumis bumbu halus hingga harum. Tambahkan ai... \n", "2 Cukup Rumit ['Selai nanas: Masak nanas parut, kayu manis, ... \n", "3 Cukup Rumit ['Panaskan oven pada suhu 150° C.', 'Kocok men... \n", "4 Mudah ['Seduh SariWangi Teh Asli bersama air panas d... \n", "\n", " slug \n", "0 kentang-goreng-renyah-tahan-lama \n", "1 rendang-ayam \n", "2 nastar-lembut-anti-gagal \n", "3 putri-salju-kacang-mede \n", "4 es-cincau-gula-aren-segar-dan-kaya-serat " ], "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", "
idtitlesource_urlimage_urlservingstimecaloriesdifficultyinstructionsslug
055496940902Kentang Goreng Renyah Tahan Lamahttps://www.masakapahariini.com/resep/cara-mem...https://www.masakapahariini.com/wp-content/upl...4900Cukup Rumit['Potong kentang memanjang seperti ukuran kent...kentang-goreng-renyah-tahan-lama
116996267501Rendang Ayamhttps://www.masakapahariini.com/resep/resep-ay...https://www.masakapahariini.com/wp-content/upl...6120557Cukup Rumit['Tumis bumbu halus hingga harum. Tambahkan ai...rendang-ayam
244391341104Nastar Lembut Anti Gagalhttps://www.masakapahariini.com/resep/resep-na...https://www.masakapahariini.com/wp-content/upl...81200Cukup Rumit['Selai nanas: Masak nanas parut, kayu manis, ...nastar-lembut-anti-gagal
322338165911Putri Salju Kacang Medehttps://www.masakapahariini.com/resep/resep-pu...https://www.masakapahariini.com/wp-content/upl...8900Cukup Rumit['Panaskan oven pada suhu 150° C.', 'Kocok men...putri-salju-kacang-mede
433862184532Es Cincau Gula Aren Segar dan Kaya Serathttps://www.masakapahariini.com/resep/resep-es...https://www.masakapahariini.com/wp-content/upl...4300Mudah['Seduh SariWangi Teh Asli bersama air panas d...es-cincau-gula-aren-segar-dan-kaya-serat
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 146 } ] }, { "cell_type": "code", "source": [ "# df_recipes.rename(columns = {'steps':'instructions', 'url':'source_url'}, inplace = True)" ], "metadata": { "id": "gHA2cfp9sGpp" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients.rename(columns = {'id':'recipe_id', 'ingredients': 'name'}, inplace = True)" ], "metadata": { "id": "6mElCeSotJRl" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients['id'] = df_ingredients.index + 1" ], "metadata": { "id": "kmyCLpHVtSEU" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients = df_ingredients[['id', 'name', 'recipe_id', 'amount', 'unit_id', 'state']]" ], "metadata": { "id": "vjwbkQfPs-_S" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 423 }, "id": "Q_oPzHvdsw2j", "outputId": "5934c233-814e-4dde-85a1-5d333d64b946" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id name recipe_id amount unit_id \\\n", "0 1 kentang ukuran besar 55496940902 500 10.0 \n", "1 2 Royco Kaldu Jamur 55496940902 1 26.0 \n", "2 3 bawang putih 55496940902 5 29.0 \n", "3 4 air 55496940902 1.5 14.0 \n", "4 5 Minyak 55496940902 0 NaN \n", "... ... ... ... ... ... \n", "22601 22602 garam 98956365905 1/2 27.0 \n", "22602 22603 minyak sayur 98956365905 1 26.0 \n", "22603 22604 daun bawang 98956365905 1 1.0 \n", "22604 22605 seledri 98956365905 1 1.0 \n", "22605 22606 bawang merah goreng 98956365905 0 NaN \n", "\n", " state \n", "0 kupas \n", "1 NaN \n", "2 memarkan \n", "3 untuk merebus \n", "4 untuk menggoreng \n", "... ... \n", "22601 NaN \n", "22602 NaN \n", "22603 iris tipis \n", "22604 iris tipis \n", "22605 NaN \n", "\n", "[22606 rows x 6 columns]" ], "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", "
idnamerecipe_idamountunit_idstate
01kentang ukuran besar5549694090250010.0kupas
12Royco Kaldu Jamur55496940902126.0NaN
23bawang putih55496940902529.0memarkan
34air554969409021.514.0untuk merebus
45Minyak554969409020NaNuntuk menggoreng
.....................
2260122602garam989563659051/227.0NaN
2260222603minyak sayur98956365905126.0NaN
2260322604daun bawang9895636590511.0iris tipis
2260422605seledri9895636590511.0iris tipis
2260522606bawang merah goreng989563659050NaNNaN
\n", "

22606 rows × 6 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 139 } ] }, { "cell_type": "code", "source": [ "df_tags = df_recipes[['id', 'tags']]\n", "df_tags['tags'] = df_tags['tags'].apply(lambda x: ast.literal_eval(x))\n", "df_tags = df_tags.explode('tags')\n", "df_tags" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 527 }, "id": "2bsXxkc2jcR3", "outputId": "580cff9d-449b-416f-e78b-356dfa5b4a4c" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_tags['tags'] = df_tags['tags'].apply(lambda x: ast.literal_eval(x))\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [ " id tags\n", "0 55496940902 Tidak Pedas\n", "0 55496940902 Low\n", "0 55496940902 Goreng\n", "0 55496940902 Gurih\n", "0 55496940902 Kompor\n", "... ... ...\n", "1591 98956365905 Sehat\n", "1591 98956365905 Nasi\n", "1591 98956365905 Masakan Utama\n", "1591 98956365905 Bebas Susu\n", "1591 98956365905 Masakan Internasional\n", "\n", "[21041 rows x 2 columns]" ], "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", "
idtags
055496940902Tidak Pedas
055496940902Low
055496940902Goreng
055496940902Gurih
055496940902Kompor
.........
159198956365905Sehat
159198956365905Nasi
159198956365905Masakan Utama
159198956365905Bebas Susu
159198956365905Masakan Internasional
\n", "

21041 rows × 2 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 144 } ] }, { "cell_type": "code", "source": [ "export_dataframe(df_ingredients, 'mahi_c4', 'ingredients-c4')\n", "export_dataframe(df_recipes, 'mahi_c4', 'recipes-c4')\n", "export_dataframe(df_tags, 'mahi_c4', 'tags-c4')\n", "\n", "create_zip_file('mahi_c4')" ], "metadata": { "id": "yKlGPpC9jiNX", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "148add66-4c61-4b5e-fcf5-82120787282d" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "mahi_c4.zip created successfully!\n" ] } ] }, { "cell_type": "code", "source": [ "# Read file\n", "# df_recipes = pd.read_csv('/content/drive/MyDrive/EzCook/2023/recipes-c1.csv', sep=',')\n", "df_ingredients = pd.read_csv('/content/drive/MyDrive/EzCook/June 2023/ingredients-c4.csv', sep=',')\n", "df_recipes = pd.read_csv('/content/drive/MyDrive/EzCook/June 2023/recipes-c4.csv', sep=',')" ], "metadata": { "id": "etaM3WRFmKCT" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients['name'] = df_ingredients['name'].str.strip()\n", "df_recipes['title'] = df_recipes['title'].str.strip()" ], "metadata": { "id": "WVP6lAflmrSb" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_recipes.head()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 634 }, "id": "6wLMMVxQmw_x", "outputId": "b4c08f2c-b64f-4c39-f1aa-0c81365dd25a" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id title \\\n", "0 55496940902 Kentang Goreng Renyah Tahan Lama \n", "1 16996267501 Rendang Ayam \n", "2 44391341104 Nastar Lembut Anti Gagal \n", "3 22338165911 Putri Salju Kacang Mede \n", "4 33862184532 Es Cincau Gula Aren Segar dan Kaya Serat \n", "\n", " source_url \\\n", "0 https://www.masakapahariini.com/resep/cara-mem... \n", "1 https://www.masakapahariini.com/resep/resep-ay... \n", "2 https://www.masakapahariini.com/resep/resep-na... \n", "3 https://www.masakapahariini.com/resep/resep-pu... \n", "4 https://www.masakapahariini.com/resep/resep-es... \n", "\n", " image_url servings time \\\n", "0 https://www.masakapahariini.com/wp-content/upl... 4 90 \n", "1 https://www.masakapahariini.com/wp-content/upl... 6 120 \n", "2 https://www.masakapahariini.com/wp-content/upl... 8 120 \n", "3 https://www.masakapahariini.com/wp-content/upl... 8 90 \n", "4 https://www.masakapahariini.com/wp-content/upl... 4 30 \n", "\n", " calories difficulty instructions \\\n", "0 0 Cukup Rumit ['Potong kentang memanjang seperti ukuran kent... \n", "1 557 Cukup Rumit ['Tumis bumbu halus hingga harum. Tambahkan ai... \n", "2 0 Cukup Rumit ['Selai nanas: Masak nanas parut, kayu manis, ... \n", "3 0 Cukup Rumit ['Panaskan oven pada suhu 150° C.', 'Kocok men... \n", "4 0 Mudah ['Seduh SariWangi Teh Asli bersama air panas d... \n", "\n", " slug \n", "0 kentang-goreng-renyah-tahan-lama \n", "1 rendang-ayam \n", "2 nastar-lembut-anti-gagal \n", "3 putri-salju-kacang-mede \n", "4 es-cincau-gula-aren-segar-dan-kaya-serat " ], "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", "
idtitlesource_urlimage_urlservingstimecaloriesdifficultyinstructionsslug
055496940902Kentang Goreng Renyah Tahan Lamahttps://www.masakapahariini.com/resep/cara-mem...https://www.masakapahariini.com/wp-content/upl...4900Cukup Rumit['Potong kentang memanjang seperti ukuran kent...kentang-goreng-renyah-tahan-lama
116996267501Rendang Ayamhttps://www.masakapahariini.com/resep/resep-ay...https://www.masakapahariini.com/wp-content/upl...6120557Cukup Rumit['Tumis bumbu halus hingga harum. Tambahkan ai...rendang-ayam
244391341104Nastar Lembut Anti Gagalhttps://www.masakapahariini.com/resep/resep-na...https://www.masakapahariini.com/wp-content/upl...81200Cukup Rumit['Selai nanas: Masak nanas parut, kayu manis, ...nastar-lembut-anti-gagal
322338165911Putri Salju Kacang Medehttps://www.masakapahariini.com/resep/resep-pu...https://www.masakapahariini.com/wp-content/upl...8900Cukup Rumit['Panaskan oven pada suhu 150° C.', 'Kocok men...putri-salju-kacang-mede
433862184532Es Cincau Gula Aren Segar dan Kaya Serathttps://www.masakapahariini.com/resep/resep-es...https://www.masakapahariini.com/wp-content/upl...4300Mudah['Seduh SariWangi Teh Asli bersama air panas d...es-cincau-gula-aren-segar-dan-kaya-serat
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 157 } ] }, { "cell_type": "code", "source": [ "export_dataframe(df_ingredients, 'mahi_c5', 'ingredients-c5')\n", "export_dataframe(df_recipes, 'mahi_c5', 'recipes-c5')\n", "# export_dataframe(df_tags, 'mahi_c4', 'tags-c4')\n", "\n", "create_zip_file('mahi_c5')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Y2XcApy1mK7y", "outputId": "7c76de31-ba88-4e34-d7a8-26e28e1fdb1a" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "mahi_c5.zip created successfully!\n" ] } ] }, { "cell_type": "markdown", "source": [ "# Batch" ], "metadata": { "id": "M29y-rMbjixV" } }, { "cell_type": "code", "source": [ "# Read file\n", "df_ingredients = pd.read_csv('/content/drive/MyDrive/EzCook/ingredients-c5.csv', sep=',')" ], "metadata": { "id": "DspOBzcX3nJi" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df_ingredients" ], "metadata": { "id": "8D5X8K_J3p4r", "outputId": "3809ad24-591c-41c2-e35b-5fc1b29d314a", "colab": { "base_uri": "https://localhost:8080/", "height": 424 } }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id name recipe_id amount unit_id \\\n", "0 1 Daun pisang 19667128120 NaN NaN \n", "1 2 Minyak 19667128120 NaN NaN \n", "2 3 Tepung ketan 19667128120 NaN NaN \n", "3 4 tepung ketan 19667128120 300.0 9.0 \n", "4 5 Buavita Guava 19667128120 200.0 13.0 \n", "... ... ... ... ... ... \n", "21035 21036 garam 69526158105 0.5 20.0 \n", "21036 21037 minyak sayur 69526158105 1.0 19.0 \n", "21037 21038 daun bawang 69526158105 1.0 1.0 \n", "21038 21039 seledri 69526158105 1.0 1.0 \n", "21039 21040 bawang merah goreng 69526158105 NaN NaN \n", "\n", " state \n", "0 gunting mengikuti ukuran cetakan kue ku \n", "1 untuk olesan \n", "2 untuk taburan \n", "3 NaN \n", "4 NaN \n", "... ... \n", "21035 NaN \n", "21036 NaN \n", "21037 iris tipis \n", "21038 iris tipis \n", "21039 NaN \n", "\n", "[21040 rows x 6 columns]" ], "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", "
idnamerecipe_idamountunit_idstate
01Daun pisang19667128120NaNNaNgunting mengikuti ukuran cetakan kue ku
12Minyak19667128120NaNNaNuntuk olesan
23Tepung ketan19667128120NaNNaNuntuk taburan
34tepung ketan19667128120300.09.0NaN
45Buavita Guava19667128120200.013.0NaN
.....................
2103521036garam695261581050.520.0NaN
2103621037minyak sayur695261581051.019.0NaN
2103721038daun bawang695261581051.01.0iris tipis
2103821039seledri695261581051.01.0iris tipis
2103921040bawang merah goreng69526158105NaNNaNNaN
\n", "

21040 rows × 6 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 188 } ] }, { "cell_type": "code", "source": [ "!mkdir ingredients\n", "\n", "df_ingredients[0:3000].to_csv('ingredients/ingredients-c6-1' + '.csv', index=False, header=False)\n", "df_ingredients[3000:6000].to_csv('ingredients/ingredients-c6-2' + '.csv', index=False, header=False)\n", "df_ingredients[6000:9000].to_csv('ingredients/ingredients-c6-3' + '.csv', index=False, header=False)\n", "df_ingredients[9000:12000].to_csv('ingredients/ingredients-c6-4' + '.csv', index=False, header=False)\n", "df_ingredients[12000:15000].to_csv('ingredients/ingredients-c6-5' + '.csv', index=False, header=False)\n", "df_ingredients[15000:18000].to_csv('ingredients/ingredients-c6-6' + '.csv', index=False, header=False)\n", "df_ingredients[18000:21000].to_csv('ingredients/ingredients-c6-7' + '.csv', index=False, header=False)\n", "df_ingredients[21000:].to_csv('ingredients/ingredients-c6-8' + '.csv', index=False, header=False)" ], "metadata": { "id": "rN4bdoi4Tbbf" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "!zip -r ingredients1.zip ingredients/" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "xxwBPsrOZXTM", "outputId": "654aba27-f4ef-44db-8738-3ec703d86263" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ " adding: ingredients/ (stored 0%)\n", " adding: ingredients/ingredients-c6-5.csv (deflated 78%)\n", " adding: ingredients/ingredients-c6-3.csv (deflated 77%)\n", " adding: ingredients/ingredients-c6-2.csv (deflated 77%)\n", " adding: ingredients/ingredients-c6-6.csv (deflated 78%)\n", " adding: ingredients/ingredients-c6-7.csv (deflated 78%)\n", " adding: ingredients/ingredients-c6-1.csv (deflated 77%)\n", " adding: ingredients/ingredients-c6-4.csv (deflated 78%)\n", " adding: ingredients/ingredients-c6-8.csv (deflated 65%)\n" ] } ] }, { "cell_type": "code", "source": [ "# Read file\n", "import pandas as pd\n", "\n", "df = pd.read_csv('tags-c4.csv', sep=',')\n", "df" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 424 }, "id": "9z_wCz8oUl4K", "outputId": "1fdaf432-4adb-4026-c6b8-45a8d285f373" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id tags\n", "0 55496940902 Tidak Pedas\n", "1 55496940902 Low\n", "2 55496940902 Goreng\n", "3 55496940902 Gurih\n", "4 55496940902 Kompor\n", "... ... ...\n", "21036 98956365905 Sehat\n", "21037 98956365905 Nasi\n", "21038 98956365905 Masakan Utama\n", "21039 98956365905 Bebas Susu\n", "21040 98956365905 Masakan Internasional\n", "\n", "[21041 rows x 2 columns]" ], "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", "
idtags
055496940902Tidak Pedas
155496940902Low
255496940902Goreng
355496940902Gurih
455496940902Kompor
.........
2103698956365905Sehat
2103798956365905Nasi
2103898956365905Masakan Utama
2103998956365905Bebas Susu
2104098956365905Masakan Internasional
\n", "

21041 rows × 2 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 25 } ] }, { "cell_type": "code", "source": [ "df[\"recipe_id\"] = df[\"id\"]\n", "df[\"id\"] = df.index + 1" ], "metadata": { "id": "8k1LCDk-bAm5" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 424 }, "id": "Z0l_y_TMbDZk", "outputId": "7188e525-61d9-44d3-ccab-fe02d432fb80" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id tags recipe_id\n", "0 1 Tidak Pedas 55496940902\n", "1 2 Low 55496940902\n", "2 3 Goreng 55496940902\n", "3 4 Gurih 55496940902\n", "4 5 Kompor 55496940902\n", "... ... ... ...\n", "21036 21037 Sehat 98956365905\n", "21037 21038 Nasi 98956365905\n", "21038 21039 Masakan Utama 98956365905\n", "21039 21040 Bebas Susu 98956365905\n", "21040 21041 Masakan Internasional 98956365905\n", "\n", "[21041 rows x 3 columns]" ], "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", "
idtagsrecipe_id
01Tidak Pedas55496940902
12Low55496940902
23Goreng55496940902
34Gurih55496940902
45Kompor55496940902
............
2103621037Sehat98956365905
2103721038Nasi98956365905
2103821039Masakan Utama98956365905
2103921040Bebas Susu98956365905
2104021041Masakan Internasional98956365905
\n", "

21041 rows × 3 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 27 } ] }, { "cell_type": "code", "source": [ "df = df[[\"id\", \"tags\", \"recipe_id\"]].rename({\"tags\": \"tag\"})\n", "df.to_csv(\"tags-c4-tersusun.csv\", index=False, header=False)" ], "metadata": { "id": "P9-LEC_NU2MB" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 798 }, "id": "adm9lzyQXYT_", "outputId": "0be58a2e-d480-497c-e6ab-a01539a01b78" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id title \\\n", "0 55496940902 Kentang Goreng Renyah Tahan Lama \n", "1 16996267501 Rendang Ayam \n", "2 44391341104 Nastar Lembut Anti Gagal \n", "3 22338165911 Putri Salju Kacang Mede \n", "4 33862184532 Es Cincau Gula Aren Segar dan Kaya Serat \n", "... ... ... \n", "1587 25620239892 Oseng-oseng Buncis \n", "1588 56963177846 Bakwan Sayur Renyah Tahan Lama \n", "1589 26253073220 Ayam Bakar Bumbu Rujak \n", "1590 85439463789 Martabak Mie Telur Kornet \n", "1591 98956365905 Bubur Ayam Hainan Menyehatkan \n", "\n", " image_url time servings \\\n", "0 https://www.masakapahariini.com/wp-content/upl... 90 4 \n", "1 https://www.masakapahariini.com/wp-content/upl... 120 6 \n", "2 https://www.masakapahariini.com/wp-content/upl... 120 8 \n", "3 https://www.masakapahariini.com/wp-content/upl... 90 8 \n", "4 https://www.masakapahariini.com/wp-content/upl... 30 4 \n", "... ... ... ... \n", "1587 https://www.masakapahariini.com/wp-content/upl... 25 2 \n", "1588 https://www.masakapahariini.com/wp-content/upl... 45 4 \n", "1589 https://www.masakapahariini.com/wp-content/upl... 75 4 \n", "1590 https://www.masakapahariini.com/wp-content/upl... 25 4 \n", "1591 https://www.masakapahariini.com/wp-content/upl... 45 4 \n", "\n", " calories difficulty \\\n", "0 0 Cukup Rumit \n", "1 557 Cukup Rumit \n", "2 0 Cukup Rumit \n", "3 0 Cukup Rumit \n", "4 0 Mudah \n", "... ... ... \n", "1587 334 Mudah \n", "1588 0 Mudah \n", "1589 0 Mudah \n", "1590 139 Mudah \n", "1591 212 Mudah \n", "\n", " instructions \\\n", "0 ['Potong kentang memanjang seperti ukuran kent... \n", "1 ['Tumis bumbu halus hingga harum. Tambahkan ai... \n", "2 ['Selai nanas: Masak nanas parut, kayu manis, ... \n", "3 ['Panaskan oven pada suhu 150° C.', 'Kocok men... \n", "4 ['Seduh SariWangi Teh Asli bersama air panas d... \n", "... ... \n", "1587 ['Panaskan wajan dan minyak. Tumis bawang puti... \n", "1588 ['Di dalam wadah: aduk tepung terigu, Royco Ka... \n", "1589 ['Bumbui ayam dengan sedikit garam, lalu pangg... \n", "1590 ['Campurkan Royco Kaldu Sapi, telur, mie, korn... \n", "1591 ['Panaskan minyak, tumis bawang putih dan jahe... \n", "\n", " source_url \\\n", "0 https://www.masakapahariini.com/resep/cara-mem... \n", "1 https://www.masakapahariini.com/resep/resep-ay... \n", "2 https://www.masakapahariini.com/resep/resep-na... \n", "3 https://www.masakapahariini.com/resep/resep-pu... \n", "4 https://www.masakapahariini.com/resep/resep-es... \n", "... ... \n", "1587 https://www.masakapahariini.com/resep/resep-os... \n", "1588 https://www.masakapahariini.com/resep/resep-ba... \n", "1589 https://www.masakapahariini.com/resep/resep-ay... \n", "1590 https://www.masakapahariini.com/resep/resep-ma... \n", "1591 https://www.masakapahariini.com/resep/resep-bu... \n", "\n", " slug \n", "0 kentang-goreng-renyah-tahan-lama \n", "1 rendang-ayam \n", "2 nastar-lembut-anti-gagal \n", "3 putri-salju-kacang-mede \n", "4 es-cincau-gula-aren-segar-dan-kaya-serat \n", "... ... \n", "1587 oseng-oseng-buncis \n", "1588 bakwan-sayur-renyah-tahan-lama \n", "1589 ayam-bakar-bumbu-rujak \n", "1590 martabak-mie-telur-kornet \n", "1591 bubur-ayam-hainan-menyehatkan \n", "\n", "[1591 rows x 10 columns]" ], "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", "
idtitleimage_urltimeservingscaloriesdifficultyinstructionssource_urlslug
055496940902Kentang Goreng Renyah Tahan Lamahttps://www.masakapahariini.com/wp-content/upl...9040Cukup Rumit['Potong kentang memanjang seperti ukuran kent...https://www.masakapahariini.com/resep/cara-mem...kentang-goreng-renyah-tahan-lama
116996267501Rendang Ayamhttps://www.masakapahariini.com/wp-content/upl...1206557Cukup Rumit['Tumis bumbu halus hingga harum. Tambahkan ai...https://www.masakapahariini.com/resep/resep-ay...rendang-ayam
244391341104Nastar Lembut Anti Gagalhttps://www.masakapahariini.com/wp-content/upl...12080Cukup Rumit['Selai nanas: Masak nanas parut, kayu manis, ...https://www.masakapahariini.com/resep/resep-na...nastar-lembut-anti-gagal
322338165911Putri Salju Kacang Medehttps://www.masakapahariini.com/wp-content/upl...9080Cukup Rumit['Panaskan oven pada suhu 150° C.', 'Kocok men...https://www.masakapahariini.com/resep/resep-pu...putri-salju-kacang-mede
433862184532Es Cincau Gula Aren Segar dan Kaya Serathttps://www.masakapahariini.com/wp-content/upl...3040Mudah['Seduh SariWangi Teh Asli bersama air panas d...https://www.masakapahariini.com/resep/resep-es...es-cincau-gula-aren-segar-dan-kaya-serat
.................................
158725620239892Oseng-oseng Buncishttps://www.masakapahariini.com/wp-content/upl...252334Mudah['Panaskan wajan dan minyak. Tumis bawang puti...https://www.masakapahariini.com/resep/resep-os...oseng-oseng-buncis
158856963177846Bakwan Sayur Renyah Tahan Lamahttps://www.masakapahariini.com/wp-content/upl...4540Mudah['Di dalam wadah: aduk tepung terigu, Royco Ka...https://www.masakapahariini.com/resep/resep-ba...bakwan-sayur-renyah-tahan-lama
158926253073220Ayam Bakar Bumbu Rujakhttps://www.masakapahariini.com/wp-content/upl...7540Mudah['Bumbui ayam dengan sedikit garam, lalu pangg...https://www.masakapahariini.com/resep/resep-ay...ayam-bakar-bumbu-rujak
159085439463789Martabak Mie Telur Kornethttps://www.masakapahariini.com/wp-content/upl...254139Mudah['Campurkan Royco Kaldu Sapi, telur, mie, korn...https://www.masakapahariini.com/resep/resep-ma...martabak-mie-telur-kornet
159198956365905Bubur Ayam Hainan Menyehatkanhttps://www.masakapahariini.com/wp-content/upl...454212Mudah['Panaskan minyak, tumis bawang putih dan jahe...https://www.masakapahariini.com/resep/resep-bu...bubur-ayam-hainan-menyehatkan
\n", "

1591 rows × 10 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 14 } ] }, { "cell_type": "code", "source": [ "df[df.duplicated(subset='id', keep=False)]" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "I4-582HfWONI", "outputId": "fe1d8ef1-8e36-46f7-a5a0-35ad9afee78c" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " id name recipe_id amount unit_id \\\n", "152 153 Hellmann's Real Mayonnaise 11817808076 0 NaN \n", "153 153 Hellmann's Real Mayonnaise 11817808076 0 NaN \n", "198 198 Hellmann's Real Mayonnaise 91398292597 3 26.0 \n", "199 198 Hellmann's Real Mayonnaise 91398292597 3 26.0 \n", "1086 1085 Hellmann's Real Mayonnaise 45168210867 4 26.0 \n", "1087 1085 Hellmann's Real Mayonnaise 45168210867 4 26.0 \n", "1172 1170 Hellmann's Real Mayonnaise 86212210256 5 26.0 \n", "1173 1170 Hellmann's Real Mayonnaise 86212210256 5 26.0 \n", "1838 1835 Hellmann's Real Mayonnaise 55385763087 5 26.0 \n", "1839 1835 Hellmann's Real Mayonnaise 55385763087 5 26.0 \n", "2214 2210 Hellmann's Real Mayonnaise 75802958080 150 10.0 \n", "2215 2210 Hellmann's Real Mayonnaise 75802958080 150 10.0 \n", "2980 2975 Hellmann's Real Mayonnaise 77774305212 4 26.0 \n", "2981 2975 Hellmann's Real Mayonnaise 77774305212 4 26.0 \n", "3162 3156 Hellmann's Real Mayonnaise 30787072082 10 26.0 \n", "3163 3156 Hellmann's Real Mayonnaise 30787072082 10 26.0 \n", "3670 3663 Hellmann's Real Mayonnaise 17939171727 6 26.0 \n", "3671 3663 Hellmann's Real Mayonnaise 17939171727 6 26.0 \n", "6074 6066 Hellmann's Real Mayonnaise 14326277867 8 26.0 \n", "6075 6066 Hellmann's Real Mayonnaise 14326277867 8 26.0 \n", "6480 6471 Hellmann's Real Mayonnaise 99356543707 100 10.0 \n", "6481 6471 Hellmann's Real Mayonnaise 99356543707 100 10.0 \n", "7119 7109 Hellmann's Real Mayonnaise 74146229513 0 NaN \n", "7120 7109 Hellmann's Real Mayonnaise 74146229513 0 NaN \n", "7585 7574 Hellmann's Real Mayonnaise 97812594148 4 26.0 \n", "7586 7574 Hellmann's Real Mayonnaise 97812594148 4 26.0 \n", "8178 8166 Hellmann's Real Mayonnaise 17513523975 0 NaN \n", "8179 8166 Hellmann's Real Mayonnaise 17513523975 0 NaN \n", "8235 8222 Hellmann's Real Mayonnaise 40285267713 250 16.0 \n", "8236 8222 Hellmann's Real Mayonnaise 40285267713 250 16.0 \n", "9558 9544 Hellmann's Real Mayonnaise 41948787362 200 10.0 \n", "9559 9544 Hellmann's Real Mayonnaise 41948787362 200 10.0 \n", "9676 9661 Hellmann's Real Mayonnaise 42335288819 5 26.0 \n", "9677 9661 Hellmann's Real Mayonnaise 42335288819 5 26.0 \n", "9749 9733 Hellmann's Real Mayonnaise 45317624667 0 NaN \n", "9750 9733 Hellmann's Real Mayonnaise 45317624667 0 NaN \n", "10190 10173 Hellmann's Real Mayonnaise 95640120710 100 10.0 \n", "10191 10173 Hellmann's Real Mayonnaise 95640120710 100 10.0 \n", "10368 10350 apel Malang atau apel Manalagi 68797556408 300 10.0 \n", "10369 10350 apel Malang atau apel Manalagi 68797556408 300 10.0 \n", "10427 10408 Hellmann's Real Mayonnaise 88680760468 150 10.0 \n", "10428 10408 Hellmann's Real Mayonnaise 88680760468 150 10.0 \n", "10472 10452 Hellmann's Real Mayonnaise 82379358987 2 26.0 \n", "10473 10452 Hellmann's Real Mayonnaise 82379358987 2 26.0 \n", "12247 12226 Hellmann's Real Mayonnaise 61286500969 4 26.0 \n", "12248 12226 Hellmann's Real Mayonnaise 61286500969 4 26.0 \n", "12469 12447 Hellmann's Real Mayonnaise 44336052869 5 26.0 \n", "12470 12447 Hellmann's Real Mayonnaise 44336052869 5 26.0 \n", "12886 12863 Hellmann's Real Mayonnaise 65628628510 2 26.0 \n", "12887 12863 Hellmann's Real Mayonnaise 65628628510 2 26.0 \n", "14620 14596 Hellmann's Real Mayonnaise 81964244958 3 26.0 \n", "14621 14596 Hellmann's Real Mayonnaise 81964244958 3 26.0 \n", "15567 15542 kulit dan tulang ayam 43849533012 400 10.0 \n", "15568 15542 kulit dan tulang ayam 43849533012 400 10.0 \n", "\n", " state raw_ingredient_id \n", "152 NaN 313.0 \n", "153 NaN 313.0 \n", "198 NaN 313.0 \n", "199 NaN 313.0 \n", "1086 NaN 313.0 \n", "1087 NaN 313.0 \n", "1172 NaN 313.0 \n", "1173 NaN 313.0 \n", "1838 NaN 313.0 \n", "1839 NaN 313.0 \n", "2214 NaN 313.0 \n", "2215 NaN 313.0 \n", "2980 NaN 313.0 \n", "2981 NaN 313.0 \n", "3162 NaN 313.0 \n", "3163 NaN 313.0 \n", "3670 NaN 313.0 \n", "3671 NaN 313.0 \n", "6074 NaN 313.0 \n", "6075 NaN 313.0 \n", "6480 NaN 313.0 \n", "6481 NaN 313.0 \n", "7119 NaN 313.0 \n", "7120 NaN 313.0 \n", "7585 NaN 313.0 \n", "7586 NaN 313.0 \n", "8178 NaN 313.0 \n", "8179 NaN 313.0 \n", "8235 NaN 313.0 \n", "8236 NaN 313.0 \n", "9558 NaN 313.0 \n", "9559 NaN 313.0 \n", "9676 NaN 313.0 \n", "9677 NaN 313.0 \n", "9749 NaN 313.0 \n", "9750 NaN 313.0 \n", "10190 NaN 313.0 \n", "10191 NaN 313.0 \n", "10368 NaN 20.0 \n", "10369 NaN 21.0 \n", "10427 NaN 313.0 \n", "10428 NaN 313.0 \n", "10472 NaN 313.0 \n", "10473 NaN 313.0 \n", "12247 NaN 313.0 \n", "12248 NaN 313.0 \n", "12469 NaN 313.0 \n", "12470 NaN 313.0 \n", "12886 NaN 313.0 \n", "12887 NaN 313.0 \n", "14620 NaN 313.0 \n", "14621 NaN 313.0 \n", "15567 NaN 45.0 \n", "15568 NaN 49.0 " ], "text/html": [ "\n", "
\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnamerecipe_idamountunit_idstateraw_ingredient_id
152153Hellmann's Real Mayonnaise118178080760NaNNaN313.0
153153Hellmann's Real Mayonnaise118178080760NaNNaN313.0
198198Hellmann's Real Mayonnaise91398292597326.0NaN313.0
199198Hellmann's Real Mayonnaise91398292597326.0NaN313.0
10861085Hellmann's Real Mayonnaise45168210867426.0NaN313.0
10871085Hellmann's Real Mayonnaise45168210867426.0NaN313.0
11721170Hellmann's Real Mayonnaise86212210256526.0NaN313.0
11731170Hellmann's Real Mayonnaise86212210256526.0NaN313.0
18381835Hellmann's Real Mayonnaise55385763087526.0NaN313.0
18391835Hellmann's Real Mayonnaise55385763087526.0NaN313.0
22142210Hellmann's Real Mayonnaise7580295808015010.0NaN313.0
22152210Hellmann's Real Mayonnaise7580295808015010.0NaN313.0
29802975Hellmann's Real Mayonnaise77774305212426.0NaN313.0
29812975Hellmann's Real Mayonnaise77774305212426.0NaN313.0
31623156Hellmann's Real Mayonnaise307870720821026.0NaN313.0
31633156Hellmann's Real Mayonnaise307870720821026.0NaN313.0
36703663Hellmann's Real Mayonnaise17939171727626.0NaN313.0
36713663Hellmann's Real Mayonnaise17939171727626.0NaN313.0
60746066Hellmann's Real Mayonnaise14326277867826.0NaN313.0
60756066Hellmann's Real Mayonnaise14326277867826.0NaN313.0
64806471Hellmann's Real Mayonnaise9935654370710010.0NaN313.0
64816471Hellmann's Real Mayonnaise9935654370710010.0NaN313.0
71197109Hellmann's Real Mayonnaise741462295130NaNNaN313.0
71207109Hellmann's Real Mayonnaise741462295130NaNNaN313.0
75857574Hellmann's Real Mayonnaise97812594148426.0NaN313.0
75867574Hellmann's Real Mayonnaise97812594148426.0NaN313.0
81788166Hellmann's Real Mayonnaise175135239750NaNNaN313.0
81798166Hellmann's Real Mayonnaise175135239750NaNNaN313.0
82358222Hellmann's Real Mayonnaise4028526771325016.0NaN313.0
82368222Hellmann's Real Mayonnaise4028526771325016.0NaN313.0
95589544Hellmann's Real Mayonnaise4194878736220010.0NaN313.0
95599544Hellmann's Real Mayonnaise4194878736220010.0NaN313.0
96769661Hellmann's Real Mayonnaise42335288819526.0NaN313.0
96779661Hellmann's Real Mayonnaise42335288819526.0NaN313.0
97499733Hellmann's Real Mayonnaise453176246670NaNNaN313.0
97509733Hellmann's Real Mayonnaise453176246670NaNNaN313.0
1019010173Hellmann's Real Mayonnaise9564012071010010.0NaN313.0
1019110173Hellmann's Real Mayonnaise9564012071010010.0NaN313.0
1036810350apel Malang atau apel Manalagi6879755640830010.0NaN20.0
1036910350apel Malang atau apel Manalagi6879755640830010.0NaN21.0
1042710408Hellmann's Real Mayonnaise8868076046815010.0NaN313.0
1042810408Hellmann's Real Mayonnaise8868076046815010.0NaN313.0
1047210452Hellmann's Real Mayonnaise82379358987226.0NaN313.0
1047310452Hellmann's Real Mayonnaise82379358987226.0NaN313.0
1224712226Hellmann's Real Mayonnaise61286500969426.0NaN313.0
1224812226Hellmann's Real Mayonnaise61286500969426.0NaN313.0
1246912447Hellmann's Real Mayonnaise44336052869526.0NaN313.0
1247012447Hellmann's Real Mayonnaise44336052869526.0NaN313.0
1288612863Hellmann's Real Mayonnaise65628628510226.0NaN313.0
1288712863Hellmann's Real Mayonnaise65628628510226.0NaN313.0
1462014596Hellmann's Real Mayonnaise81964244958326.0NaN313.0
1462114596Hellmann's Real Mayonnaise81964244958326.0NaN313.0
1556715542kulit dan tulang ayam4384953301240010.0NaN45.0
1556815542kulit dan tulang ayam4384953301240010.0NaN49.0
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 18 } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "lNYBYPkmZy3d" }, "execution_count": null, "outputs": [] } ] }