{"cells":[{"cell_type":"markdown","metadata":{"id":"qaZJFPpc_i7t","nbpresent":{"id":"af88da20-0f51-483e-bd72-afc896a9da05"}},"source":["# 3 Cleaning Data Using Pandas"]},{"cell_type":"markdown","metadata":{"id":"8xlfFPSS_i7v"},"source":["**Chapter Introduction** \n","When performing data analysis, it is necessary to perform preprocessing to understand and prepare the data. In this chapter, we will introduce the basic usage of a library commonly used in data analysis called Pandas.\n","\n","Pandas is a useful library to process table data. In most real-world scenarios, data that you will find are not in ready-to-use format and require **data cleaning**.\n","In this notebook, we will look at Pandas' functionalities using an actual dataset that can be found online.\n","\n","This is a library that will be used in later chapters as well, so let's make sure you have a good understanding of it here.\n","If you would like to learn Pandas more, please refer to the official documentation ([https://pandas.pydata.org/](https://pandas.pydata.org/)).\n"]},{"cell_type":"markdown","metadata":{"id":"pAQzyNLM_3SM"},"source":["## Table of contents"]},{"cell_type":"markdown","metadata":{"id":"Z971-ZK1_i7x"},"source":["- **3.1 Overview of Pandas**\n"," - 3.1.1 Loading Library\n","\n","- **3.2 Date Structure of Pandas**\n"," - 3.2.1 Series Object\n"," - 3.2.2 DataFrame Object\n","\n","- **3.3 Loading and Interacting with Data**\n"," - 3.3.1 Downloading Data from the Internet\n"," - 3.3.2 Data Loading and Checking Data\n","\n","- **3.4 DataFrame Basics**\n"," - 3.4.1 Data Selection and Assignment\n"," - 3.4.2 Extracting Data with Specific Conditions\n"," - 3.4.3 Determination of nan (null)\n"," - 3.4.4 Sorting of Values\n","- **3.5 Merging and Concatenating Data**\n"," - 3.5.1 Merging Data\n"," - 3.5.2 Concatenating Data\n","- **3.6 Manipulating and Transforming Data**\n"," - 3.6.1 Deleting Data\n"," - 3.6.2 Removing Duplicates\n"," - 3.6.3 Mapping\n"," - 3.6.4 Bin Splitting\n","- **3.7 Aggregating Data**\n","- **3.8 Advanced: Hierarchical Grouping**\n","- **3.9 Advanced: Handling Missing or Anomalous Data**\n"," - 3.9.1 How to Handle Missing Data\n"," - 3.9.2 How to Handle Anomaly Data\n","- **3.10 Comprehensive Question**"]},{"cell_type":"markdown","metadata":{"id":"rAIzuSKQ_i7z"},"source":["\n","***"]},{"cell_type":"markdown","metadata":{"id":"nXv7NNKV_i70","nbpresent":{"id":"b0fc1861-b979-45c5-abd0-3b05200de3b6"}},"source":["## 3.1 Overview of Pandas\n","\n","Pandas is a library that handles Python data as a number table. It can process various data in the form of data frames, and can join and cut data, create spreadsheets, and handle time-series data. At the same time, simple graphing can also be done.\n","\n","Pandas is a library commonly used in the field of data science, often as a preprocessing tool to format data before performing machine learning."]},{"cell_type":"markdown","metadata":{"id":"hitsexSQ_i71"},"source":["### 3.1.1 Loading Libraries"]},{"cell_type":"markdown","metadata":{"id":"nkOBeq_M_i77"},"source":["Pandas is generally loaded with the alias `pd`. We also import `Series` and `DataFrame` object separately so that we can use it more easily.\n","\n","```python\n","import pandas as pd\n","from pandas import Series, DataFrame\n","```"]},{"cell_type":"markdown","metadata":{"id":"RK1aSTkK_i8A"},"source":["#### Loading the libaries used in this chapter"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"svsh84ip_i8B"},"outputs":[],"source":["# The following libraries are used, so please load them beforehand\n","import numpy as np\n","import numpy.random as random\n","import pandas as pd\n","from pandas import Series, DataFrame"]},{"cell_type":"markdown","metadata":{"id":"EjiYJXWz_i8E"},"source":["***"]},{"cell_type":"markdown","metadata":{"id":"swAKS6Qe_i8F"},"source":["## 3.2 Data Structure of Pandas\n","\n","2 commonly used data structures in Pandas are `Series` and `DataFrame`. A `Series` is a one-dimensional object, while a `DataFrame` is basically a two-dimensional data sequence."]},{"cell_type":"markdown","metadata":{"id":"SCOR6YKP_i8F"},"source":["### 3.2.1 Series Object\n","\n","A `Series` object is like a one-dimensional Numpy `array` with labels, as you learned in the previous chapter."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"1QAWS2NV_i8G","outputId":"6b46befd-2d53-46a7-faee-57e3fc929c3b","executionInfo":{"status":"ok","timestamp":1789994461495,"user_tz":-540,"elapsed":64,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["0 1\n","1 1\n","2 2\n","3 3\n","4 5\n","5 8\n","6 13\n","dtype: int64\n"]}],"source":["# Example\n","series = Series([1, 1, 2, 3, 5, 8, 13])\n","print(series)"]},{"cell_type":"markdown","metadata":{"id":"LrV3aoyc_i8J"},"source":["A `Series` object consists of indices and elements. When printed, the left column are the indices and the right column are the elements.\n","In the example above, we have created a `Series` object with elements [1,1,2,3,5,8,13].\n","Since we did not specify any indices, the indices are 0, 1, 2... in order.\n","The `dtype` represents the type of data."]},{"cell_type":"markdown","metadata":{"id":"WhJbyc9D_i8K"},"source":["The index can be any number or character."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"-auNw7mL_i8L","outputId":"9101dfa2-a790-44d2-c2b0-ea907eb4404e","executionInfo":{"status":"ok","timestamp":1789994461515,"user_tz":-540,"elapsed":17,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["a 1\n","b 1\n","c 2\n","d 3\n","e 5\n","f 8\n","g 13\n","dtype: int64\n"]}],"source":["# Alphabetize the index\n","series_i = Series(\n"," [1, 1, 2, 3, 5, 8, 13],\n"," index=['a', 'b', 'c', 'd', 'e', 'f','g']\n",")\n","\n","print(series_i)"]},{"cell_type":"markdown","metadata":{"id":"ScyRvoLo_i8O"},"source":["Elements and indices can also be retrieved separately by specifying the `values` and `index` attributes, respectively, as follows. Elements returned by the `values` attribute will be in Numpy `array` format.\n","\n","\n","\n"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"_bIiwpmw_i8P","outputId":"2625517f-2ff2-4413-9489-01eeca6b82a3","executionInfo":{"status":"ok","timestamp":1789994461542,"user_tz":-540,"elapsed":23,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["Element: [ 1 1 2 3 5 8 13]\n","index: Index(['a', 'b', 'c', 'd', 'e', 'f', 'g'], dtype='object')\n"]}],"source":["print('Element:', series_i.values)\n","print('index:', series_i.index)"]},{"cell_type":"markdown","metadata":{"id":"agd-iYj0_i8T"},"source":["### 3.2.2 DataFrame Object\n","\n","A `DataFrame` object is basically a two-dimensional data column. Below is an example showing a data structure with four columns: `ID`, `City`, `Birth_year`, and `Name`. When displayed with the `print` function, the data is displayed in a tabular format."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"d-oK4U2f_i8U","outputId":"03c09d1c-9fe5-497e-fe25-40317bc76451","executionInfo":{"status":"ok","timestamp":1789994461579,"user_tz":-540,"elapsed":33,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":[" ID City Birth_year Name\n","0 100 Tokyo 1990 Hiroshi\n","1 101 Osaka 1989 Akiko\n","2 102 Kyoto 1992 Yuki\n","3 103 Hokkaido 1997 Satoru\n","4 104 Tokyo 1982 Steve\n"]}],"source":["data = {\n"," 'ID':['100', '101', '102', '103', '104'],\n"," 'City':['Tokyo', 'Osaka', 'Kyoto', 'Hokkaido', 'Tokyo'],\n"," 'Birth_year':[1990, 1989, 1992, 1997, 1982],\n"," 'Name':['Hiroshi', 'Akiko', 'Yuki', 'Satoru', 'Steve']\n","}\n","\n","df = DataFrame(data)\n","\n","print(df)"]},{"cell_type":"markdown","metadata":{"id":"P-SZQUo7_i8X"},"source":["The values 0, 1, 2, 3, 4 shown in the leftmost column are the indices.\n","Each column has its column name at the top.\n"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"RVPXh9c42YqM","outputId":"01603b49-60ba-4c7e-f1ef-bb72088bc9b4","executionInfo":{"status":"ok","timestamp":1789994461588,"user_tz":-540,"elapsed":8,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" ID City Birth_year Name\n","0 100 Tokyo 1990 Hiroshi\n","1 101 Osaka 1989 Akiko\n","2 102 Kyoto 1992 Yuki\n","3 103 Hokkaido 1997 Satoru\n","4 104 Tokyo 1982 Steve"],"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","
IDCityBirth_yearName
0100Tokyo1990Hiroshi
1101Osaka1989Akiko
2102Kyoto1992Yuki
3103Hokkaido1997Satoru
4104Tokyo1982Steve
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df","summary":"{\n \"name\": \"df\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"ID\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"101\",\n \"104\",\n \"102\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"City\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1982,\n \"max\": 1997,\n \"num_unique_values\": 5,\n \"samples\": [\n 1989,\n 1982,\n 1992\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Akiko\",\n \"Steve\",\n \"Yuki\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":6}],"source":["df.head()"]},{"cell_type":"markdown","metadata":{"id":"3N0bUZqzJSfr"},"source":["Like the `Series` object, any number or character can be used to specify the `Index` of a `DataFrame` object."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Dpo8CMK2_i8X","outputId":"01dc4442-82d2-4c4e-e1b6-709cb801dbf8","executionInfo":{"status":"ok","timestamp":1789994461698,"user_tz":-540,"elapsed":20,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":[" ID City Birth_year Name\n","a 100 Tokyo 1990 Hiroshi\n","b 101 Osaka 1989 Akiko\n","c 102 Kyoto 1992 Yuki\n","d 103 Hokkaido 1997 Satoru\n","e 104 Tokyo 1982 Steve\n"]}],"source":["df_i = DataFrame(data, index=['a', 'b', 'c', 'd', 'e'])\n","print(df_i)"]},{"cell_type":"markdown","metadata":{"id":"T6o1c0gR_i8b"},"source":["Elements, indices and columns can also be retrieved separately by specifying the `values`, `index` and `columns` attributes, respectively, as follows. Elements returned by the `values` attribute will be in Numpy array format."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"gqipMTtQ_i8b","outputId":"37c7abe9-17e9-47ac-ff24-c58136f8b3a8","executionInfo":{"status":"ok","timestamp":1789994461721,"user_tz":-540,"elapsed":25,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["Element: [['100' 'Tokyo' 1990 'Hiroshi']\n"," ['101' 'Osaka' 1989 'Akiko']\n"," ['102' 'Kyoto' 1992 'Yuki']\n"," ['103' 'Hokkaido' 1997 'Satoru']\n"," ['104' 'Tokyo' 1982 'Steve']]\n","Index: Index(['a', 'b', 'c', 'd', 'e'], dtype='object')\n","Column: Index(['ID', 'City', 'Birth_year', 'Name'], dtype='object')\n"]}],"source":["print('Element:', df_i.values)\n","print('Index:', df_i.index)\n","print('Column:', df_i.columns)"]},{"cell_type":"markdown","metadata":{"id":"jflkvCjJ_i8f"},"source":["### Side Note: Displaying Data in the Jupyter Environment\n","\n","In Jupyter, data variables can also be displayed by writing them as is as follows.\n","In this case, the Jupyter environment will recognize that this is a `DataFrame` object, and it will be displayed with ruled lines, etc. for easy viewing."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"zKUSFEn5_i8f","outputId":"a326aa23-115d-4d83-a1ae-bf5a3f5b3673","executionInfo":{"status":"ok","timestamp":1789994461728,"user_tz":-540,"elapsed":6,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" ID City Birth_year Name\n","a 100 Tokyo 1990 Hiroshi\n","b 101 Osaka 1989 Akiko\n","c 102 Kyoto 1992 Yuki\n","d 103 Hokkaido 1997 Satoru\n","e 104 Tokyo 1982 Steve"],"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","
IDCityBirth_yearName
a100Tokyo1990Hiroshi
b101Osaka1989Akiko
c102Kyoto1992Yuki
d103Hokkaido1997Satoru
e104Tokyo1982Steve
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df_i","summary":"{\n \"name\": \"df_i\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"ID\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"101\",\n \"104\",\n \"102\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"City\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1982,\n \"max\": 1997,\n \"num_unique_values\": 5,\n \"samples\": [\n 1989,\n 1982,\n 1992\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Akiko\",\n \"Steve\",\n \"Yuki\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":9}],"source":["df_i"]},{"cell_type":"markdown","metadata":{"id":"sCgxdV0o_i8i"},"source":["Also, if you try to display a large `DataFrame`, it may be partially omitted. You can specify the maximum number of columns or rows to display below."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"54x7hgux_i8i"},"outputs":[],"source":["#Specify the maximum number of columns to display\n","pd.set_option('display.max_columns', 50)\n","#Specify the maximum number of rows to display\n","pd.set_option('display.max_rows', 10)"]},{"cell_type":"markdown","metadata":{"id":"lBFW7kXM_i8l"},"source":["***"]},{"cell_type":"markdown","metadata":{"id":"bNmAGwaW_i8m"},"source":["## 3.3 Loading and Interacting with Data\n","We will now work with a real-world dataset hosted online. Often, the data comes as a CSV file. When multiple files are involved, they are commonly bundled into a ZIP file for easier distribution. We'll see how to retrieve these files using Python, and then explore them with Pandas."]},{"cell_type":"markdown","metadata":{"id":"9Cnu2vhE_i8m"},"source":["### 3.3.1 Downloading Data from the Internet\n","In this example, we will assume a situation where the target data is available on the Web as a ZIP file, which can be downloaded and used.\n","\n","Although it is possible to download the data in advance from a browser, Python can also directly read and save the data, so this section explains how to download the data using Python."]},{"cell_type":"markdown","metadata":{"id":"elNT1uR-_i8m"},"source":["#### Dataset Description\n","\n","Next, let's download the sample data to this directory. Here we will use the [Anime Recommendation Database](https://www.kaggle.com/datasets/hernan4444/anime-recommendation-database-2020/data) which contains data of about 17,562 anime and the preference from 325,772 different users."]},{"cell_type":"markdown","metadata":{"id":"OyJN-9Og_i8n"},"source":["#### Libraries for downloading ZIP files and files\n","\n","First, import libraries for downloading ZIP files. To read ZIP files and download them directly from the web, use the following three libraries: `requests`, `zipfile`, and `io`.\n","\n","- `requests` … send and receive data from Web\n","- `zipfile` … reads abd writes ZIP files\n","- `io` … reads and writes files"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"XBXBzaCK_i8o"},"outputs":[],"source":["# Libraries for retrieving data from the web and handling zip files\n","import requests, zipfile\n","from io import StringIO\n","import io"]},{"cell_type":"markdown","metadata":{"id":"6jWtDf4R_i8q"},"source":["#### Download and extract the ZIP file\n","To download and extract this file, we first use `requests.get()` function to download the data from the URL we specify, then use `io.BytesIO()` and `zipfile.ZipFile()` to extract the data as binary stream and store as a ZipFile object, then finally use `z.extractall()` method to extract the files from the ZIP file.\n","The files will be extracted to the current directory."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"xU6Lsmnz_i8q"},"outputs":[],"source":["# Specify the url with data\n","url = 'https://github.com/Hernan4444/MyAnimeList-Database/archive/refs/heads/master.zip'\n","\n","# Acquire data from the url\n","r = requests.get(url, stream=True)\n","\n","# read and extract the zipfile\n","z = zipfile.ZipFile(io.BytesIO(r.content))\n","z.extractall()"]},{"cell_type":"markdown","source":["The extracted files are in a hierarchical structure. Using `tree` command allows us to view the files in a structured manner.\n","\n","We first install `tree` command to the Colab environment."],"metadata":{"id":"G6xIFABdDl8D"}},{"cell_type":"code","source":["!sudo apt-get install tree"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"collapsed":true,"id":"azWIpvUtD3P7","outputId":"50660a71-9f86-4813-9f12-618f8dfc8aa8","executionInfo":{"status":"ok","timestamp":1789994471701,"user_tz":-540,"elapsed":9613,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["Reading package lists... Done\n","Building dependency tree... Done\n","Reading state information... Done\n","The following NEW packages will be installed:\n"," tree\n","0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.\n","Need to get 47.4 kB of archives.\n","After this operation, 111 kB of additional disk space will be used.\n","Get:1 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 tree amd64 2.1.1-2ubuntu3.24.04.2 [47.4 kB]\n","Fetched 47.4 kB in 0s (101 kB/s)\n","debconf: unable to initialize frontend: Dialog\n","debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79, line 1.)\n","debconf: falling back to frontend: Readline\n","debconf: unable to initialize frontend: Readline\n","debconf: (This frontend requires a controlling tty.)\n","debconf: falling back to frontend: Teletype\n","dpkg-preconfigure: unable to re-open stdin: \n","Selecting previously unselected package tree.\n","(Reading database ... 122809 files and directories currently installed.)\n","Preparing to unpack .../tree_2.1.1-2ubuntu3.24.04.2_amd64.deb ...\n","Unpacking tree (2.1.1-2ubuntu3.24.04.2) ...\n","Setting up tree (2.1.1-2ubuntu3.24.04.2) ...\n","Processing triggers for man-db (2.12.0-4build2) ...\n"]}]},{"cell_type":"markdown","source":["Then, we can use `tree` command instead of `ls` command to view the files."],"metadata":{"id":"ax0Z-P-ED-dG"}},{"cell_type":"code","source":["!tree MyAnimeList-Database-master/"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"lMXZjArkD9ic","outputId":"da476490-ed7c-41b8-9700-2c3be6b65794","executionInfo":{"status":"ok","timestamp":1789994471843,"user_tz":-540,"elapsed":136,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["\u001b[01;34mMyAnimeList-Database-master/\u001b[0m\n","├── \u001b[00mAll Scrapping process.ipynb\u001b[0m\n","├── \u001b[01;34mdata\u001b[0m\n","│   ├── \u001b[00manime.csv\u001b[0m\n","│   ├── \u001b[00manimelist.csv\u001b[0m\n","│   ├── \u001b[00manime_with_synopsis.csv\u001b[0m\n","│   ├── \u001b[01;34mhtml\u001b[0m\n","│   │   ├── \u001b[01;31m1.zip\u001b[0m\n","│   │   └── \u001b[01;31m5.zip\u001b[0m\n","│   ├── \u001b[00mrating_complete.csv\u001b[0m\n","│   ├── \u001b[00mreadme.md\u001b[0m\n","│   └── \u001b[00mwatching_status.csv\u001b[0m\n","└── \u001b[00mreadme.md\u001b[0m\n","\n","3 directories, 10 files\n"]}]},{"cell_type":"markdown","metadata":{"id":"5W7JI1gJ_i8v"},"source":["### 3.3.2 Loading and Checking Data"]},{"cell_type":"markdown","metadata":{"id":"ku9Rfxu3_i8w"},"source":["First, we will observe what kind of data `anime.csv` is.\n","\n","#### Reading Data as a DataFrame\n","First, we read the target data and treat it as a Pandas `DataFrame` object.\n","To load a CSV file as `DataFrame` object, we use the `pd.read_csv()` function with the file name as an argument."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"f4I9Pycs_i8x"},"outputs":[],"source":["anime_data = pd.read_csv('MyAnimeList-Database-master/data/anime.csv')\n","anime_list = pd.read_csv('MyAnimeList-Database-master/data/animelist.csv')\n","anime_synop = pd.read_csv('MyAnimeList-Database-master/data/anime_with_synopsis.csv')"]},{"cell_type":"markdown","metadata":{"id":"PLsViQOs_i8z"},"source":["#### Checking Data\n","After downloading data, let's look at the actual data contents. Using `head()` method, you can refer to a portion of the data from the beginning as a sample. If nothing is specified in the parentheses, the first five lines are displayed, but if the number of lines is specified in the parentheses, only the specified number of lines are displayed. For example, `head(10)` will display 10 lines."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":746},"id":"ukQsov0b_i8z","outputId":"483284f6-812a-4c3f-aa56-9f2830b632c3","executionInfo":{"status":"ok","timestamp":1789994472426,"user_tz":-540,"elapsed":60,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","\n"," Genres English name \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space Cowboy Bebop \n","1 Action, Drama, Mystery, Sci-Fi, Space Cowboy Bebop:The Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen Trigun \n","3 Action, Mystery, Police, Supernatural, Drama, ... Witch Hunter Robin \n","4 Adventure, Fantasy, Shounen, Supernatural Beet the Vandel Buster \n","\n"," Japanese name Type Episodes \\\n","0 カウボーイビバップ TV 26 \n","1 カウボーイビバップ 天国の扉 Movie 1 \n","2 トライガン TV 26 \n","3 Witch Hunter ROBIN (ウイッチハンターロビン) TV 26 \n","4 冒険王ビィト TV 52 \n","\n"," Aired Premiered \\\n","0 Apr 3, 1998 to Apr 24, 1999 Spring 1998 \n","1 Sep 1, 2001 Unknown \n","2 Apr 1, 1998 to Sep 30, 1998 Spring 1998 \n","3 Jul 2, 2002 to Dec 24, 2002 Summer 2002 \n","4 Sep 30, 2004 to Sep 29, 2005 Fall 2004 \n","\n"," Producers \\\n","0 Bandai Visual \n","1 Sunrise, Bandai Visual \n","2 Victor Entertainment \n","3 TV Tokyo, Bandai Visual, Dentsu, Victor Entert... \n","4 TV Tokyo, Dentsu \n","\n"," Licensors Studios Source \\\n","0 Funimation, Bandai Entertainment Sunrise Original \n","1 Sony Pictures Entertainment Bones Original \n","2 Funimation, Geneon Entertainment USA Madhouse Manga \n","3 Funimation, Bandai Entertainment Sunrise Original \n","4 Unknown Toei Animation Manga \n","\n"," Duration Rating Ranked Popularity \\\n","0 24 min. per ep. R - 17+ (violence & profanity) 28.0 39 \n","1 1 hr. 55 min. R - 17+ (violence & profanity) 159.0 518 \n","2 24 min. per ep. PG-13 - Teens 13 or older 266.0 201 \n","3 25 min. per ep. PG-13 - Teens 13 or older 2481.0 1467 \n","4 23 min. per ep. PG - Children 3710.0 4369 \n","\n"," Members Favorites Watching Completed On-Hold Dropped Plan to Watch \\\n","0 1251960 61971 105808 718161 71513 26678 329800 \n","1 273145 1174 4143 208333 1935 770 57964 \n","2 558913 12944 29113 343492 25465 13925 146918 \n","3 94683 587 4300 46165 5121 5378 33719 \n","4 13224 18 642 7314 766 1108 3394 \n","\n"," Score-10 Score-9 Score-8 Score-7 Score-6 Score-5 Score-4 Score-3 \\\n","0 229170.0 182126.0 131625.0 62330.0 20688.0 8904.0 3184.0 1357.0 \n","1 30043.0 49201.0 49505.0 22632.0 5805.0 1877.0 577.0 221.0 \n","2 50229.0 75651.0 86142.0 49432.0 15376.0 5838.0 1965.0 664.0 \n","3 2182.0 4806.0 10128.0 11618.0 5709.0 2920.0 1083.0 353.0 \n","4 312.0 529.0 1242.0 1713.0 1068.0 634.0 265.0 83.0 \n","\n"," Score-2 Score-1 \n","0 741.0 1580.0 \n","1 109.0 379.0 \n","2 316.0 533.0 \n","3 164.0 131.0 \n","4 50.0 27.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","
MAL_IDNameScoreGenresEnglish nameJapanese nameTypeEpisodesAiredPremieredProducersLicensorsStudiosSourceDurationRatingRankedPopularityMembersFavoritesWatchingCompletedOn-HoldDroppedPlan to WatchScore-10Score-9Score-8Score-7Score-6Score-5Score-4Score-3Score-2Score-1
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceCowboy BebopカウボーイビバップTV26Apr 3, 1998 to Apr 24, 1999Spring 1998Bandai VisualFunimation, Bandai EntertainmentSunriseOriginal24 min. per ep.R - 17+ (violence & profanity)28.0391251960619711058087181617151326678329800229170.0182126.0131625.062330.020688.08904.03184.01357.0741.01580.0
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceCowboy Bebop:The Movieカウボーイビバップ 天国の扉Movie1Sep 1, 2001UnknownSunrise, Bandai VisualSony Pictures EntertainmentBonesOriginal1 hr. 55 min.R - 17+ (violence & profanity)159.05182731451174414320833319357705796430043.049201.049505.022632.05805.01877.0577.0221.0109.0379.0
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTrigunトライガンTV26Apr 1, 1998 to Sep 30, 1998Spring 1998Victor EntertainmentFunimation, Geneon Entertainment USAMadhouseManga24 min. per ep.PG-13 - Teens 13 or older266.02015589131294429113343492254651392514691850229.075651.086142.049432.015376.05838.01965.0664.0316.0533.0
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...Witch Hunter RobinWitch Hunter ROBIN (ウイッチハンターロビン)TV26Jul 2, 2002 to Dec 24, 2002Summer 2002TV Tokyo, Bandai Visual, Dentsu, Victor Entert...Funimation, Bandai EntertainmentSunriseOriginal25 min. per ep.PG-13 - Teens 13 or older2481.014679468358743004616551215378337192182.04806.010128.011618.05709.02920.01083.0353.0164.0131.0
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalBeet the Vandel Buster冒険王ビィトTV52Sep 30, 2004 to Sep 29, 2005Fall 2004TV Tokyo, DentsuUnknownToei AnimationManga23 min. per ep.PG - Children3710.043691322418642731476611083394312.0529.01242.01713.01068.0634.0265.083.050.027.0
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_data"}},"metadata":{},"execution_count":16}],"source":["anime_data.head()"]},{"cell_type":"markdown","metadata":{"id":"p-6inxNA_i85"},"source":["#### 3.3.3 Checking the Nature of Data\n","Looking at the data we just loaded, we know that it contains information on attributes and scores of animes, such as `Episodes` (number of episodes) and `Studios`. However, we still do not know how many data we have or what type of data we have.\n","\n","To check the number and type of data, you can use `info` as follows to find out the number of data that are not `null` and the type of variable for all variables."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"TfCgcAnY_i85","outputId":"c70c21a5-f2db-4830-9bf6-03b2c12b7d37","executionInfo":{"status":"ok","timestamp":1789994472494,"user_tz":-540,"elapsed":65,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["\n","RangeIndex: 17562 entries, 0 to 17561\n","Data columns (total 35 columns):\n"," # Column Non-Null Count Dtype \n","--- ------ -------------- ----- \n"," 0 MAL_ID 17562 non-null int64 \n"," 1 Name 17562 non-null object\n"," 2 Score 17562 non-null object\n"," 3 Genres 17562 non-null object\n"," 4 English name 17562 non-null object\n"," 5 Japanese name 17562 non-null object\n"," 6 Type 17562 non-null object\n"," 7 Episodes 17562 non-null object\n"," 8 Aired 17562 non-null object\n"," 9 Premiered 17562 non-null object\n"," 10 Producers 17562 non-null object\n"," 11 Licensors 17562 non-null object\n"," 12 Studios 17562 non-null object\n"," 13 Source 17562 non-null object\n"," 14 Duration 17562 non-null object\n"," 15 Rating 17562 non-null object\n"," 16 Ranked 17562 non-null object\n"," 17 Popularity 17562 non-null int64 \n"," 18 Members 17562 non-null int64 \n"," 19 Favorites 17562 non-null int64 \n"," 20 Watching 17562 non-null int64 \n"," 21 Completed 17562 non-null int64 \n"," 22 On-Hold 17562 non-null int64 \n"," 23 Dropped 17562 non-null int64 \n"," 24 Plan to Watch 17562 non-null int64 \n"," 25 Score-10 17562 non-null object\n"," 26 Score-9 17562 non-null object\n"," 27 Score-8 17562 non-null object\n"," 28 Score-7 17562 non-null object\n"," 29 Score-6 17562 non-null object\n"," 30 Score-5 17562 non-null object\n"," 31 Score-4 17562 non-null object\n"," 32 Score-3 17562 non-null object\n"," 33 Score-2 17562 non-null object\n"," 34 Score-1 17562 non-null object\n","dtypes: int64(9), object(26)\n","memory usage: 4.7+ MB\n"]}],"source":["# Check information on all columns\n","anime_data.info()"]},{"cell_type":"markdown","metadata":{"id":"s731D4Mw_i87"},"source":["You can also use `describe` to calculate basic statistics about quantitative data."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":300},"id":"4Nk3SSVu_i87","outputId":"87d7b7c6-4ded-42cd-e91c-9508c6dcd372","executionInfo":{"status":"ok","timestamp":1789994472594,"user_tz":-540,"elapsed":97,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Popularity Members Favorites Watching \\\n","count 17562.000000 17562.000000 1.756200e+04 17562.000000 17562.000000 \n","mean 21477.192347 8763.452340 3.465854e+04 457.746270 2231.487758 \n","std 14900.093170 5059.327278 1.252821e+05 4063.473313 14046.688133 \n","min 1.000000 0.000000 1.000000e+00 0.000000 0.000000 \n","25% 5953.500000 4383.500000 3.360000e+02 0.000000 13.000000 \n","50% 22820.000000 8762.500000 2.065000e+03 3.000000 73.000000 \n","75% 35624.750000 13145.000000 1.322325e+04 31.000000 522.000000 \n","max 48492.000000 17565.000000 2.589552e+06 183914.000000 887333.000000 \n","\n"," Completed On-Hold Dropped Plan to Watch \n","count 1.756200e+04 17562.000000 17562.000000 17562.000000 \n","mean 2.209557e+04 955.049653 1176.599533 8199.831227 \n","std 9.100919e+04 4275.675096 4740.348653 23777.691963 \n","min 0.000000e+00 0.000000 0.000000 1.000000 \n","25% 1.110000e+02 6.000000 37.000000 112.000000 \n","50% 8.175000e+02 45.000000 77.000000 752.500000 \n","75% 6.478000e+03 291.750000 271.000000 4135.500000 \n","max 2.182587e+06 187919.000000 174710.000000 425531.000000 "],"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","
MAL_IDPopularityMembersFavoritesWatchingCompletedOn-HoldDroppedPlan to Watch
count17562.00000017562.0000001.756200e+0417562.00000017562.0000001.756200e+0417562.00000017562.00000017562.000000
mean21477.1923478763.4523403.465854e+04457.7462702231.4877582.209557e+04955.0496531176.5995338199.831227
std14900.0931705059.3272781.252821e+054063.47331314046.6881339.100919e+044275.6750964740.34865323777.691963
min1.0000000.0000001.000000e+000.0000000.0000000.000000e+000.0000000.0000001.000000
25%5953.5000004383.5000003.360000e+020.00000013.0000001.110000e+026.00000037.000000112.000000
50%22820.0000008762.5000002.065000e+033.00000073.0000008.175000e+0245.00000077.000000752.500000
75%35624.75000013145.0000001.322325e+0431.000000522.0000006.478000e+03291.750000271.0000004135.500000
max48492.00000017565.0000002.589552e+06183914.000000887333.0000002.182587e+06187919.000000174710.000000425531.000000
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data\",\n \"rows\": 8,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 15535.426812780917,\n \"min\": 1.0,\n \"max\": 48492.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 21477.192347113087,\n 22820.0,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Popularity\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 6330.0710583953605,\n \"min\": 0.0,\n \"max\": 17565.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 8763.45234028015,\n 8762.5,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 906740.6776528229,\n \"min\": 1.0,\n \"max\": 2589552.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 34658.53951713928,\n 2065.0,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Favorites\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 64191.00696539134,\n \"min\": 0.0,\n \"max\": 183914.0,\n \"num_unique_values\": 7,\n \"samples\": [\n 17562.0,\n 457.7462703564514,\n 31.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Watching\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 312057.8647512516,\n \"min\": 0.0,\n \"max\": 887333.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 2231.487757658581,\n 73.0,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Completed\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 765284.7241370707,\n \"min\": 0.0,\n \"max\": 2182587.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 22095.571347226967,\n 817.5,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"On-Hold\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 65545.24738954932,\n \"min\": 0.0,\n \"max\": 187919.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 955.0496526591504,\n 45.0,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Dropped\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 60859.31359941192,\n \"min\": 0.0,\n \"max\": 174710.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 1176.5995330827925,\n 77.0,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Plan to Watch\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 147951.13547170904,\n \"min\": 1.0,\n \"max\": 425531.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 8199.831226511787,\n 752.5,\n 17562.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":18}],"source":["# Check basic statistics\n","anime_data.describe()"]},{"cell_type":"markdown","metadata":{"id":"vVYaybk6_i89"},"source":["## 3.4 DataFrame Basics\n","\n","In the following, let's learn how to handle DataFrame objects, starting with basic data manipulation."]},{"cell_type":"markdown","source":["#### Transposition\n","\n","To transpose rows and columns as in the transposition of a matrix, refer to the `.T` attribute."],"metadata":{"id":"QpPJDaHtHCh4"}},{"cell_type":"code","source":["# Transposition\n","anime_data.head().T"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":475},"id":"TbGWLs41HHPB","outputId":"b0528cf8-047c-4e56-cb56-b3bfb3b2c01f","executionInfo":{"status":"ok","timestamp":1789994472796,"user_tz":-540,"elapsed":140,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" 0 \\\n","MAL_ID 1 \n","Name Cowboy Bebop \n","Score 8.78 \n","Genres Action, Adventure, Comedy, Drama, Sci-Fi, Space \n","English name Cowboy Bebop \n","... ... \n","Score-5 8904.0 \n","Score-4 3184.0 \n","Score-3 1357.0 \n","Score-2 741.0 \n","Score-1 1580.0 \n","\n"," 1 \\\n","MAL_ID 5 \n","Name Cowboy Bebop: Tengoku no Tobira \n","Score 8.39 \n","Genres Action, Drama, Mystery, Sci-Fi, Space \n","English name Cowboy Bebop:The Movie \n","... ... \n","Score-5 1877.0 \n","Score-4 577.0 \n","Score-3 221.0 \n","Score-2 109.0 \n","Score-1 379.0 \n","\n"," 2 \\\n","MAL_ID 6 \n","Name Trigun \n","Score 8.24 \n","Genres Action, Sci-Fi, Adventure, Comedy, Drama, Shounen \n","English name Trigun \n","... ... \n","Score-5 5838.0 \n","Score-4 1965.0 \n","Score-3 664.0 \n","Score-2 316.0 \n","Score-1 533.0 \n","\n"," 3 \\\n","MAL_ID 7 \n","Name Witch Hunter Robin \n","Score 7.27 \n","Genres Action, Mystery, Police, Supernatural, Drama, ... \n","English name Witch Hunter Robin \n","... ... \n","Score-5 2920.0 \n","Score-4 1083.0 \n","Score-3 353.0 \n","Score-2 164.0 \n","Score-1 131.0 \n","\n"," 4 \n","MAL_ID 8 \n","Name Bouken Ou Beet \n","Score 6.98 \n","Genres Adventure, Fantasy, Shounen, Supernatural \n","English name Beet the Vandel Buster \n","... ... \n","Score-5 634.0 \n","Score-4 265.0 \n","Score-3 83.0 \n","Score-2 50.0 \n","Score-1 27.0 \n","\n","[35 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","
01234
MAL_ID15678
NameCowboy BebopCowboy Bebop: Tengoku no TobiraTrigunWitch Hunter RobinBouken Ou Beet
Score8.788.398.247.276.98
GenresAction, Adventure, Comedy, Drama, Sci-Fi, SpaceAction, Drama, Mystery, Sci-Fi, SpaceAction, Sci-Fi, Adventure, Comedy, Drama, ShounenAction, Mystery, Police, Supernatural, Drama, ...Adventure, Fantasy, Shounen, Supernatural
English nameCowboy BebopCowboy Bebop:The MovieTrigunWitch Hunter RobinBeet the Vandel Buster
..................
Score-58904.01877.05838.02920.0634.0
Score-43184.0577.01965.01083.0265.0
Score-31357.0221.0664.0353.083.0
Score-2741.0109.0316.0164.050.0
Score-11580.0379.0533.0131.027.0
\n","

35 rows × 5 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_data"}},"metadata":{},"execution_count":19}]},{"cell_type":"markdown","metadata":{"id":"jO7NzVmY_i8_"},"source":["### 3.4.1 Data Selection and Assignment\n","There are multiple ways to select columns and rows."]},{"cell_type":"markdown","metadata":{"id":"wriD3dA7_i9A"},"source":["#### Extracting Only a Specific Column\n","\n","To specify a column, specify the column name after the data using square brackets, `[]`."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":458},"id":"f1ybeB-q_i9A","outputId":"7c81a002-e7b8-48a3-bcd9-8cc430199430","executionInfo":{"status":"ok","timestamp":1789994472867,"user_tz":-540,"elapsed":64,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["0 8.78\n","1 8.39\n","2 8.24\n","3 7.27\n","4 6.98\n"," ... \n","17557 Unknown\n","17558 Unknown\n","17559 Unknown\n","17560 Unknown\n","17561 Unknown\n","Name: Score, Length: 17562, dtype: object"],"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","
Score
08.78
18.39
28.24
37.27
46.98
......
17557Unknown
17558Unknown
17559Unknown
17560Unknown
17561Unknown
\n","

17562 rows × 1 columns

\n","

"]},"metadata":{},"execution_count":20}],"source":["# Specify column name (if one)\n","anime_data['Score']"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":458},"id":"19oNhSr4_i9C","outputId":"4abd5966-52a8-4434-d379-ae6bbd65689c","executionInfo":{"status":"ok","timestamp":1789994473004,"user_tz":-540,"elapsed":73,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["0 8.78\n","1 8.39\n","2 8.24\n","3 7.27\n","4 6.98\n"," ... \n","17557 Unknown\n","17558 Unknown\n","17559 Unknown\n","17560 Unknown\n","17561 Unknown\n","Name: Score, Length: 17562, dtype: object"],"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","
Score
08.78
18.39
28.24
37.27
46.98
......
17557Unknown
17558Unknown
17559Unknown
17560Unknown
17561Unknown
\n","

17562 rows × 1 columns

\n","

"]},"metadata":{},"execution_count":21}],"source":["# It can also be written like this\n","anime_data.Score"]},{"cell_type":"markdown","source":["To specify multiple columns, specify them in list form."],"metadata":{"id":"rloTTJ1DIglz"}},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":423},"id":"wPp475RD_i9D","outputId":"9977a957-62d4-4fc8-e432-8f9826dc8f8d","executionInfo":{"status":"ok","timestamp":1789994473017,"user_tz":-540,"elapsed":8,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" Name Score\n","0 Cowboy Bebop 8.78\n","1 Cowboy Bebop: Tengoku no Tobira 8.39\n","2 Trigun 8.24\n","3 Witch Hunter Robin 7.27\n","4 Bouken Ou Beet 6.98\n","... ... ...\n","17557 Daomu Biji Zhi Qinling Shen Shu Unknown\n","17558 Mieruko-chan Unknown\n","17559 Higurashi no Naku Koro ni Sotsu Unknown\n","17560 Yama no Susume: Next Summit Unknown\n","17561 Scarlet Nexus Unknown\n","\n","[17562 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","
NameScore
0Cowboy Bebop8.78
1Cowboy Bebop: Tengoku no Tobira8.39
2Trigun8.24
3Witch Hunter Robin7.27
4Bouken Ou Beet6.98
.........
17557Daomu Biji Zhi Qinling Shen ShuUnknown
17558Mieruko-chanUnknown
17559Higurashi no Naku Koro ni SotsuUnknown
17560Yama no Susume: Next SummitUnknown
17561Scarlet NexusUnknown
\n","

17562 rows × 2 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data[['Name', 'Score']]\",\n \"rows\": 17562,\n \"fields\": [\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 17558,\n \"samples\": [\n \"Soukou Kijo Iris Special\",\n \"Sugar Bunnies Fleur\",\n \"Code-E\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 533,\n \"samples\": [\n \"8.06\",\n \"3.72\",\n \"6.48\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":22}],"source":["# Specify column names (if multiple)\n","anime_data[['Name', 'Score']]"]},{"cell_type":"markdown","source":["Below, we will first only use selected columns for analysis."],"metadata":{"id":"Z_QAr24AKqkP"}},{"cell_type":"code","source":["cols_to_use = [\n"," 'MAL_ID', 'Name', 'Score', 'Genres', 'Type', 'Aired', 'Studios', 'Source','Members'\n","]\n","anime_data_extracted = anime_data[cols_to_use]\n","anime_data_extracted.head()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":293},"id":"o5Xkq70bK1F-","outputId":"5ddd02a7-c69d-43b7-d536-a7f0fe596e44","executionInfo":{"status":"ok","timestamp":1789994473115,"user_tz":-540,"elapsed":96,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","\n"," Aired Studios Source Members \n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original 1251960 \n","1 Sep 1, 2001 Bones Original 273145 \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga 558913 \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga 13224 "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998MadhouseManga558913
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_data_extracted","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 17562,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14900,\n \"min\": 1,\n \"max\": 48492,\n \"num_unique_values\": 17562,\n \"samples\": [\n 40176,\n 13969,\n 13459\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 17558,\n \"samples\": [\n \"Soukou Kijo Iris Special\",\n \"Sugar Bunnies Fleur\",\n \"Code-E\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 533,\n \"samples\": [\n \"8.06\",\n \"3.72\",\n \"6.48\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 5034,\n \"samples\": [\n \"Action, Horror, Supernatural, Drama, Fantasy\",\n \"Game, Adventure, Shounen\",\n \"Music, Drama, Fantasy\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 7,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 11947,\n \"samples\": [\n \"Jan 18, 2001 to May 1, 2001\",\n \"Aug 15, 2019\",\n \"Apr 3, 2006 to Feb 6, 2009\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 1090,\n \"samples\": [\n \"Directions\",\n \"Sunrise Beyond\",\n \"10Gauge, Studio DURIAN\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"Original\",\n \"Manga\",\n \"4-koma manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 125282,\n \"min\": 1,\n \"max\": 2589552,\n \"num_unique_values\": 9508,\n \"samples\": [\n 26126,\n 104734,\n 11477\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":23}]},{"cell_type":"markdown","metadata":{"id":"8FXqLd0-_i9F"},"source":["#### Extracting Only Specific Rows\n","\n","To specify only a specific row, use `:` to specify the row. In this case, the index of the first row is specified to the left and the index of the last row +1 is specified to the right of the row to be retrieved before and after `:`."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":195},"id":"OxXEKkbC_i9F","outputId":"a6851f7a-3aa0-40da-8b97-db9910fd7576","executionInfo":{"status":"ok","timestamp":1789994473169,"user_tz":-540,"elapsed":64,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","\n"," Aired Studios Source Members \n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original 1251960 \n","1 Sep 1, 2001 Bones Original 273145 \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga 558913 "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998MadhouseManga558913
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted[0:3]\",\n \"rows\": 3,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 6,\n \"num_unique_values\": 3,\n \"samples\": [\n 1,\n 5,\n 6\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 3,\n \"samples\": [\n \"Cowboy Bebop\",\n \"Cowboy Bebop: Tengoku no Tobira\",\n \"Trigun\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 3,\n \"samples\": [\n \"8.78\",\n \"8.39\",\n \"8.24\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 3,\n \"samples\": [\n \"Action, Adventure, Comedy, Drama, Sci-Fi, Space\",\n \"Action, Drama, Mystery, Sci-Fi, Space\",\n \"Action, Sci-Fi, Adventure, Comedy, Drama, Shounen\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Movie\",\n \"TV\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 3,\n \"samples\": [\n \"Apr 3, 1998 to Apr 24, 1999\",\n \"Sep 1, 2001\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 3,\n \"samples\": [\n \"Sunrise\",\n \"Bones\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Manga\",\n \"Original\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 503331,\n \"min\": 273145,\n \"max\": 1251960,\n \"num_unique_values\": 3,\n \"samples\": [\n 1251960,\n 273145\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":24}],"source":["# Specify row name\n","anime_data_extracted[0:3]"]},{"cell_type":"markdown","metadata":{"id":"eBBpeiP3_i9G"},"source":["The same can be specified even if `Index` is a letter.\n","\n","Input:\n","```python\n","df = pd.DataFrame({\n"," 'ID': [100, 101, 102, 103],\n"," 'City': ['Tokyo', 'Osaka', 'Kyoto', 'Nagoya'],\n"," 'Birth_year': [1990, 1989, 1992, 1995],\n"," 'Name': ['Hiroshi', 'Akiko', 'Yuki', 'Satoru']\n"," index=['a', 'b', 'c', 'd']\n","})\n","\n","df['a':'c']\n","```\n","\n","Output:\n","```python\n"," ID City Birth_year Name\n"," a 100 Tokyo 1990 Hiroshi\n"," b 101 Osaka 1989 Akiko\n"," c 102 Kyoto 1992 Yuki\n","```"]},{"cell_type":"markdown","metadata":{"id":"NIudw5Yt_i9I"},"source":["#### Using `df.loc`\n","`df.loc[]` allows you to retrieve a specific row or column, like Numpy, by **specifying the label** (index name or column name).\n","\n","The following codes will retrieve specific row(s)."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":366},"id":"PhqpE2vC_i9J","outputId":"5019e760-f4aa-4547-ce28-2fdaa083429d","executionInfo":{"status":"ok","timestamp":1789994473177,"user_tz":-540,"elapsed":7,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["MAL_ID 8\n","Name Bouken Ou Beet\n","Score 6.98\n","Genres Adventure, Fantasy, Shounen, Supernatural\n","Type TV\n","Aired Sep 30, 2004 to Sep 29, 2005\n","Studios Toei Animation\n","Source Manga\n","Members 13224\n","Name: 4, dtype: object"],"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","
4
MAL_ID8
NameBouken Ou Beet
Score6.98
GenresAdventure, Fantasy, Shounen, Supernatural
TypeTV
AiredSep 30, 2004 to Sep 29, 2005
StudiosToei Animation
SourceManga
Members13224
\n","

"]},"metadata":{},"execution_count":25}],"source":["# Specify row name (if one)\n","anime_data_extracted.loc[4]"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":237},"id":"ez5ElHdL_i9K","outputId":"bf1093bc-89e0-4599-975f-8edb82f95b0c","executionInfo":{"status":"ok","timestamp":1789994473252,"user_tz":-540,"elapsed":74,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","5 15 Eyeshield 21 7.95 \n","6 16 Hachimitsu to Clover 8.06 \n","7 17 Hungry Heart: Wild Striker 7.59 \n","8 18 Initial D Fourth Stage 8.15 \n","\n"," Genres Type \\\n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","5 Action, Sports, Comedy, Shounen TV \n","6 Comedy, Drama, Josei, Romance, Slice of Life TV \n","7 Slice of Life, Comedy, Sports, Shounen TV \n","8 Action, Cars, Sports, Drama, Seinen TV \n","\n"," Aired Studios Source Members \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga 13224 \n","5 Apr 6, 2005 to Mar 19, 2008 Gallop Manga 148259 \n","6 Apr 15, 2005 to Sep 27, 2005 J.C.Staff Manga 214499 \n","7 Sep 11, 2002 to Sep 10, 2003 Nippon Animation Manga 20470 \n","8 Apr 17, 2004 to Feb 18, 2006 A.C.G.T. Manga 117929 "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224
515Eyeshield 217.95Action, Sports, Comedy, ShounenTVApr 6, 2005 to Mar 19, 2008GallopManga148259
616Hachimitsu to Clover8.06Comedy, Drama, Josei, Romance, Slice of LifeTVApr 15, 2005 to Sep 27, 2005J.C.StaffManga214499
717Hungry Heart: Wild Striker7.59Slice of Life, Comedy, Sports, ShounenTVSep 11, 2002 to Sep 10, 2003Nippon AnimationManga20470
818Initial D Fourth Stage8.15Action, Cars, Sports, Drama, SeinenTVApr 17, 2004 to Feb 18, 2006A.C.G.T.Manga117929
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 6,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 7,\n \"max\": 18,\n \"num_unique_values\": 6,\n \"samples\": [\n 7,\n 8,\n 18\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"Witch Hunter Robin\",\n \"Bouken Ou Beet\",\n \"Initial D Fourth Stage\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"7.27\",\n \"6.98\",\n \"8.15\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"Action, Mystery, Police, Supernatural, Drama, Magic\",\n \"Adventure, Fantasy, Shounen, Supernatural\",\n \"Action, Cars, Sports, Drama, Seinen\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 1,\n \"samples\": [\n \"TV\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"Jul 2, 2002 to Dec 24, 2002\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"Sunrise\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 76980,\n \"min\": 13224,\n \"max\": 214499,\n \"num_unique_values\": 6,\n \"samples\": [\n 94683\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":26}],"source":["# Specify row names (if multiple)\n","anime_data_extracted.loc[3:8]"]},{"cell_type":"markdown","source":["To extract specific column(s), you specify the column name after the comma."],"metadata":{"id":"fpdj85nRNR9q"}},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":458},"id":"EpA6DGxu_i9L","outputId":"a3514ae4-84d2-45c9-93a7-f01f06e2b8a7","executionInfo":{"status":"ok","timestamp":1789994473304,"user_tz":-540,"elapsed":63,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["0 Cowboy Bebop\n","1 Cowboy Bebop: Tengoku no Tobira\n","2 Trigun\n","3 Witch Hunter Robin\n","4 Bouken Ou Beet\n"," ... \n","17557 Daomu Biji Zhi Qinling Shen Shu\n","17558 Mieruko-chan\n","17559 Higurashi no Naku Koro ni Sotsu\n","17560 Yama no Susume: Next Summit\n","17561 Scarlet Nexus\n","Name: Name, Length: 17562, dtype: object"],"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","
Name
0Cowboy Bebop
1Cowboy Bebop: Tengoku no Tobira
2Trigun
3Witch Hunter Robin
4Bouken Ou Beet
......
17557Daomu Biji Zhi Qinling Shen Shu
17558Mieruko-chan
17559Higurashi no Naku Koro ni Sotsu
17560Yama no Susume: Next Summit
17561Scarlet Nexus
\n","

17562 rows × 1 columns

\n","

"]},"metadata":{},"execution_count":27}],"source":["# Specify column name (if one)\n","anime_data_extracted.loc[:, 'Name']"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":423},"id":"ksaqQxn2_i9N","outputId":"552ed045-0cce-4430-a5fe-494fa1384a6e","executionInfo":{"status":"ok","timestamp":1789994473309,"user_tz":-540,"elapsed":59,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name\n","0 1 Cowboy Bebop\n","1 5 Cowboy Bebop: Tengoku no Tobira\n","2 6 Trigun\n","3 7 Witch Hunter Robin\n","4 8 Bouken Ou Beet\n","... ... ...\n","17557 48481 Daomu Biji Zhi Qinling Shen Shu\n","17558 48483 Mieruko-chan\n","17559 48488 Higurashi no Naku Koro ni Sotsu\n","17560 48491 Yama no Susume: Next Summit\n","17561 48492 Scarlet Nexus\n","\n","[17562 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","
MAL_IDName
01Cowboy Bebop
15Cowboy Bebop: Tengoku no Tobira
26Trigun
37Witch Hunter Robin
48Bouken Ou Beet
.........
1755748481Daomu Biji Zhi Qinling Shen Shu
1755848483Mieruko-chan
1755948488Higurashi no Naku Koro ni Sotsu
1756048491Yama no Susume: Next Summit
1756148492Scarlet Nexus
\n","

17562 rows × 2 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 17562,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14900,\n \"min\": 1,\n \"max\": 48492,\n \"num_unique_values\": 17562,\n \"samples\": [\n 40176,\n 13969,\n 13459\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 17558,\n \"samples\": [\n \"Soukou Kijo Iris Special\",\n \"Sugar Bunnies Fleur\",\n \"Code-E\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":28}],"source":["# Specify column names (if multiple)\n","anime_data_extracted.loc[:, ['MAL_ID', 'Name']]"]},{"cell_type":"markdown","source":["Row-wise and column-wise specification can be used together as well."],"metadata":{"id":"1rwFdMVSNnMx"}},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":175},"id":"bqMiwZKr_i9O","outputId":"8e5d6f9a-768c-4736-e65f-148dae528453","executionInfo":{"status":"ok","timestamp":1789994473318,"user_tz":-540,"elapsed":8,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name\n","0 1 Cowboy Bebop\n","1 5 Cowboy Bebop: Tengoku no Tobira\n","2 6 Trigun\n","3 7 Witch Hunter Robin"],"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","
MAL_IDName
01Cowboy Bebop
15Cowboy Bebop: Tengoku no Tobira
26Trigun
37Witch Hunter Robin
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 4,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 7,\n \"num_unique_values\": 4,\n \"samples\": [\n 5,\n 7,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Cowboy Bebop: Tengoku no Tobira\",\n \"Witch Hunter Robin\",\n \"Cowboy Bebop\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":29}],"source":["# Specify 3 rows from 0 and columns 'MAL_ID' and 'Name'\n","anime_data_extracted.loc[0:3, ['MAL_ID', 'Name']]"]},{"cell_type":"markdown","metadata":{"id":"8W2rhEGz_i9Q"},"source":["#### Using `df.iloc`\n","`df.iloc[]` can retrieve a specific row or column in the same way as `df.loc[]`, but , by **specifying the location** (index number or column number)."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":175},"id":"vjmyRudD_i9Q","outputId":"86939ccd-70da-4466-baab-8ffea4d73c16","executionInfo":{"status":"ok","timestamp":1789994473512,"user_tz":-540,"elapsed":192,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Score\n","0 1 8.78\n","1 5 8.39\n","2 6 8.24\n","3 7 7.27"],"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","
MAL_IDScore
018.78
158.39
268.24
377.27
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data\",\n \"rows\": 4,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 7,\n \"num_unique_values\": 4,\n \"samples\": [\n 5,\n 7,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"8.39\",\n \"7.27\",\n \"8.78\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":30}],"source":["# Specify first 4 rows and 1st and 3rd columns\n","anime_data.iloc[0:4, [0, 2]]"]},{"cell_type":"markdown","metadata":{"id":"9naTkCrIM8j7"},"source":["#### Using of `df.at` and `df.iat`\n","\n","`df.at[]` and `df.iat[]` are used to retrieve a single element. You can retrieve a specific element in the same way as `df.loc[]` and `df.iloc[]`."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":35},"id":"TzHcuSZzNlxa","outputId":"ff0d34b1-7dc2-4fb9-ce6f-46d8827c3b5a","executionInfo":{"status":"ok","timestamp":1789994473544,"user_tz":-540,"elapsed":31,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["'Cowboy Bebop'"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"string"}},"metadata":{},"execution_count":31}],"source":["# Get 'ID' of line 0\n","anime_data.at[0, 'Name']"]},{"cell_type":"markdown","metadata":{"id":"bF6dy8xAOa20"},"source":["#### Assigning and Replacing Values\n","To create a new column can be done by using the `[]` brackets with the new column name. If you use a column name that already exists, the data will be overwritten.\n","\n"]},{"cell_type":"code","source":["# Creating new column\n","df['Score'] = np.arange(5) * 10\n","df"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"kkNGrRXcVQVl","outputId":"2656ebb5-54c2-45e4-a4f8-314363beee6e","executionInfo":{"status":"ok","timestamp":1789994473549,"user_tz":-540,"elapsed":24,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" ID City Birth_year Name Score\n","0 100 Tokyo 1990 Hiroshi 0\n","1 101 Osaka 1989 Akiko 10\n","2 102 Kyoto 1992 Yuki 20\n","3 103 Hokkaido 1997 Satoru 30\n","4 104 Tokyo 1982 Steve 40"],"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","
IDCityBirth_yearNameScore
0100Tokyo1990Hiroshi0
1101Osaka1989Akiko10
2102Kyoto1992Yuki20
3103Hokkaido1997Satoru30
4104Tokyo1982Steve40
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df","summary":"{\n \"name\": \"df\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"ID\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"101\",\n \"104\",\n \"102\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"City\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1982,\n \"max\": 1997,\n \"num_unique_values\": 5,\n \"samples\": [\n 1989,\n 1982,\n 1992\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Akiko\",\n \"Steve\",\n \"Yuki\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 15,\n \"min\": 0,\n \"max\": 40,\n \"num_unique_values\": 5,\n \"samples\": [\n 10,\n 40,\n 20\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":32}]},{"cell_type":"markdown","source":["To replace a certain element, the methods introduced in 3.4.1 (`df.loc[]`,`df.iloc[]`,`df.at[]`,`df.iat[]`) can be used."],"metadata":{"id":"oujfPxrDVVVg"}},{"cell_type":"code","source":["df.at[0, 'Birth_year'] = 2000\n","df"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"N6t7ZQ9iVh5s","outputId":"fe689ed5-526f-424c-b57e-da8567c043f7","executionInfo":{"status":"ok","timestamp":1789994473567,"user_tz":-540,"elapsed":16,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" ID City Birth_year Name Score\n","0 100 Tokyo 2000 Hiroshi 0\n","1 101 Osaka 1989 Akiko 10\n","2 102 Kyoto 1992 Yuki 20\n","3 103 Hokkaido 1997 Satoru 30\n","4 104 Tokyo 1982 Steve 40"],"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","
IDCityBirth_yearNameScore
0100Tokyo2000Hiroshi0
1101Osaka1989Akiko10
2102Kyoto1992Yuki20
3103Hokkaido1997Satoru30
4104Tokyo1982Steve40
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df","summary":"{\n \"name\": \"df\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"ID\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"101\",\n \"104\",\n \"102\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"City\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 7,\n \"min\": 1982,\n \"max\": 2000,\n \"num_unique_values\": 5,\n \"samples\": [\n 1989,\n 1982,\n 1992\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Akiko\",\n \"Steve\",\n \"Yuki\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 15,\n \"min\": 0,\n \"max\": 40,\n \"num_unique_values\": 5,\n \"samples\": [\n 10,\n 40,\n 20\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":33}]},{"cell_type":"markdown","source":["To replace all matching elements in the `DataFrame`, `replace()` method can be used. There are many ways to find the matching elements, such as using a dictionary or regular expression. See the [documentation](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.replace.html) for more details."],"metadata":{"id":"w5B6JyGpVmc4"}},{"cell_type":"markdown","metadata":{"id":"NVyVGq6h_i9S"},"source":["### 3.4.2 Extracting Data with Specific Conditions\n","\n","In a `DataFrame` object, you can extract only data that satisfy specific conditions, like Numpy. You can also combine multiple conditions as well.\n","\n","The `Type` column of the `anime_data` dataset describes the medium of anime broadcasting, such as TV, movie, OVA, etc.\n","\n","Since the dataset has some anime that does not have any scores, (`Score=Unknown`), we will exclude these rows using the conditional filtering."]},{"cell_type":"markdown","metadata":{"id":"eaTH_DR1_i9W"},"source":["The condition we specify, `anime_data['Score'] != 'Unknown'`, returns a `Series` object whose `dtype` is `bool`."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"rM5Q37Cc_i9W","outputId":"0c4d9aea-48f5-42ef-b4e3-f5e02b8cdce8","executionInfo":{"status":"ok","timestamp":1789994473700,"user_tz":-540,"elapsed":106,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["0 True\n","1 True\n","2 True\n","3 True\n","4 True\n"," ... \n","17557 False\n","17558 False\n","17559 False\n","17560 False\n","17561 False\n","Name: Score, Length: 17562, dtype: bool\n"]}],"source":["print(anime_data_extracted['Score'] != 'Unknown')"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":293},"id":"dUC1Wx-D_i9U","outputId":"d92f800f-02f7-4e4f-c8cc-64422715ae75","executionInfo":{"status":"ok","timestamp":1789994473721,"user_tz":-540,"elapsed":30,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","\n"," Aired Studios Source Members \n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original 1251960 \n","1 Sep 1, 2001 Bones Original 273145 \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga 558913 \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga 13224 "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998MadhouseManga558913
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_data_extracted","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 12421,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14494,\n \"min\": 1,\n \"max\": 48456,\n \"num_unique_values\": 12421,\n \"samples\": [\n 33027,\n 1832,\n 5649\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 12420,\n \"samples\": [\n \"Infini-T Force\",\n \"Meiou Project Zeorymer\",\n \"Injuu Onna Kyoushi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 532,\n \"samples\": [\n \"8.06\",\n \"3.72\",\n \"6.48\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4449,\n \"samples\": [\n \"Action, Historical, Military, Sci-Fi\",\n \"Mystery, Psychological, Supernatural, Thriller, Seinen\",\n \"Action, Sci-Fi, Psychological, Drama, Mecha\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 9207,\n \"samples\": [\n \"Apr 6, 1996 to Sep 21, 1996\",\n \"Mar 17, 2010\",\n \"Jan 5, 2004 to Dec 27, 2004\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 948,\n \"samples\": [\n \"Cyclone Graphics\",\n \"ILCA, DRAWIZ, Toho Interactive Animation\",\n \"Group TAC, Animaruya\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"Original\",\n \"Manga\",\n \"4-koma manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 146665,\n \"min\": 172,\n \"max\": 2589552,\n \"num_unique_values\": 9125,\n \"samples\": [\n 796,\n 514,\n 1074\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":35}],"source":["# Condition filtering\n","anime_data_extracted = anime_data_extracted[anime_data_extracted['Score'] != 'Unknown']\n","anime_data_extracted.head()"]},{"cell_type":"markdown","metadata":{"id":"ZpjJUExw_i9Y"},"source":["To specify multiple conditions, enclose the expressions with `()`. Use `&` for logical conjunction (AND) and `|` for logical disjunction (OR).\n","\n","The following example filters all anime that was produced by Nomad or Sunrise."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"Wglq1WLF_i9Y","outputId":"eb75543e-6bb7-49b3-9806-902fadb3bd45","executionInfo":{"status":"ok","timestamp":1789994473727,"user_tz":-540,"elapsed":12,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","3 7 Witch Hunter Robin 7.27 \n","18 28 Yakitate!! Japan 7.95 \n","45 64 Rozen Maiden 7.44 \n","46 65 Rozen Maiden: Träumend 7.65 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","18 Comedy, Shounen TV \n","45 Action, Comedy, Drama, Magic, Seinen TV \n","46 Action, Comedy, Drama, Magic, Seinen TV \n","\n"," Aired Studios Source Members \n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original 1251960 \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","18 Oct 12, 2004 to Mar 14, 2006 Sunrise Manga 80183 \n","45 Oct 8, 2004 to Dec 24, 2004 Nomad Manga 176775 \n","46 Oct 21, 2005 to Jan 27, 2006 Nomad Manga 93768 "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
1828Yakitate!! Japan7.95Comedy, ShounenTVOct 12, 2004 to Mar 14, 2006SunriseManga80183
4564Rozen Maiden7.44Action, Comedy, Drama, Magic, SeinenTVOct 8, 2004 to Dec 24, 2004NomadManga176775
4665Rozen Maiden: Träumend7.65Action, Comedy, Drama, Magic, SeinenTVOct 21, 2005 to Jan 27, 2006NomadManga93768
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted[(anime_data_extracted['Studios'] == 'Nomad') | (anime_data_extracted['Studios'] == 'Sunrise')]\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 30,\n \"min\": 1,\n \"max\": 65,\n \"num_unique_values\": 5,\n \"samples\": [\n 7,\n 65,\n 28\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Witch Hunter Robin\",\n \"Rozen Maiden: Tr\\u00e4umend\",\n \"Yakitate!! Japan\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"7.27\",\n \"7.65\",\n \"7.95\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Action, Mystery, Police, Supernatural, Drama, Magic\",\n \"Action, Comedy, Drama, Magic, Seinen\",\n \"Action, Adventure, Comedy, Drama, Sci-Fi, Space\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 1,\n \"samples\": [\n \"TV\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Jul 2, 2002 to Dec 24, 2002\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Nomad\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 511524,\n \"min\": 80183,\n \"max\": 1251960,\n \"num_unique_values\": 5,\n \"samples\": [\n 94683\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":36}],"source":["# 'Studios' is Nomad or Sunrise\n","anime_data_extracted[(anime_data_extracted['Studios'] == 'Nomad') | (anime_data_extracted['Studios'] == 'Sunrise')].head()"]},{"cell_type":"markdown","metadata":{"id":"xGx9SN7t_i9Z"},"source":["You can also use `isin(list)` as follows"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"LULS04CZ_i9a","outputId":"d32a7d10-1f74-46c9-b6df-8e9e5cee2282","scrolled":true,"executionInfo":{"status":"ok","timestamp":1789994473777,"user_tz":-540,"elapsed":48,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","3 7 Witch Hunter Robin 7.27 \n","18 28 Yakitate!! Japan 7.95 \n","45 64 Rozen Maiden 7.44 \n","46 65 Rozen Maiden: Träumend 7.65 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","18 Comedy, Shounen TV \n","45 Action, Comedy, Drama, Magic, Seinen TV \n","46 Action, Comedy, Drama, Magic, Seinen TV \n","\n"," Aired Studios Source Members \n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original 1251960 \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","18 Oct 12, 2004 to Mar 14, 2006 Sunrise Manga 80183 \n","45 Oct 8, 2004 to Dec 24, 2004 Nomad Manga 176775 \n","46 Oct 21, 2005 to Jan 27, 2006 Nomad Manga 93768 "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
1828Yakitate!! Japan7.95Comedy, ShounenTVOct 12, 2004 to Mar 14, 2006SunriseManga80183
4564Rozen Maiden7.44Action, Comedy, Drama, Magic, SeinenTVOct 8, 2004 to Dec 24, 2004NomadManga176775
4665Rozen Maiden: Träumend7.65Action, Comedy, Drama, Magic, SeinenTVOct 21, 2005 to Jan 27, 2006NomadManga93768
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted[anime_data_extracted['Studios']\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 30,\n \"min\": 1,\n \"max\": 65,\n \"num_unique_values\": 5,\n \"samples\": [\n 7,\n 65,\n 28\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Witch Hunter Robin\",\n \"Rozen Maiden: Tr\\u00e4umend\",\n \"Yakitate!! Japan\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"7.27\",\n \"7.65\",\n \"7.95\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Action, Mystery, Police, Supernatural, Drama, Magic\",\n \"Action, Comedy, Drama, Magic, Seinen\",\n \"Action, Adventure, Comedy, Drama, Sci-Fi, Space\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 1,\n \"samples\": [\n \"TV\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Jul 2, 2002 to Dec 24, 2002\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Nomad\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 511524,\n \"min\": 80183,\n \"max\": 1251960,\n \"num_unique_values\": 5,\n \"samples\": [\n 94683\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":37}],"source":["# 'Studios' is either 'Sunrise' or 'Nomad'\n","anime_data_extracted[anime_data_extracted['Studios'].isin(['Sunrise', 'Nomad'])].head()"]},{"cell_type":"markdown","source":["#### \n","\n","From `anime_data_extracted` that we just created, extract data where `Source` is `Manga` **and** `Members` is above 100000."],"metadata":{"id":"gP3nKjx_G3SK"}},{"cell_type":"code","source":["# WRITE ME"],"metadata":{"id":"Zn6MJ2sDG28q"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"UD2my7_b_i9g"},"source":["### 3.4.3 Determination of nan (null)\n","\n","In data analysis, **data may be missing** and the corresponding data may not exist. If they are calculated as they are, correct values will not be obtained when averages, etc. are calculated, so it is necessary to exclude them or perform other operations. Data such as missing values are stored with a special value called `nan`, and its handling is described in the following section."]},{"cell_type":"markdown","metadata":{"id":"EQaQTW0X_i9i"},"source":["#### Examples of nan and null\n","To determine if an element is `nan`, we can use the `isnull()` method."]},{"cell_type":"code","source":["anime_data_extracted.isnull()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":423},"id":"BxEV_LYGfBJW","outputId":"2135045c-9534-4ef2-96ae-1f812ffe603c","executionInfo":{"status":"ok","timestamp":1789994473890,"user_tz":-540,"elapsed":13,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score Genres Type Aired Studios Source Members\n","0 False False False False False False False False False\n","1 False False False False False False False False False\n","2 False False False False False False False False False\n","3 False False False False False False False False False\n","4 False False False False False False False False False\n","... ... ... ... ... ... ... ... ... ...\n","17504 False False False False False False False False False\n","17505 False False False False False False False False False\n","17512 False False False False False False False False False\n","17513 False False False False False False False False False\n","17552 False False False False False False False False False\n","\n","[12421 rows x 9 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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
0FalseFalseFalseFalseFalseFalseFalseFalseFalse
1FalseFalseFalseFalseFalseFalseFalseFalseFalse
2FalseFalseFalseFalseFalseFalseFalseFalseFalse
3FalseFalseFalseFalseFalseFalseFalseFalseFalse
4FalseFalseFalseFalseFalseFalseFalseFalseFalse
..............................
17504FalseFalseFalseFalseFalseFalseFalseFalseFalse
17505FalseFalseFalseFalseFalseFalseFalseFalseFalse
17512FalseFalseFalseFalseFalseFalseFalseFalseFalse
17513FalseFalseFalseFalseFalseFalseFalseFalseFalse
17552FalseFalseFalseFalseFalseFalseFalseFalseFalse
\n","

12421 rows × 9 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 12421,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"boolean\",\n \"num_unique_values\": 1,\n \"samples\": [\n false\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":41}]},{"cell_type":"markdown","metadata":{"id":"QpAYWVuq_i9k"},"source":["To find the total number of nan values, you can call the `sum()` method."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":366},"id":"CkCl6qTI_i9k","outputId":"5f87ecd8-547b-46cd-ffea-f04e721446b8","executionInfo":{"status":"ok","timestamp":1789994473947,"user_tz":-540,"elapsed":56,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["MAL_ID 0\n","Name 0\n","Score 0\n","Genres 0\n","Type 0\n","Aired 0\n","Studios 0\n","Source 0\n","Members 0\n","dtype: int64"],"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","
0
MAL_ID0
Name0
Score0
Genres0
Type0
Aired0
Studios0
Source0
Members0
\n","

"]},"metadata":{},"execution_count":42}],"source":["# Determine null and sum up\n","anime_data_extracted.isnull().sum()"]},{"cell_type":"markdown","source":["We find that there are no missing values in `anime_data_extracted`. In fact, `anime.csv` has no missing values.\n","\n","Let's check the other datasets to see if there are missing values."],"metadata":{"id":"Yeemxo6OfPvA"}},{"cell_type":"code","source":["anime_list.isnull().sum()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":241},"id":"qrRYjbzKcln6","outputId":"05255acf-ec84-4bfa-e5ca-d74cb318b81a","executionInfo":{"status":"ok","timestamp":1789994473954,"user_tz":-540,"elapsed":10,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["user_id 0\n","anime_id 0\n","rating 0\n","watching_status 0\n","watched_episodes 0\n","dtype: int64"],"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","
0
user_id0
anime_id0
rating0
watching_status0
watched_episodes0
\n","

"]},"metadata":{},"execution_count":43}]},{"cell_type":"code","source":["anime_synop.isnull().sum()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":241},"id":"t-ddh7aLfnvs","outputId":"3faf7170-ce7b-4737-cc82-cb406deee0af","executionInfo":{"status":"ok","timestamp":1789994473962,"user_tz":-540,"elapsed":7,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["MAL_ID 0\n","Name 0\n","Score 0\n","Genres 0\n","sypnopsis 8\n","dtype: int64"],"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","
0
MAL_ID0
Name0
Score0
Genres0
sypnopsis8
\n","

"]},"metadata":{},"execution_count":44}]},{"cell_type":"markdown","source":["We can see that there are 8 missing values in `anime_with_synopsis.csv`."],"metadata":{"id":"4o0RSkFafuuT"}},{"cell_type":"markdown","metadata":{"id":"F6vw4D-R_i9b"},"source":["### 3.4.4 Sorting of Values\n","\n","Data in `Series` and `DataFrame` objects can also be sorted. You can sort based on `Index` as well as the elements."]},{"cell_type":"markdown","metadata":{"id":"EPh1bRsi_i9d"},"source":["To sort by `Index`, use the `sort_index()` method as follows:"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":545},"id":"W4c7XYBd_i9d","outputId":"141d786b-942e-45dc-c5b3-8a2b19d0cdcc","executionInfo":{"status":"ok","timestamp":1789994474031,"user_tz":-540,"elapsed":8,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","... ... ... ... \n","17504 47398 Kimetsu Gakuen: Valentine-hen 6.59 \n","17505 47402 Heikousen 7.52 \n","17512 47614 Nu Wushen de Canzhuo Spring Festival Special 6.83 \n","17513 47616 Yakusoku no Neverland 2nd Season: Michishirube 4.81 \n","17552 48456 SK∞: Crazy Rock Jam 6.52 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","... ... ... \n","17504 Comedy ONA \n","17505 Music, Romance Music \n","17512 Slice of Life, Comedy Special \n","17513 Mystery, Psychological, Supernatural, Thriller... Special \n","17552 Comedy, Sports Special \n","\n"," Aired Studios Source Members \n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original 1251960 \n","1 Sep 1, 2001 Bones Original 273145 \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga 558913 \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga 13224 \n","... ... ... ... ... \n","17504 Feb 14, 2021 Unknown Original 18161 \n","17505 Feb 5, 2021 10Gauge, Studio DURIAN Original 832 \n","17512 Feb 11, 2021 Unknown Game 540 \n","17513 Feb 12, 2021 CloverWorks Manga 13070 \n","17552 Mar 14, 2021 Bones Original 10722 \n","\n","[12421 rows x 9 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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998MadhouseManga558913
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224
..............................
1750447398Kimetsu Gakuen: Valentine-hen6.59ComedyONAFeb 14, 2021UnknownOriginal18161
1750547402Heikousen7.52Music, RomanceMusicFeb 5, 202110Gauge, Studio DURIANOriginal832
1751247614Nu Wushen de Canzhuo Spring Festival Special6.83Slice of Life, ComedySpecialFeb 11, 2021UnknownGame540
1751347616Yakusoku no Neverland 2nd Season: Michishirube4.81Mystery, Psychological, Supernatural, Thriller...SpecialFeb 12, 2021CloverWorksManga13070
1755248456SK∞: Crazy Rock Jam6.52Comedy, SportsSpecialMar 14, 2021BonesOriginal10722
\n","

12421 rows × 9 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 12421,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14494,\n \"min\": 1,\n \"max\": 48456,\n \"num_unique_values\": 12421,\n \"samples\": [\n 33027,\n 1832,\n 5649\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 12420,\n \"samples\": [\n \"Infini-T Force\",\n \"Meiou Project Zeorymer\",\n \"Injuu Onna Kyoushi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 532,\n \"samples\": [\n \"8.06\",\n \"3.72\",\n \"6.48\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4449,\n \"samples\": [\n \"Action, Historical, Military, Sci-Fi\",\n \"Mystery, Psychological, Supernatural, Thriller, Seinen\",\n \"Action, Sci-Fi, Psychological, Drama, Mecha\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 9207,\n \"samples\": [\n \"Apr 6, 1996 to Sep 21, 1996\",\n \"Mar 17, 2010\",\n \"Jan 5, 2004 to Dec 27, 2004\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 948,\n \"samples\": [\n \"Cyclone Graphics\",\n \"ILCA, DRAWIZ, Toho Interactive Animation\",\n \"Group TAC, Animaruya\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"Original\",\n \"Manga\",\n \"4-koma manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 146665,\n \"min\": 172,\n \"max\": 2589552,\n \"num_unique_values\": 9125,\n \"samples\": [\n 796,\n 514,\n 1074\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":45}],"source":["# Sort by index\n","anime_data_extracted.sort_index()"]},{"cell_type":"markdown","metadata":{"id":"vHuyLKMY_i9e"},"source":["To sort by value, use the `sort_values()` method as follows. The **default is ascending order**, but you can also specify `ascending` to sort in descending order."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":545},"id":"qMuhnavh_i9f","outputId":"9c55fa65-384d-4aa8-bf00-bb21dfcebc70","executionInfo":{"status":"ok","timestamp":1789994474045,"user_tz":-540,"elapsed":9,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","3971 5114 Fullmetal Alchemist: Brotherhood 9.19 \n","15926 40028 Shingeki no Kyojin: The Final Season 9.17 \n","5683 9253 Steins;Gate 9.11 \n","14963 38524 Shingeki no Kyojin Season 3 Part 2 9.1 \n","9913 28977 Gintama° 9.1 \n","... ... ... ... \n","4204 5569 Tsui no Sora 2.26 \n","387 413 Hametsu no Mars 2.23 \n","15172 38853 Ex-Arm 2.18 \n","6967 13405 Utsu Musume Sayuri 2.01 \n","2934 3287 Tenkuu Danzai Skelter+Heaven 1.85 \n","\n"," Genres Type \\\n","3971 Action, Military, Adventure, Comedy, Drama, Ma... TV \n","15926 Action, Military, Mystery, Super Power, Drama,... TV \n","5683 Thriller, Sci-Fi TV \n","14963 Action, Drama, Fantasy, Military, Mystery, Sho... TV \n","9913 Action, Comedy, Historical, Parody, Samurai, S... TV \n","... ... ... \n","4204 Hentai OVA \n","387 Sci-Fi, Horror OVA \n","15172 Action, Sci-Fi, Ecchi, Seinen TV \n","6967 Comedy, Dementia OVA \n","2934 Sci-Fi, Mecha OVA \n","\n"," Aired Studios Source \\\n","3971 Apr 5, 2009 to Jul 4, 2010 Bones Manga \n","15926 Dec 7, 2020 to ? MAPPA Manga \n","5683 Apr 6, 2011 to Sep 14, 2011 White Fox Visual novel \n","14963 Apr 29, 2019 to Jul 1, 2019 Wit Studio Manga \n","9913 Apr 8, 2015 to Mar 30, 2016 Bandai Namco Pictures Manga \n","... ... ... ... \n","4204 Aug 10, 2002 Unknown Visual novel \n","387 Jul 6, 2005 WAO World Visual novel \n","15172 Jan 11, 2021 to ? Visual Flight Manga \n","6967 2003 Unknown Original \n","2934 Dec 8, 2004 Unknown Game \n","\n"," Members \n","3971 2248456 \n","15926 733260 \n","5683 1771162 \n","14963 1073626 \n","9913 404121 \n","... ... \n","4204 3944 \n","387 52059 \n","15172 46649 \n","6967 13450 \n","2934 24550 \n","\n","[12421 rows x 9 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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
39715114Fullmetal Alchemist: Brotherhood9.19Action, Military, Adventure, Comedy, Drama, Ma...TVApr 5, 2009 to Jul 4, 2010BonesManga2248456
1592640028Shingeki no Kyojin: The Final Season9.17Action, Military, Mystery, Super Power, Drama,...TVDec 7, 2020 to ?MAPPAManga733260
56839253Steins;Gate9.11Thriller, Sci-FiTVApr 6, 2011 to Sep 14, 2011White FoxVisual novel1771162
1496338524Shingeki no Kyojin Season 3 Part 29.1Action, Drama, Fantasy, Military, Mystery, Sho...TVApr 29, 2019 to Jul 1, 2019Wit StudioManga1073626
991328977Gintama°9.1Action, Comedy, Historical, Parody, Samurai, S...TVApr 8, 2015 to Mar 30, 2016Bandai Namco PicturesManga404121
..............................
42045569Tsui no Sora2.26HentaiOVAAug 10, 2002UnknownVisual novel3944
387413Hametsu no Mars2.23Sci-Fi, HorrorOVAJul 6, 2005WAO WorldVisual novel52059
1517238853Ex-Arm2.18Action, Sci-Fi, Ecchi, SeinenTVJan 11, 2021 to ?Visual FlightManga46649
696713405Utsu Musume Sayuri2.01Comedy, DementiaOVA2003UnknownOriginal13450
29343287Tenkuu Danzai Skelter+Heaven1.85Sci-Fi, MechaOVADec 8, 2004UnknownGame24550
\n","

12421 rows × 9 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 12421,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14494,\n \"min\": 1,\n \"max\": 48456,\n \"num_unique_values\": 12421,\n \"samples\": [\n 8150,\n 33519,\n 5152\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 12420,\n \"samples\": [\n \"Mizuiro\",\n \"Koutetsujou no Kabaneri Movie 1: Tsudou Hikari\",\n \"Dragon Ball: Ossu! Kaettekita Son Gokuu to Nakama-tachi!!\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 532,\n \"samples\": [\n \"9.04\",\n \"3.82\",\n \"7.91\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4449,\n \"samples\": [\n \"Action, Magic, Sci-Fi, Super Power\",\n \"Drama, Fantasy, Psychological, Supernatural\",\n \"Action, Adventure, Historical\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"OVA\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 9207,\n \"samples\": [\n \"Jan 15, 2010 to Mar 26, 2010\",\n \"Jul 24, 2018 to Nov 27, 2018\",\n \"Aug 12, 2020 to ?\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 948,\n \"samples\": [\n \"Ordet, Encourage Films\",\n \"KOO-KI\",\n \"Djinn Power\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"Manga\",\n \"Visual novel\",\n \"Web manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 146665,\n \"min\": 172,\n \"max\": 2589552,\n \"num_unique_values\": 9125,\n \"samples\": [\n 14820,\n 20130,\n 223731\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":46}],"source":["# Sort by value\n","anime_data_extracted.sort_values(by='Score', ascending=False)"]},{"cell_type":"markdown","source":["####\n","\n"],"metadata":{"id":"QoFV9KnuSKrK"}},{"cell_type":"markdown","source":["Using only the `sort_values()` and `head()` functions, find the names of the 10 most recently added anime in this dataset.\n","\n","Hint: Notice that `MAL_ID` values are larger for anime that were added recently, so sorting them by descending order will sort the anime from the most recent to the oldest."],"metadata":{"id":"61zbg5TDytyg"}},{"cell_type":"code","source":["# WRITE ME"],"metadata":{"id":"_Hv_8INlShCj"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["## 3.5 Merging and Concatenating Data\n","\n","We often deal with data in which each column has a non-overlapping item name, and data with each item is added as rows in the vertical direction. This section describes primary methods of **data merging** including `pd.merge()`, `DataFrame.join()`, `pd.concat()`, `DataFrame.append()`. Please refer to the [documentation](https://pandas.pydata.org/docs/user_guide/merging.html) for detailed usage of each function or method.\n","\n","We will continue using the anime dataset, which consists of three datasets, `anime.csv`, `animelist.csv`, and `anime_with_synopsis.csv`."],"metadata":{"id":"spy-cCzYjxvY"}},{"cell_type":"code","source":["print(len(anime_data))\n","anime_data.head(3)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":494},"id":"96pGMipennr9","outputId":"43064f48-35f6-41a4-f078-21097bcc389b","executionInfo":{"status":"ok","timestamp":1789994474214,"user_tz":-540,"elapsed":27,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["17562\n"]},{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","\n"," Genres English name \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space Cowboy Bebop \n","1 Action, Drama, Mystery, Sci-Fi, Space Cowboy Bebop:The Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen Trigun \n","\n"," Japanese name Type Episodes Aired Premiered \\\n","0 カウボーイビバップ TV 26 Apr 3, 1998 to Apr 24, 1999 Spring 1998 \n","1 カウボーイビバップ 天国の扉 Movie 1 Sep 1, 2001 Unknown \n","2 トライガン TV 26 Apr 1, 1998 to Sep 30, 1998 Spring 1998 \n","\n"," Producers Licensors Studios \\\n","0 Bandai Visual Funimation, Bandai Entertainment Sunrise \n","1 Sunrise, Bandai Visual Sony Pictures Entertainment Bones \n","2 Victor Entertainment Funimation, Geneon Entertainment USA Madhouse \n","\n"," Source Duration Rating Ranked \\\n","0 Original 24 min. per ep. R - 17+ (violence & profanity) 28.0 \n","1 Original 1 hr. 55 min. R - 17+ (violence & profanity) 159.0 \n","2 Manga 24 min. per ep. PG-13 - Teens 13 or older 266.0 \n","\n"," Popularity Members Favorites Watching Completed On-Hold Dropped \\\n","0 39 1251960 61971 105808 718161 71513 26678 \n","1 518 273145 1174 4143 208333 1935 770 \n","2 201 558913 12944 29113 343492 25465 13925 \n","\n"," Plan to Watch Score-10 Score-9 Score-8 Score-7 Score-6 Score-5 \\\n","0 329800 229170.0 182126.0 131625.0 62330.0 20688.0 8904.0 \n","1 57964 30043.0 49201.0 49505.0 22632.0 5805.0 1877.0 \n","2 146918 50229.0 75651.0 86142.0 49432.0 15376.0 5838.0 \n","\n"," Score-4 Score-3 Score-2 Score-1 \n","0 3184.0 1357.0 741.0 1580.0 \n","1 577.0 221.0 109.0 379.0 \n","2 1965.0 664.0 316.0 533.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","
MAL_IDNameScoreGenresEnglish nameJapanese nameTypeEpisodesAiredPremieredProducersLicensorsStudiosSourceDurationRatingRankedPopularityMembersFavoritesWatchingCompletedOn-HoldDroppedPlan to WatchScore-10Score-9Score-8Score-7Score-6Score-5Score-4Score-3Score-2Score-1
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceCowboy BebopカウボーイビバップTV26Apr 3, 1998 to Apr 24, 1999Spring 1998Bandai VisualFunimation, Bandai EntertainmentSunriseOriginal24 min. per ep.R - 17+ (violence & profanity)28.0391251960619711058087181617151326678329800229170.0182126.0131625.062330.020688.08904.03184.01357.0741.01580.0
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceCowboy Bebop:The Movieカウボーイビバップ 天国の扉Movie1Sep 1, 2001UnknownSunrise, Bandai VisualSony Pictures EntertainmentBonesOriginal1 hr. 55 min.R - 17+ (violence & profanity)159.05182731451174414320833319357705796430043.049201.049505.022632.05805.01877.0577.0221.0109.0379.0
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTrigunトライガンTV26Apr 1, 1998 to Sep 30, 1998Spring 1998Victor EntertainmentFunimation, Geneon Entertainment USAMadhouseManga24 min. per ep.PG-13 - Teens 13 or older266.02015589131294429113343492254651392514691850229.075651.086142.049432.015376.05838.01965.0664.0316.0533.0
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_data"}},"metadata":{},"execution_count":49}]},{"cell_type":"code","source":["print(len(anime_list))\n","anime_list.head(3)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":162},"id":"3o6nPqefnrB-","outputId":"8cf80902-5b95-4839-f10f-56695c848242","executionInfo":{"status":"ok","timestamp":1789994474254,"user_tz":-540,"elapsed":35,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["499\n"]},{"output_type":"execute_result","data":{"text/plain":[" user_id anime_id rating watching_status watched_episodes\n","0 0 67 9 1 1\n","1 0 6702 7 1 4\n","2 0 242 10 1 4"],"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","
user_idanime_idratingwatching_statuswatched_episodes
0067911
106702714
202421014
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_list","summary":"{\n \"name\": \"anime_list\",\n \"rows\": 499,\n \"fields\": [\n {\n \"column\": \"user_id\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 2,\n \"num_unique_values\": 3,\n \"samples\": [\n 0,\n 1,\n 2\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"anime_id\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 15041,\n \"min\": 15,\n \"max\": 42938,\n \"num_unique_values\": 447,\n \"samples\": [\n 1401,\n 24273,\n 38883\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"rating\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 0,\n \"max\": 10,\n \"num_unique_values\": 8,\n \"samples\": [\n 7,\n 6,\n 9\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"watching_status\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 6,\n \"num_unique_values\": 5,\n \"samples\": [\n 2,\n 6,\n 3\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"watched_episodes\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 59,\n \"min\": 0,\n \"max\": 958,\n \"num_unique_values\": 44,\n \"samples\": [\n 7,\n 75,\n 13\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":50}]},{"cell_type":"code","source":["print(len(anime_synop))\n","anime_synop.head(3)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":162},"id":"9JlK32p8ntDb","outputId":"9bf86d3d-a162-4988-a9f2-dc64227ab6eb","executionInfo":{"status":"ok","timestamp":1789994474334,"user_tz":-540,"elapsed":78,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["16214\n"]},{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","\n"," Genres \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space \n","1 Action, Drama, Mystery, Sci-Fi, Space \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen \n","\n"," sypnopsis \n","0 In the year 2071, humanity has colonized sever... \n","1 other day, another bounty—such is the life of ... \n","2 Vash the Stampede is the man with a $$60,000,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","
MAL_IDNameScoreGenressypnopsis
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceIn the year 2071, humanity has colonized sever...
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, Spaceother day, another bounty—such is the life of ...
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenVash the Stampede is the man with a $$60,000,0...
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_synop","summary":"{\n \"name\": \"anime_synop\",\n \"rows\": 16214,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14849,\n \"min\": 1,\n \"max\": 48492,\n \"num_unique_values\": 16214,\n \"samples\": [\n 1220,\n 38407,\n 2705\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 16210,\n \"samples\": [\n \"Shoujo Fight: Norainu-tachi no Odekake\",\n \"Sensou ga Owatta Natsu ni 1945 Karafuto\",\n \"Ashita no Joe (Movie)\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 532,\n \"samples\": [\n \"8.06\",\n \"9.0\",\n \"6.48\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4857,\n \"samples\": [\n \"Fantasy, Kids, Psychological, Slice of Life\",\n \"Action, Horror, Sci-Fi, Super Power\",\n \"Comedy, Romance, Slice of Life, Supernatural\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sypnopsis\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 15221,\n \"samples\": [\n \"ducational film about accepting another's ethnicity and cultural background in Japan.\",\n \"short story about a mountain guide dog Heiji.\",\n \"The music video of GReeeeN's song \\\"Misenai Namida wa, Kitto Itsuka\\\" follows a solitary girl as she struggles to change a world controlled by evil. It is the theme song of the live-action television series Strawberry Night .\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":51}]},{"cell_type":"markdown","source":["### 3.5.1 Merging Data\n","In this section, we will look at how to combine two sets of data. There are four possible ways to join data 1 and data 2.\n","\n","(1) Inner join (INNER JOIN): Joins data when both have keys.\n","\n","(2) Left outer join (LEFT JOIN): Joins when the data on the left side has a key.\n","\n","(3) Right outer join (RIGHT JOIN): Joins when the key of the data is on the right side.\n","\n","(4) Full outer join (FULL JOIN): Joins when the key exists on either side."],"metadata":{"id":"179OnVTDj3_1"}},{"cell_type":"markdown","source":["![join.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAG0CAIAAAAHKo0MAAAACXBIWXMAABJ0AAASdAHeZh94AAAgAElEQVR4nOydd1xT1/vH783eCQkjgxUQwpYtiIiCuKo46l5VW6utHbbW1tqv1dbqt99urVpXtW5UVARciAqKykZANrITRhghJGTf+/sjrdoWEBFy/cF9v/pHMTf3PEnu5zznPOec5wFhGAZQUFCQA4O0ASgowx1UhCgoCIND2gCUIYJxXvNkdvPsNAcEwWf//9k/h6oZLwQqQpT+A0GQVqvVarUajaalpUUikUgkEplM1tXVpVAoVCqVSqWiUqkUCoVKpdJoNDMzMz6fz+fzzczMCH/x8mLQ6/VGM1QqVVNTU319fXNzs1wuN5qhVCohCKLRaEYz6HS6ubk5n88XCARUKhWPxxOJRBwOh6AmURGivDAGg0Eul7e1tdXW1mZkZOTm5lZWVqpUKuAvD/PEz4Ag+MQ1wTAMQZDxTxaL5eTk5Ofn5+/vz+Px2Gw2jUZ7URlotdqOjo6WlpaysrKMjIy8vLz6+nqDwWBsF4PBAH95P6MZTywxmoHBYCwtLV1dXYOCgjw8PMzNzTkcDolEGuAvqw+AaHQUpY8YDIaurq6ysrKsrKyMjIz8/HyxWMzn8+3s7LhcrkAgMHo5NptNp9PpdDqFQqFQKJ2dnUaPJJfLpVKpRCIRi8UNDQ0SiaSqqkomkzk6Onp7ewcEBPj7+9vZ2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rApgk1jpybmpru3r179erV4uJiJpM5Z86cyMhIZ2fnwZMiKkKUboAgKCsr6+DBgzdu3OBwOBEREaGhofb29ng8flBDFxAEqVSq0tLSlJSU27dv43A4f3//5ubmgoICPz+/qKioCRMmcLncfmQKfiGeVOC4cOFCcnIyl8tdvHjx/PnzORzOYDSHihDlbxgMBrFYHBMTc/LkSZ1ON3Xq1LCwMBsbG1NG841VIlJSUvbt21dXV4fFYufPn2+sT2jKiqXGMokPHz48duxYWlqal5fX6tWrg4ODqVTqwDaEihDlKRqN5tatW3v27CkqKgoJCZk9e7aTk9Ngu51/I5PJEhMTz5w5o9frAwICpFJpUVFRRETEO++84+PjY+JM9RAEyWSyhISEY8eO1dfXL1q0aNmyZXZ2dgP4naA161EA4K9e//jx499++61er1+xYsWCBQusra37HfDoHxAE1dfXHzly5Pz58y4uLu++++7rr78+atQoKpV68+bNlJQUFotla2tryn4BBEEymezh4eHv76/VaqOjo4uLiwUCgZWV1UAVaUQ9IQpgMBjKysp27dp148aNUaNGLV261NbW1vSlUTQaTV5e3qFDhyQSyYwZM2bNmsXhcIxi02q1jx49Onz4cE1NzcKFC998801ra2sT+2djEDUuLm737t1arXbdunVRUVEMBuPl74x6wuGOTqfLzs7euHFjTk7O3LlzV65cyeVyTb9xRKVS3bx5c+fOnQAArF27Nioq6tnSn1gslsfj+fn5tbW1nT9/vrq62sPDw8zMzKQFzECQQCC4u7t7e3sXFxefOnUKhmFnZ+eXryqDinBYo9VqU1NTt2zZ0tra+t57702ZMmXAow59QalUXrly5eDBgw4ODh9//LG/v3+3fphGo3l5eTEYjGvXrhUWFopEIgsLCxP3FyAI8ni8oKCgjo6Os2fPymQyNzc3Op3+MvdERTh80el0SUlJmzdv1uv169evDwoKMmXs8QkKhSI2Nvbw4cO+vr4ffPCBo6NjL7oiEonOzs5WVlZxcXE5OTnOzs4CgcDE41LjbruAgACtVnvixAmpVOrh4cFkMvt9Q1SEwxStVnvjxo0vv/ySxWJ99NFHXl5eiOxdVigUZ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YII=)"],"metadata":{"id":"QQUzukavnSjS"}},{"cell_type":"markdown","source":["Reference URL: https://mathwords.net/wp-content/uploads/2017/06/tablejoin1.png"],"metadata":{"id":"Y7hiMWTUnUVq"}},{"cell_type":"markdown","source":["#### Using `pd.merge()`\n","`pd.merge()` function is often used to merge items by specifying one of the column names as a key."],"metadata":{"id":"6BlF0YPrnXdz"}},{"cell_type":"markdown","source":["##### Inner Join\n","The default join method for the merge function is inner join. You may specify a key that the two datasets have in common using the `on` argument.\n","In our example, we see that `MAL_ID` is common between `anime_data` and `anime_synop`, so it can be used as the key for the inner join. Note that more than one `key` can be specified. In such case, the column names are passed as a list."],"metadata":{"id":"kxjlNYrhnZKW"}},{"cell_type":"code","source":["# Data merging (inner join)\n","# Keys are automatically recognized\n","pd.merge(anime_data_extracted, anime_synop)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":649},"id":"b57quKu5o47i","outputId":"5497179f-465f-45a6-e66b-c0136b6a696c","executionInfo":{"status":"ok","timestamp":1789994474493,"user_tz":-540,"elapsed":165,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","... ... ... ... \n","11086 47398 Kimetsu Gakuen: Valentine-hen 6.59 \n","11087 47402 Heikousen 7.52 \n","11088 47614 Nu Wushen de Canzhuo Spring Festival Special 6.83 \n","11089 47616 Yakusoku no Neverland 2nd Season: Michishirube 4.81 \n","11090 48456 SK∞: Crazy Rock Jam 6.52 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","... ... ... \n","11086 Comedy ONA \n","11087 Music, Romance Music \n","11088 Slice of Life, Comedy Special \n","11089 Mystery, Psychological, Supernatural, Thriller... Special \n","11090 Comedy, Sports Special \n","\n"," Aired Studios Source \\\n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original \n","1 Sep 1, 2001 Bones Original \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga \n","... ... ... ... \n","11086 Feb 14, 2021 Unknown Original \n","11087 Feb 5, 2021 10Gauge, Studio DURIAN Original \n","11088 Feb 11, 2021 Unknown Game \n","11089 Feb 12, 2021 CloverWorks Manga \n","11090 Mar 14, 2021 Bones Original \n","\n"," Members sypnopsis \n","0 1251960 In the year 2071, humanity has colonized sever... \n","1 273145 other day, another bounty—such is the life of ... \n","2 558913 Vash the Stampede is the man with a $$60,000,0... \n","3 94683 ches are individuals with special powers like ... \n","4 13224 It is the dark century and the people are suff... \n","... ... ... \n","11086 18161 Valentine's Day special for Kimetsu no Yaiba .... \n","11087 832 usic video for Eve and suis' song Heikousen , ... \n","11088 540 No synopsis information has been added to this... \n","11089 13070 cap of the first season of Yakusoku no Neverla... \n","11090 10722 cap of the first 9 episodes of SK∞ . \n","\n","[11091 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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMemberssypnopsis
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960In the year 2071, humanity has colonized sever...
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145other day, another bounty—such is the life of ...
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998MadhouseManga558913Vash the Stampede is the man with a $$60,000,0...
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683ches are individuals with special powers like ...
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224It is the dark century and the people are suff...
.................................
1108647398Kimetsu Gakuen: Valentine-hen6.59ComedyONAFeb 14, 2021UnknownOriginal18161Valentine's Day special for Kimetsu no Yaiba ....
1108747402Heikousen7.52Music, RomanceMusicFeb 5, 202110Gauge, Studio DURIANOriginal832usic video for Eve and suis' song Heikousen , ...
1108847614Nu Wushen de Canzhuo Spring Festival Special6.83Slice of Life, ComedySpecialFeb 11, 2021UnknownGame540No synopsis information has been added to this...
1108947616Yakusoku no Neverland 2nd Season: Michishirube4.81Mystery, Psychological, Supernatural, Thriller...SpecialFeb 12, 2021CloverWorksManga13070cap of the first season of Yakusoku no Neverla...
1109048456SK∞: Crazy Rock Jam6.52Comedy, SportsSpecialMar 14, 2021BonesOriginal10722cap of the first 9 episodes of SK∞ .
\n","

11091 rows × 10 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 11091,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14559,\n \"min\": 1,\n \"max\": 48456,\n \"num_unique_values\": 11091,\n \"samples\": [\n 2172,\n 35629,\n 6680\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 11090,\n \"samples\": [\n \"Crayon Shin-chan Movie 15: Arashi wo Yobu Utau Ketsu dake Bakudan!\",\n \"Yao Shen Ji\",\n \"Doujouji\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 531,\n \"samples\": [\n \"3.58\",\n \"8.06\",\n \"3.8\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4275,\n \"samples\": [\n \"Action, Fantasy, Game, Military, Sci-Fi\",\n \"Comedy, Mecha, Sci-Fi, Space\",\n \"Thriller, Sci-Fi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 8138,\n \"samples\": [\n \"Apr 4, 2006 to Sep 21, 2006\",\n \"Aug 20, 2006\",\n \"Sep 16, 1989\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 897,\n \"samples\": [\n \"Bee Train, Production I.G, Madhouse, Studio 4\\u00b0C\",\n \"Gainax, Gaina\",\n \"Production I.G, Trans Arts\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"Original\",\n \"Manga\",\n \"4-koma manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 154384,\n \"min\": 172,\n \"max\": 2589552,\n \"num_unique_values\": 8422,\n \"samples\": [\n 2607,\n 51022,\n 8423\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sypnopsis\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10746,\n \"samples\": [\n \"Deep Space, many different cultures have come together to live on planet Jet. To keep the peace an organization known as the Jetters is formed. This space police group fight against the villains known as the \\\"Hige hige dan\\\" making sure that the universe is safe. The leader of the Jetters Mighty is a powerful Bomberman, who is looked up to and respected....his brother however is a lazy crude slacker named Shirobon. Suddenly Mighty disappears and Shiro finds himself placed in a new situation. Shiro steps up and become a responsible Bomberman, and with the new friends he made of the Jetters it may become possible for him to be the next \\\"Jetters leader.\\\" (Source: ANN)\",\n \"These episodes focus on ecchi and comedy and don't have anything to do with the main story of Freezing.\",\n \"cap of Kekkaishi included in DVD Vol.4.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":52}]},{"cell_type":"markdown","source":["Only the rows which `MAL_ID` is present in both dataframes are merged, so the number of rows is less than before being merged."],"metadata":{"id":"VJFsJMYLptn_"}},{"cell_type":"code","source":["# Data merging (inner join)\n","# Keys to merge can be specified explicitly using \"on\"\n","pd.merge(anime_data_extracted, anime_synop, on='MAL_ID')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":1000},"id":"KyjC-UXEpPTG","outputId":"3fde1a6d-a584-4b8c-f47e-342d132b4449","executionInfo":{"status":"ok","timestamp":1789994474553,"user_tz":-540,"elapsed":63,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name_x Score_x \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","... ... ... ... \n","11086 47398 Kimetsu Gakuen: Valentine-hen 6.59 \n","11087 47402 Heikousen 7.52 \n","11088 47614 Nu Wushen de Canzhuo Spring Festival Special 6.83 \n","11089 47616 Yakusoku no Neverland 2nd Season: Michishirube 4.81 \n","11090 48456 SK∞: Crazy Rock Jam 6.52 \n","\n"," Genres_x Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","... ... ... \n","11086 Comedy ONA \n","11087 Music, Romance Music \n","11088 Slice of Life, Comedy Special \n","11089 Mystery, Psychological, Supernatural, Thriller... Special \n","11090 Comedy, Sports Special \n","\n"," Aired Studios Source \\\n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original \n","1 Sep 1, 2001 Bones Original \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga \n","... ... ... ... \n","11086 Feb 14, 2021 Unknown Original \n","11087 Feb 5, 2021 10Gauge, Studio DURIAN Original \n","11088 Feb 11, 2021 Unknown Game \n","11089 Feb 12, 2021 CloverWorks Manga \n","11090 Mar 14, 2021 Bones Original \n","\n"," Members Name_y Score_y \\\n","0 1251960 Cowboy Bebop 8.78 \n","1 273145 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 558913 Trigun 8.24 \n","3 94683 Witch Hunter Robin 7.27 \n","4 13224 Bouken Ou Beet 6.98 \n","... ... ... ... \n","11086 18161 Kimetsu Gakuen: Valentine-hen 6.59 \n","11087 832 Heikousen 7.52 \n","11088 540 Nu Wushen de Canzhuo Spring Festival Special 6.83 \n","11089 13070 Yakusoku no Neverland 2nd Season: Michishirube 4.81 \n","11090 10722 SK∞: Crazy Rock Jam 6.52 \n","\n"," Genres_y \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space \n","1 Action, Drama, Mystery, Sci-Fi, Space \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen \n","3 Action, Mystery, Police, Supernatural, Drama, ... \n","4 Adventure, Fantasy, Shounen, Supernatural \n","... ... \n","11086 Comedy \n","11087 Music, Romance \n","11088 Slice of Life, Comedy \n","11089 Mystery, Psychological, Supernatural, Thriller... \n","11090 Comedy, Sports \n","\n"," sypnopsis \n","0 In the year 2071, humanity has colonized sever... \n","1 other day, another bounty—such is the life of ... \n","2 Vash the Stampede is the man with a $$60,000,0... \n","3 ches are individuals with special powers like ... \n","4 It is the dark century and the people are suff... \n","... ... \n","11086 Valentine's Day special for Kimetsu no Yaiba .... \n","11087 usic video for Eve and suis' song Heikousen , ... \n","11088 No synopsis information has been added to this... \n","11089 cap of the first season of Yakusoku no Neverla... \n","11090 cap of the first 9 episodes of SK∞ . \n","\n","[11091 rows x 13 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"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
MAL_IDName_xScore_xGenres_xTypeAiredStudiosSourceMembersName_yScore_yGenres_ysypnopsis
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceIn the year 2071, humanity has colonized sever...
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, Spaceother day, another bounty—such is the life of ...
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998MadhouseManga558913Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenVash the Stampede is the man with a $$60,000,0...
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...ches are individuals with special powers like ...
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalIt is the dark century and the people are suff...
..........................................
1108647398Kimetsu Gakuen: Valentine-hen6.59ComedyONAFeb 14, 2021UnknownOriginal18161Kimetsu Gakuen: Valentine-hen6.59ComedyValentine's Day special for Kimetsu no Yaiba ....
1108747402Heikousen7.52Music, RomanceMusicFeb 5, 202110Gauge, Studio DURIANOriginal832Heikousen7.52Music, Romanceusic video for Eve and suis' song Heikousen , ...
1108847614Nu Wushen de Canzhuo Spring Festival Special6.83Slice of Life, ComedySpecialFeb 11, 2021UnknownGame540Nu Wushen de Canzhuo Spring Festival Special6.83Slice of Life, ComedyNo synopsis information has been added to this...
1108947616Yakusoku no Neverland 2nd Season: Michishirube4.81Mystery, Psychological, Supernatural, Thriller...SpecialFeb 12, 2021CloverWorksManga13070Yakusoku no Neverland 2nd Season: Michishirube4.81Mystery, Psychological, Supernatural, Thriller...cap of the first season of Yakusoku no Neverla...
1109048456SK∞: Crazy Rock Jam6.52Comedy, SportsSpecialMar 14, 2021BonesOriginal10722SK∞: Crazy Rock Jam6.52Comedy, Sportscap of the first 9 episodes of SK∞ .
\n","

11091 rows × 13 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 11091,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14559,\n \"min\": 1,\n \"max\": 48456,\n \"num_unique_values\": 11091,\n \"samples\": [\n 2172,\n 35629,\n 6680\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name_x\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 11090,\n \"samples\": [\n \"Crayon Shin-chan Movie 15: Arashi wo Yobu Utau Ketsu dake Bakudan!\",\n \"Yao Shen Ji\",\n \"Doujouji\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score_x\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 531,\n \"samples\": [\n \"3.58\",\n \"8.06\",\n \"3.8\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres_x\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4275,\n \"samples\": [\n \"Action, Fantasy, Game, Military, Sci-Fi\",\n \"Comedy, Mecha, Sci-Fi, Space\",\n \"Thriller, Sci-Fi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 8138,\n \"samples\": [\n \"Apr 4, 2006 to Sep 21, 2006\",\n \"Aug 20, 2006\",\n \"Sep 16, 1989\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 897,\n \"samples\": [\n \"Bee Train, Production I.G, Madhouse, Studio 4\\u00b0C\",\n \"Gainax, Gaina\",\n \"Production I.G, Trans Arts\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"Original\",\n \"Manga\",\n \"4-koma manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 154384,\n \"min\": 172,\n \"max\": 2589552,\n \"num_unique_values\": 8422,\n \"samples\": [\n 2607,\n 51022,\n 8423\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name_y\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 11090,\n \"samples\": [\n \"Crayon Shin-chan Movie 15: Arashi wo Yobu Utau Ketsu dake Bakudan!\",\n \"Yao Shen Ji\",\n \"Doujouji\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score_y\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 531,\n \"samples\": [\n \"3.58\",\n \"8.06\",\n \"3.8\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres_y\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4275,\n \"samples\": [\n \"Action, Fantasy, Game, Military, Sci-Fi\",\n \"Comedy, Mecha, Sci-Fi, Space\",\n \"Thriller, Sci-Fi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sypnopsis\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10746,\n \"samples\": [\n \"Deep Space, many different cultures have come together to live on planet Jet. To keep the peace an organization known as the Jetters is formed. This space police group fight against the villains known as the \\\"Hige hige dan\\\" making sure that the universe is safe. The leader of the Jetters Mighty is a powerful Bomberman, who is looked up to and respected....his brother however is a lazy crude slacker named Shirobon. Suddenly Mighty disappears and Shiro finds himself placed in a new situation. Shiro steps up and become a responsible Bomberman, and with the new friends he made of the Jetters it may become possible for him to be the next \\\"Jetters leader.\\\" (Source: ANN)\",\n \"These episodes focus on ecchi and comedy and don't have anything to do with the main story of Freezing.\",\n \"cap of Kekkaishi included in DVD Vol.4.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":53}]},{"cell_type":"markdown","source":["The `left_on` and `right_on` arguments can be used to specify keys individually. In addition, the `left_index` and `right_index` arguments can be used to specify and join by `Index`.\n","\n","The following example merges `anime_list` and `anime_data`, using `anime_id` and `MAL_ID` columns, respectively, as keys."],"metadata":{"id":"LO_aVLZQqZ4U"}},{"cell_type":"code","source":["pd.merge(anime_list, anime_data_extracted, left_on='anime_id', right_on='MAL_ID')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":909},"id":"CCuvFkJiq4og","outputId":"79e43597-267a-484d-e85c-5e51357512ec","executionInfo":{"status":"ok","timestamp":1789994474643,"user_tz":-540,"elapsed":96,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" user_id anime_id rating watching_status watched_episodes MAL_ID \\\n","0 0 67 9 1 1 67 \n","1 0 6702 7 1 4 6702 \n","2 0 242 10 1 4 242 \n","3 0 4898 0 1 1 4898 \n","4 0 21 10 1 0 21 \n",".. ... ... ... ... ... ... \n","487 2 9588 0 6 0 9588 \n","488 2 10325 0 6 0 10325 \n","489 2 8111 0 6 0 8111 \n","490 2 37939 0 6 0 37939 \n","491 2 11969 0 6 0 11969 \n","\n"," Name Score \\\n","0 Basilisk: Kouga Ninpou Chou 7.58 \n","1 Fairy Tail 7.68 \n","2 Gokusen 7.42 \n","3 Kuroshitsuji 7.75 \n","4 One Piece 8.52 \n",".. ... ... \n","487 Kyouiku Shidou The Animation 6.31 \n","488 Kyuuketsuki 5.93 \n","489 Last Waltz: Hakudaku Mamire no Natsu Gasshuku 6.32 \n","490 Lilitales 6.07 \n","491 Love Bitch: Yasashii Onna 6.24 \n","\n"," Genres Type \\\n","0 Action, Adventure, Historical, Supernatural, R... TV \n","1 Action, Adventure, Comedy, Magic, Fantasy, Sho... TV \n","2 Slice of Life, Comedy, Drama, School, Josei TV \n","3 Action, Mystery, Comedy, Historical, Demons, S... TV \n","4 Action, Adventure, Comedy, Super Power, Drama,... TV \n",".. ... ... \n","487 Hentai OVA \n","488 Hentai, Vampire OVA \n","489 Hentai OVA \n","490 Hentai OVA \n","491 Hentai OVA \n","\n"," Aired Studios Source \\\n","0 Apr 13, 2005 to Sep 21, 2005 Gonzo Manga \n","1 Oct 12, 2009 to Mar 30, 2013 Satelight, A-1 Pictures Manga \n","2 Jan 6, 2004 to Mar 30, 2004 Madhouse Manga \n","3 Oct 3, 2008 to Mar 27, 2009 A-1 Pictures Manga \n","4 Oct 20, 1999 to ? Toei Animation Manga \n",".. ... ... ... \n","487 Nov 19, 2010 Studio Eromatick Visual novel \n","488 Mar 11, 2011 to Dec 21, 2012 Unknown Visual novel \n","489 Apr 30, 2010 to Oct 29, 2010 Unknown Visual novel \n","490 May 18, 2018 to Jun 29, 2018 SELFISH Game \n","491 Dec 22, 2011 Unknown Manga \n","\n"," Members \n","0 156661 \n","1 1312470 \n","2 34951 \n","3 875100 \n","4 1352724 \n",".. ... \n","487 4764 \n","488 6814 \n","489 4843 \n","490 2339 \n","491 4625 \n","\n","[492 rows x 14 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"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
user_idanime_idratingwatching_statuswatched_episodesMAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
006791167Basilisk: Kouga Ninpou Chou7.58Action, Adventure, Historical, Supernatural, R...TVApr 13, 2005 to Sep 21, 2005GonzoManga156661
1067027146702Fairy Tail7.68Action, Adventure, Comedy, Magic, Fantasy, Sho...TVOct 12, 2009 to Mar 30, 2013Satelight, A-1 PicturesManga1312470
202421014242Gokusen7.42Slice of Life, Comedy, Drama, School, JoseiTVJan 6, 2004 to Mar 30, 2004MadhouseManga34951
3048980114898Kuroshitsuji7.75Action, Mystery, Comedy, Historical, Demons, S...TVOct 3, 2008 to Mar 27, 2009A-1 PicturesManga875100
4021101021One Piece8.52Action, Adventure, Comedy, Super Power, Drama,...TVOct 20, 1999 to ?Toei AnimationManga1352724
.............................................
487295880609588Kyouiku Shidou The Animation6.31HentaiOVANov 19, 2010Studio EromatickVisual novel4764
48821032506010325Kyuuketsuki5.93Hentai, VampireOVAMar 11, 2011 to Dec 21, 2012UnknownVisual novel6814
489281110608111Last Waltz: Hakudaku Mamire no Natsu Gasshuku6.32HentaiOVAApr 30, 2010 to Oct 29, 2010UnknownVisual novel4843
49023793906037939Lilitales6.07HentaiOVAMay 18, 2018 to Jun 29, 2018SELFISHGame2339
49121196906011969Love Bitch: Yasashii Onna6.24HentaiOVADec 22, 2011UnknownManga4625
\n","

492 rows × 14 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 492,\n \"fields\": [\n {\n \"column\": \"user_id\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 2,\n \"num_unique_values\": 3,\n \"samples\": [\n 0,\n 1,\n 2\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"anime_id\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14885,\n \"min\": 15,\n \"max\": 42603,\n \"num_unique_values\": 440,\n \"samples\": [\n 4358,\n 34572,\n 34403\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"rating\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 0,\n \"max\": 10,\n \"num_unique_values\": 8,\n \"samples\": [\n 7,\n 6,\n 9\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"watching_status\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 6,\n \"num_unique_values\": 5,\n \"samples\": [\n 2,\n 6,\n 3\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"watched_episodes\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 59,\n \"min\": 0,\n \"max\": 958,\n \"num_unique_values\": 44,\n \"samples\": [\n 7,\n 75,\n 13\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14885,\n \"min\": 15,\n \"max\": 42603,\n \"num_unique_values\": 440,\n \"samples\": [\n 4358,\n 34572,\n 34403\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 440,\n \"samples\": [\n \"Aniyome wa Ijippari\",\n \"Black Clover\",\n \"Hajimete no Gal\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 232,\n \"samples\": [\n \"5.94\",\n \"8.42\",\n \"7.47\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 261,\n \"samples\": [\n \"Action, Adventure, Fantasy\",\n \"Action, Comedy, Sports, School, Shounen\",\n \"Action, Comedy, Mystery, Shounen\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"ONA\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 426,\n \"samples\": [\n \"May 25, 2012 to Jul 27, 2012\",\n \"Jan 10, 2015 to Jun 20, 2015\",\n \"Jun 22, 2007 to Jan 25, 2008\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 97,\n \"samples\": [\n \"PoRO\",\n \"David Production\",\n \"Suzuki Mirano\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 12,\n \"samples\": [\n \"Web manga\",\n \"4-koma manga\",\n \"Manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 571199,\n \"min\": 1805,\n \"max\": 2589552,\n \"num_unique_values\": 440,\n \"samples\": [\n 16826,\n 860404,\n 332807\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":54}]},{"cell_type":"markdown","source":["Suffixes can be added to the keys by using the `suffixes` argument to explicitly show which dataframe the keys originally come from. This is useful when there are duplicate columns occuring due to merging.\n","\n","```python\n","pd.merge(df1, df2, ..., suffixes=('_1', '_2'))\n","```"],"metadata":{"id":"dzOuHUj7rRgG"}},{"cell_type":"markdown","source":["##### Left Outer Join\n","Left outer joins specify `left` as the `how` argument. The following example joins the data in a `Dataframe` object to the table on the left (first argument). If the data corresponding to the left side is not on the right (second argument), it will be `NaN`.\n","\n","For this example, we will define a separate `df1` and `df2`."],"metadata":{"id":"MOZRA_KasVsw"}},{"cell_type":"code","source":["# Preparing data 1\n","data1 = {\n"," 'id': ['100', '101', '102', '103', '104', '106', '108', '110', '111',' 113'],\n"," 'city': ['Tokyo', 'Osaka', 'Kyoto', 'Hokkaido', 'Tokyo', 'Tokyo', 'Osaka', 'Kyoto', 'Hokkaido', 'Tokyo'],\n"," 'birth_year': [1990, 1989, 1992, 1997, 1982, 1991, 1988, 1990, 1995, 1981],\n"," 'name': ['Hiroshi', 'Akiko', 'Yuki', 'Satoru', 'Steeve', 'Mituru', 'Aoi', 'Tarou', 'Suguru','Mitsuo']\n","}\n","df1 = DataFrame(data1)\n","df1"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":363},"id":"a16hTRAlspdf","outputId":"dfd3ec28-0412-4ba3-dd0c-83318b8f4893","executionInfo":{"status":"ok","timestamp":1789994474650,"user_tz":-540,"elapsed":6,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name\n","0 100 Tokyo 1990 Hiroshi\n","1 101 Osaka 1989 Akiko\n","2 102 Kyoto 1992 Yuki\n","3 103 Hokkaido 1997 Satoru\n","4 104 Tokyo 1982 Steeve\n","5 106 Tokyo 1991 Mituru\n","6 108 Osaka 1988 Aoi\n","7 110 Kyoto 1990 Tarou\n","8 111 Hokkaido 1995 Suguru\n","9 113 Tokyo 1981 Mitsuo"],"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","
idcitybirth_yearname
0100Tokyo1990Hiroshi
1101Osaka1989Akiko
2102Kyoto1992Yuki
3103Hokkaido1997Satoru
4104Tokyo1982Steeve
5106Tokyo1991Mituru
6108Osaka1988Aoi
7110Kyoto1990Tarou
8111Hokkaido1995Suguru
9113Tokyo1981Mitsuo
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df1","summary":"{\n \"name\": \"df1\",\n \"rows\": 10,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"111\",\n \"101\",\n \"106\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1981,\n \"max\": 1997,\n \"num_unique_values\": 9,\n \"samples\": [\n 1995,\n 1989,\n 1991\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"Suguru\",\n \"Akiko\",\n \"Mituru\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":55}]},{"cell_type":"code","source":["# Preparing data 2\n","data2 = {\n"," 'id': ['100', '101', '102', '105', '107'],\n"," 'math': [50, 43, 33, 76, 98],\n"," 'english': [90, 30, 20, 50, 30],\n"," 'sex': ['M','F','F','M','M'],\n"," 'index_num': [0, 1, 2, 3, 4]\n","}\n","df2 = DataFrame(data2)\n","df2"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"CZXn9QcWtXCP","outputId":"13c3907b-3498-4e5c-9015-0a9647f43683","executionInfo":{"status":"ok","timestamp":1789994474662,"user_tz":-540,"elapsed":10,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id math english sex index_num\n","0 100 50 90 M 0\n","1 101 43 30 F 1\n","2 102 33 20 F 2\n","3 105 76 50 M 3\n","4 107 98 30 M 4"],"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","
idmathenglishsexindex_num
01005090M0
11014330F1
21023320F2
31057650M3
41079830M4
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df2","summary":"{\n \"name\": \"df2\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"101\",\n \"107\",\n \"102\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"math\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 26,\n \"min\": 33,\n \"max\": 98,\n \"num_unique_values\": 5,\n \"samples\": [\n 43,\n 98,\n 33\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"english\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 27,\n \"min\": 20,\n \"max\": 90,\n \"num_unique_values\": 4,\n \"samples\": [\n 30,\n 50,\n 90\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sex\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"F\",\n \"M\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"index_num\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 0,\n \"max\": 4,\n \"num_unique_values\": 5,\n \"samples\": [\n 1,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":56}]},{"cell_type":"code","source":["# Data merge(left outer join)\n","pd.merge(df1, df2, how='left')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":363},"id":"s2PI6NewtbbH","outputId":"998ee277-1d3f-4010-9120-5589382134bb","executionInfo":{"status":"ok","timestamp":1789994474777,"user_tz":-540,"elapsed":109,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name math english sex index_num\n","0 100 Tokyo 1990 Hiroshi 50.0 90.0 M 0.0\n","1 101 Osaka 1989 Akiko 43.0 30.0 F 1.0\n","2 102 Kyoto 1992 Yuki 33.0 20.0 F 2.0\n","3 103 Hokkaido 1997 Satoru NaN NaN NaN NaN\n","4 104 Tokyo 1982 Steeve NaN NaN NaN NaN\n","5 106 Tokyo 1991 Mituru NaN NaN NaN NaN\n","6 108 Osaka 1988 Aoi NaN NaN NaN NaN\n","7 110 Kyoto 1990 Tarou NaN NaN NaN NaN\n","8 111 Hokkaido 1995 Suguru NaN NaN NaN NaN\n","9 113 Tokyo 1981 Mitsuo NaN NaN NaN 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","
idcitybirth_yearnamemathenglishsexindex_num
0100Tokyo1990Hiroshi50.090.0M0.0
1101Osaka1989Akiko43.030.0F1.0
2102Kyoto1992Yuki33.020.0F2.0
3103Hokkaido1997SatoruNaNNaNNaNNaN
4104Tokyo1982SteeveNaNNaNNaNNaN
5106Tokyo1991MituruNaNNaNNaNNaN
6108Osaka1988AoiNaNNaNNaNNaN
7110Kyoto1990TarouNaNNaNNaNNaN
8111Hokkaido1995SuguruNaNNaNNaNNaN
9113Tokyo1981MitsuoNaNNaNNaNNaN
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 10,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"111\",\n \"101\",\n \"106\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1981,\n \"max\": 1997,\n \"num_unique_values\": 9,\n \"samples\": [\n 1995,\n 1989,\n 1991\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"Suguru\",\n \"Akiko\",\n \"Mituru\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"math\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 8.54400374531753,\n \"min\": 33.0,\n \"max\": 50.0,\n \"num_unique_values\": 3,\n \"samples\": [\n 50.0,\n 43.0,\n 33.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"english\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 37.859388972001824,\n \"min\": 20.0,\n \"max\": 90.0,\n \"num_unique_values\": 3,\n \"samples\": [\n 90.0,\n 30.0,\n 20.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sex\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"F\",\n \"M\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"index_num\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.0,\n \"min\": 0.0,\n \"max\": 2.0,\n \"num_unique_values\": 3,\n \"samples\": [\n 0.0,\n 1.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":57}]},{"cell_type":"markdown","source":["##### Full Outer Join\n","The previous examples join with data that exists in both data. This time, we are joining by columns that exist in either data. For a full join, the `how` argument is `outer`. If there is no value to join, it will be `NaN`."],"metadata":{"id":"oN4IQV3nte2R"}},{"cell_type":"code","source":["# Data merge(Full outer join)\n","pd.merge(df1, df2, how='outer')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":423},"id":"7qOerd1VtgWd","outputId":"f538fe77-7e3a-419c-9330-f446fb2e3a1a","executionInfo":{"status":"ok","timestamp":1789994474841,"user_tz":-540,"elapsed":61,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name math english sex index_num\n","0 113 Tokyo 1981.0 Mitsuo NaN NaN NaN NaN\n","1 100 Tokyo 1990.0 Hiroshi 50.0 90.0 M 0.0\n","2 101 Osaka 1989.0 Akiko 43.0 30.0 F 1.0\n","3 102 Kyoto 1992.0 Yuki 33.0 20.0 F 2.0\n","4 103 Hokkaido 1997.0 Satoru NaN NaN NaN NaN\n",".. ... ... ... ... ... ... ... ...\n","7 106 Tokyo 1991.0 Mituru NaN NaN NaN NaN\n","8 107 NaN NaN NaN 98.0 30.0 M 4.0\n","9 108 Osaka 1988.0 Aoi NaN NaN NaN NaN\n","10 110 Kyoto 1990.0 Tarou NaN NaN NaN NaN\n","11 111 Hokkaido 1995.0 Suguru NaN NaN NaN NaN\n","\n","[12 rows x 8 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","
idcitybirth_yearnamemathenglishsexindex_num
0113Tokyo1981.0MitsuoNaNNaNNaNNaN
1100Tokyo1990.0Hiroshi50.090.0M0.0
2101Osaka1989.0Akiko43.030.0F1.0
3102Kyoto1992.0Yuki33.020.0F2.0
4103Hokkaido1997.0SatoruNaNNaNNaNNaN
...........................
7106Tokyo1991.0MituruNaNNaNNaNNaN
8107NaNNaNNaN98.030.0M4.0
9108Osaka1988.0AoiNaNNaNNaNNaN
10110Kyoto1990.0TarouNaNNaNNaNNaN
11111Hokkaido1995.0SuguruNaNNaNNaNNaN
\n","

12 rows × 8 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 12,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 12,\n \"samples\": [\n \"110\",\n \"108\",\n \" 113\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5.01663898109747,\n \"min\": 1981.0,\n \"max\": 1997.0,\n \"num_unique_values\": 9,\n \"samples\": [\n 1988.0,\n 1990.0,\n 1982.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"Tarou\",\n \"Hiroshi\",\n \"Steeve\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"math\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 26.542418879973994,\n \"min\": 33.0,\n \"max\": 98.0,\n \"num_unique_values\": 5,\n \"samples\": [\n 43.0,\n 98.0,\n 33.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"english\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 27.92848008753788,\n \"min\": 20.0,\n \"max\": 90.0,\n \"num_unique_values\": 4,\n \"samples\": [\n 30.0,\n 50.0,\n 90.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sex\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"F\",\n \"M\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"index_num\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.5811388300841898,\n \"min\": 0.0,\n \"max\": 4.0,\n \"num_unique_values\": 5,\n \"samples\": [\n 1.0,\n 4.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":58}]},{"cell_type":"markdown","source":["#### Using `DataFrame.join()`\n","Use `DataFrame.join()` method to specify `index` as a key. Its usage is similar to `pd.merge()`. Refer to the [documentation](https://pandas.pydata.org/docs/user_guide/merging.html) for detailed usage."],"metadata":{"id":"xos_etaTtkew"}},{"cell_type":"markdown","source":["#### \n","\n","Let's do an internal join between the following two data tables with the same `id` value."],"metadata":{"id":"_8cD4T9duL0Q"}},{"cell_type":"code","source":["# Prepare data4\n","data4 = {\n"," 'id': ['0', '1', '2', '3', '4', '6', '8', '11', '12', '13'],\n"," 'city': ['Tokyo', 'Osaka', 'Kyoto', 'Hokkaido', 'Tokyo', 'Tokyo', 'Osaka', 'Kyoto', 'Hokkaido', 'Tokyo'],\n"," 'birth_year': [1990, 1989, 1992, 1997, 1982, 1991, 1988, 1990, 1995, 1981],\n"," 'name': ['Hiroshi', 'Akiko', 'Yuki', 'Satoru', 'Steeve', 'Mituru', 'Aoi', 'Tarou', 'Suguru', 'Mitsuo']\n","}\n","df4 = DataFrame(data4)\n","df4"],"metadata":{"id":"BuDP2D3RuNPN","colab":{"base_uri":"https://localhost:8080/","height":363},"outputId":"5d01feae-459c-461f-9f09-4f4dd8ef8fec","executionInfo":{"status":"ok","timestamp":1789994474897,"user_tz":-540,"elapsed":54,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name\n","0 0 Tokyo 1990 Hiroshi\n","1 1 Osaka 1989 Akiko\n","2 2 Kyoto 1992 Yuki\n","3 3 Hokkaido 1997 Satoru\n","4 4 Tokyo 1982 Steeve\n","5 6 Tokyo 1991 Mituru\n","6 8 Osaka 1988 Aoi\n","7 11 Kyoto 1990 Tarou\n","8 12 Hokkaido 1995 Suguru\n","9 13 Tokyo 1981 Mitsuo"],"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","
idcitybirth_yearname
00Tokyo1990Hiroshi
11Osaka1989Akiko
22Kyoto1992Yuki
33Hokkaido1997Satoru
44Tokyo1982Steeve
56Tokyo1991Mituru
68Osaka1988Aoi
711Kyoto1990Tarou
812Hokkaido1995Suguru
913Tokyo1981Mitsuo
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df4","summary":"{\n \"name\": \"df4\",\n \"rows\": 10,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"12\",\n \"1\",\n \"6\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1981,\n \"max\": 1997,\n \"num_unique_values\": 9,\n \"samples\": [\n 1995,\n 1989,\n 1991\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"Suguru\",\n \"Akiko\",\n \"Mituru\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":59}]},{"cell_type":"code","source":["# Prepare data5\n","data5 = {\n"," 'id': ['0', '1', '3', '6', '8'],\n"," 'math' : [20, 30, 50, 70, 90],\n"," 'english': [30, 50, 50, 70, 20],\n"," 'sex': ['M', 'F', 'F', 'M', 'M'],\n"," 'index_num': [0, 1, 2, 3, 4]\n","}\n","df5 = DataFrame(data5)\n","df5"],"metadata":{"id":"TT7LTtHBuOJN","colab":{"base_uri":"https://localhost:8080/","height":206},"outputId":"3ffe3a28-b56b-46e7-d4dd-7a363aa2a81f","executionInfo":{"status":"ok","timestamp":1789994474906,"user_tz":-540,"elapsed":57,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id math english sex index_num\n","0 0 20 30 M 0\n","1 1 30 50 F 1\n","2 3 50 50 F 2\n","3 6 70 70 M 3\n","4 8 90 20 M 4"],"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","
idmathenglishsexindex_num
002030M0
113050F1
235050F2
367070M3
489020M4
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df5","summary":"{\n \"name\": \"df5\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"1\",\n \"8\",\n \"3\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"math\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 28,\n \"min\": 20,\n \"max\": 90,\n \"num_unique_values\": 5,\n \"samples\": [\n 30,\n 90,\n 50\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"english\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 19,\n \"min\": 20,\n \"max\": 70,\n \"num_unique_values\": 4,\n \"samples\": [\n 50,\n 20,\n 30\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sex\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"F\",\n \"M\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"index_num\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 0,\n \"max\": 4,\n \"num_unique_values\": 5,\n \"samples\": [\n 1,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":60}]},{"cell_type":"code","source":["# write me!"],"metadata":{"id":"XZOw8flvuPMt"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["Data scientists frequently use the techniques in this section whenever their dataset is split across multiple tables or files. This is a very comon structure in real-world databases, logging systems, and data pipelines."],"metadata":{"id":"aKrObR1SrbnU"}},{"cell_type":"markdown","source":["### 3.5.2 Concatenating Data\n","`pd.concat` is used to concatenate data without specifying keys."],"metadata":{"id":"juuSM8ZOkCWA"}},{"cell_type":"markdown","source":["#### Vertical join\n","The default is to simply connect vertically. The `pd.concat()` is often used to vertically stack data with identical columns."],"metadata":{"id":"mCvf97KntxWR"}},{"cell_type":"code","source":["# Prepare Data 3\n","data3 = {\n"," 'id': ['117', '118', '119', '120', '125'],\n"," 'city': ['Chiba', 'Kanagawa', 'Tokyo', 'Fukuoka', 'Okinawa'],\n"," 'birth_year': [1990, 1989, 1992, 1997, 1982],\n"," 'name': ['Suguru', 'Kouichi', 'Satochi', 'Yukie', 'Akari']\n","}\n","df3 = DataFrame(data3)\n","df3"],"metadata":{"id":"-PgCdvbft9-h","colab":{"base_uri":"https://localhost:8080/","height":206},"outputId":"aec2fcf1-8ec4-4a91-9058-49478739843f","executionInfo":{"status":"ok","timestamp":1789994474985,"user_tz":-540,"elapsed":69,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name\n","0 117 Chiba 1990 Suguru\n","1 118 Kanagawa 1989 Kouichi\n","2 119 Tokyo 1992 Satochi\n","3 120 Fukuoka 1997 Yukie\n","4 125 Okinawa 1982 Akari"],"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","
idcitybirth_yearname
0117Chiba1990Suguru
1118Kanagawa1989Kouichi
2119Tokyo1992Satochi
3120Fukuoka1997Yukie
4125Okinawa1982Akari
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df3","summary":"{\n \"name\": \"df3\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"118\",\n \"125\",\n \"119\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Kanagawa\",\n \"Okinawa\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1982,\n \"max\": 1997,\n \"num_unique_values\": 5,\n \"samples\": [\n 1989,\n 1982,\n 1992\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Kouichi\",\n \"Akari\",\n \"Satochi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":62}]},{"cell_type":"code","source":["# concat vertically\n","pd.concat([df1, df3])"],"metadata":{"id":"w60XWzIQt_Ov","colab":{"base_uri":"https://localhost:8080/","height":423},"outputId":"e9a4e0f8-653c-42f5-c9e3-e3772d79b4ea","executionInfo":{"status":"ok","timestamp":1789994474994,"user_tz":-540,"elapsed":7,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name\n","0 100 Tokyo 1990 Hiroshi\n","1 101 Osaka 1989 Akiko\n","2 102 Kyoto 1992 Yuki\n","3 103 Hokkaido 1997 Satoru\n","4 104 Tokyo 1982 Steeve\n",".. ... ... ... ...\n","0 117 Chiba 1990 Suguru\n","1 118 Kanagawa 1989 Kouichi\n","2 119 Tokyo 1992 Satochi\n","3 120 Fukuoka 1997 Yukie\n","4 125 Okinawa 1982 Akari\n","\n","[15 rows x 4 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","
idcitybirth_yearname
0100Tokyo1990Hiroshi
1101Osaka1989Akiko
2102Kyoto1992Yuki
3103Hokkaido1997Satoru
4104Tokyo1982Steeve
...............
0117Chiba1990Suguru
1118Kanagawa1989Kouichi
2119Tokyo1992Satochi
3120Fukuoka1997Yukie
4125Okinawa1982Akari
\n","

15 rows × 4 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 15,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 15,\n \"samples\": [\n \" 113\",\n \"118\",\n \"100\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 8,\n \"samples\": [\n \"Osaka\",\n \"Kanagawa\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 1981,\n \"max\": 1997,\n \"num_unique_values\": 9,\n \"samples\": [\n 1995,\n 1989,\n 1991\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 14,\n \"samples\": [\n \"Mitsuo\",\n \"Satochi\",\n \"Hiroshi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":63}]},{"cell_type":"markdown","source":["In the above, the `index` was combined as is, but by setting `ignore_index=True`, it is possible to reattach the `index` in order from the top."],"metadata":{"id":"_GXU4L2BuCPY"}},{"cell_type":"code","source":["pd.concat([df1, df3], ignore_index=True)"],"metadata":{"id":"Rv9t8tbeuDsz","colab":{"base_uri":"https://localhost:8080/","height":423},"outputId":"79701cb1-da69-40bd-9f1a-b1c37cf7b4a5","executionInfo":{"status":"ok","timestamp":1789994475055,"user_tz":-540,"elapsed":9,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name\n","0 100 Tokyo 1990 Hiroshi\n","1 101 Osaka 1989 Akiko\n","2 102 Kyoto 1992 Yuki\n","3 103 Hokkaido 1997 Satoru\n","4 104 Tokyo 1982 Steeve\n",".. ... ... ... ...\n","10 117 Chiba 1990 Suguru\n","11 118 Kanagawa 1989 Kouichi\n","12 119 Tokyo 1992 Satochi\n","13 120 Fukuoka 1997 Yukie\n","14 125 Okinawa 1982 Akari\n","\n","[15 rows x 4 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","
idcitybirth_yearname
0100Tokyo1990Hiroshi
1101Osaka1989Akiko
2102Kyoto1992Yuki
3103Hokkaido1997Satoru
4104Tokyo1982Steeve
...............
10117Chiba1990Suguru
11118Kanagawa1989Kouichi
12119Tokyo1992Satochi
13120Fukuoka1997Yukie
14125Okinawa1982Akari
\n","

15 rows × 4 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 15,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 15,\n \"samples\": [\n \" 113\",\n \"118\",\n \"100\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 8,\n \"samples\": [\n \"Osaka\",\n \"Kanagawa\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 1981,\n \"max\": 1997,\n \"num_unique_values\": 9,\n \"samples\": [\n 1995,\n 1989,\n 1991\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 14,\n \"samples\": [\n \"Mitsuo\",\n \"Satochi\",\n \"Hiroshi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":64}]},{"cell_type":"markdown","source":["When joining vertically with `pd.concat()`, the joining is done by column name. If the column names are different and there is no value to join, `Nan` is entered. The `sort` argument can be set to `True` to sort the `column`, or to `False` to join without sorting."],"metadata":{"id":"PVVyY63LuFKN"}},{"cell_type":"code","source":["# In case of sort = True\n","pd.concat([df1, df2], sort=True)"],"metadata":{"id":"yKRtunbPuHie","colab":{"base_uri":"https://localhost:8080/","height":423},"outputId":"d667c445-7235-4471-94d0-bd92533536b0","executionInfo":{"status":"ok","timestamp":1789994475140,"user_tz":-540,"elapsed":81,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" birth_year city english id index_num math name sex\n","0 1990.0 Tokyo NaN 100 NaN NaN Hiroshi NaN\n","1 1989.0 Osaka NaN 101 NaN NaN Akiko NaN\n","2 1992.0 Kyoto NaN 102 NaN NaN Yuki NaN\n","3 1997.0 Hokkaido NaN 103 NaN NaN Satoru NaN\n","4 1982.0 Tokyo NaN 104 NaN NaN Steeve NaN\n",".. ... ... ... ... ... ... ... ...\n","0 NaN NaN 90.0 100 0.0 50.0 NaN M\n","1 NaN NaN 30.0 101 1.0 43.0 NaN F\n","2 NaN NaN 20.0 102 2.0 33.0 NaN F\n","3 NaN NaN 50.0 105 3.0 76.0 NaN M\n","4 NaN NaN 30.0 107 4.0 98.0 NaN M\n","\n","[15 rows x 8 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","
birth_yearcityenglishidindex_nummathnamesex
01990.0TokyoNaN100NaNNaNHiroshiNaN
11989.0OsakaNaN101NaNNaNAkikoNaN
21992.0KyotoNaN102NaNNaNYukiNaN
31997.0HokkaidoNaN103NaNNaNSatoruNaN
41982.0TokyoNaN104NaNNaNSteeveNaN
...........................
0NaNNaN90.01000.050.0NaNM
1NaNNaN30.01011.043.0NaNF
2NaNNaN20.01022.033.0NaNF
3NaNNaN50.01053.076.0NaNM
4NaNNaN30.01074.098.0NaNM
\n","

15 rows × 8 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 15,\n \"fields\": [\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5.01663898109747,\n \"min\": 1981.0,\n \"max\": 1997.0,\n \"num_unique_values\": 9,\n \"samples\": [\n 1995.0,\n 1989.0,\n 1991.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"english\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 27.92848008753788,\n \"min\": 20.0,\n \"max\": 90.0,\n \"num_unique_values\": 4,\n \"samples\": [\n 30.0,\n 50.0,\n 90.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 12,\n \"samples\": [\n \"105\",\n \" 113\",\n \"100\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"index_num\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.5811388300841898,\n \"min\": 0.0,\n \"max\": 4.0,\n \"num_unique_values\": 5,\n \"samples\": [\n 1.0,\n 4.0,\n 2.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"math\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 26.542418879973994,\n \"min\": 33.0,\n \"max\": 98.0,\n \"num_unique_values\": 5,\n \"samples\": [\n 43.0,\n 98.0,\n 33.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"Suguru\",\n \"Akiko\",\n \"Mituru\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sex\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"F\",\n \"M\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":65}]},{"cell_type":"markdown","source":["#### Horizontal Join\n","To join horizontally, specify an axis for the `axis` argument. The `axis=0` is the row and `axis=1` is the column. So here you need to specify `axis=1`. In this case, they will be tied by `index` and the `columns` will be joined as they are. If `axis=0` is specified, the columns will be joined vertically. Keep in mind that this `axis` argument is used in other situations as well."],"metadata":{"id":"QbmPoZ5xuI1d"}},{"cell_type":"code","source":["pd.concat([df1, df2], axis=1)"],"metadata":{"id":"ZG5MDbZiuKen","colab":{"base_uri":"https://localhost:8080/","height":363},"outputId":"890976a6-4b0c-4d48-826c-cec0873401e6","executionInfo":{"status":"ok","timestamp":1789994475248,"user_tz":-540,"elapsed":106,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name id math english sex index_num\n","0 100 Tokyo 1990 Hiroshi 100 50.0 90.0 M 0.0\n","1 101 Osaka 1989 Akiko 101 43.0 30.0 F 1.0\n","2 102 Kyoto 1992 Yuki 102 33.0 20.0 F 2.0\n","3 103 Hokkaido 1997 Satoru 105 76.0 50.0 M 3.0\n","4 104 Tokyo 1982 Steeve 107 98.0 30.0 M 4.0\n","5 106 Tokyo 1991 Mituru NaN NaN NaN NaN NaN\n","6 108 Osaka 1988 Aoi NaN NaN NaN NaN NaN\n","7 110 Kyoto 1990 Tarou NaN NaN NaN NaN NaN\n","8 111 Hokkaido 1995 Suguru NaN NaN NaN NaN NaN\n","9 113 Tokyo 1981 Mitsuo NaN NaN NaN NaN 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","
idcitybirth_yearnameidmathenglishsexindex_num
0100Tokyo1990Hiroshi10050.090.0M0.0
1101Osaka1989Akiko10143.030.0F1.0
2102Kyoto1992Yuki10233.020.0F2.0
3103Hokkaido1997Satoru10576.050.0M3.0
4104Tokyo1982Steeve10798.030.0M4.0
5106Tokyo1991MituruNaNNaNNaNNaNNaN
6108Osaka1988AoiNaNNaNNaNNaNNaN
7110Kyoto1990TarouNaNNaNNaNNaNNaN
8111Hokkaido1995SuguruNaNNaNNaNNaNNaN
9113Tokyo1981MitsuoNaNNaNNaNNaNNaN
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 10,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"111\",\n \"101\",\n \"106\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Osaka\",\n \"Hokkaido\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 5,\n \"min\": 1981,\n \"max\": 1997,\n \"num_unique_values\": 9,\n \"samples\": [\n 1995,\n 1989,\n 1991\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"Suguru\",\n \"Akiko\",\n \"Mituru\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"101\",\n \"107\",\n \"102\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"math\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 26.542418879973994,\n \"min\": 33.0,\n \"max\": 98.0,\n \"num_unique_values\": 5,\n \"samples\": [\n 43.0,\n 98.0,\n 33.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"english\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 27.92848008753788,\n \"min\": 20.0,\n \"max\": 90.0,\n \"num_unique_values\": 4,\n \"samples\": [\n 30.0,\n 50.0,\n 90.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"sex\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"F\",\n \"M\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"index_num\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.5811388300841898,\n \"min\": 0.0,\n \"max\": 4.0,\n \"num_unique_values\": 5,\n \"samples\": [\n 1.0,\n 4.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":66}]},{"cell_type":"markdown","source":["#### \n","Using the data from , let's vertically join the following data for `df4`."],"metadata":{"id":"8RNb6LNNuQ5T"}},{"cell_type":"code","source":["# Preparing data\n","data6 = {\n"," 'id': ['70', '80', '90', '120', '150'],\n"," 'city': ['Chiba', 'Kanagawa', 'Tokyo', 'Fukuoka', 'Okinawa'],\n"," 'birth_year': [1980, 1999, 1995, 1994, 1994],\n"," 'name': ['Suguru', 'Kouichi', 'Satochi', 'Yukie', 'Akari']\n","}\n","df6 = DataFrame(data6)\n","df6"],"metadata":{"id":"_wDxLL59uTAh","colab":{"base_uri":"https://localhost:8080/","height":206},"outputId":"fe537bf8-ef5d-4224-f905-5968bc8ce691","executionInfo":{"status":"ok","timestamp":1789994475260,"user_tz":-540,"elapsed":6,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" id city birth_year name\n","0 70 Chiba 1980 Suguru\n","1 80 Kanagawa 1999 Kouichi\n","2 90 Tokyo 1995 Satochi\n","3 120 Fukuoka 1994 Yukie\n","4 150 Okinawa 1994 Akari"],"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","
idcitybirth_yearname
070Chiba1980Suguru
180Kanagawa1999Kouichi
290Tokyo1995Satochi
3120Fukuoka1994Yukie
4150Okinawa1994Akari
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"df6","summary":"{\n \"name\": \"df6\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"id\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"80\",\n \"150\",\n \"90\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"city\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Kanagawa\",\n \"Okinawa\",\n \"Tokyo\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"birth_year\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 7,\n \"min\": 1980,\n \"max\": 1999,\n \"num_unique_values\": 4,\n \"samples\": [\n 1999,\n 1994,\n 1980\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Kouichi\",\n \"Akari\",\n \"Satochi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":67}]},{"cell_type":"code","source":["# write me!"],"metadata":{"id":"kqIJnCK9uUEW"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["Data scientists primarily use concatenation to stack datasets vertically when combining daily or monthly files into a single master table, or to glue new variables side-by-side horizontally. It serves as an easy way to append clean, structurally identical data without needing complex database keys."],"metadata":{"id":"h_wip13csnv3"}},{"cell_type":"markdown","source":["## 3.6 Manipulating and Transforming Data"],"metadata":{"id":"GRaLPfoYkICs"}},{"cell_type":"markdown","source":["### 3.6.1 Deleting Data\n","To delete columns or rows in a `DataFrame` object, you mainly use `drop()` method.\n","\n","For deleting rows: Specify the `Index` of the rows you want to delete as a list in the first argument. Set `axis` to **0**.\n","\n","For deleting columns: Specify the column names you want to delete as a list in the first argument. Set `axis` to **1**.\n","\n"," The following example shows how to delete some rows from `anime_data_extracted`."],"metadata":{"id":"TmLZwEpavN85"}},{"cell_type":"code","source":["# Delete rows in data\n","# axis=0 is set by default\n","anime_data_extracted.drop(index=[0,2]).head()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":275},"id":"g7g3cr8nxNl_","outputId":"86618049-9f32-4e6a-f3c6-2de348321545","executionInfo":{"status":"ok","timestamp":1789994475278,"user_tz":-540,"elapsed":8,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","5 15 Eyeshield 21 7.95 \n","6 16 Hachimitsu to Clover 8.06 \n","\n"," Genres Type \\\n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","5 Action, Sports, Comedy, Shounen TV \n","6 Comedy, Drama, Josei, Romance, Slice of Life TV \n","\n"," Aired Studios Source Members \n","1 Sep 1, 2001 Bones Original 273145 \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga 13224 \n","5 Apr 6, 2005 to Mar 19, 2008 Gallop Manga 148259 \n","6 Apr 15, 2005 to Sep 27, 2005 J.C.Staff Manga 214499 "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224
515Eyeshield 217.95Action, Sports, Comedy, ShounenTVApr 6, 2005 to Mar 19, 2008GallopManga148259
616Hachimitsu to Clover8.06Comedy, Drama, Josei, Romance, Slice of LifeTVApr 15, 2005 to Sep 27, 2005J.C.StaffManga214499
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 5,\n \"max\": 16,\n \"num_unique_values\": 5,\n \"samples\": [\n 7,\n 16,\n 8\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Witch Hunter Robin\",\n \"Hachimitsu to Clover\",\n \"Bouken Ou Beet\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"7.27\",\n \"8.06\",\n \"6.98\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Action, Mystery, Police, Supernatural, Drama, Magic\",\n \"Comedy, Drama, Josei, Romance, Slice of Life\",\n \"Adventure, Fantasy, Shounen, Supernatural\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"TV\",\n \"Movie\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Jul 2, 2002 to Dec 24, 2002\",\n \"Apr 15, 2005 to Sep 27, 2005\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Sunrise\",\n \"J.C.Staff\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Manga\",\n \"Original\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 101350,\n \"min\": 13224,\n \"max\": 273145,\n \"num_unique_values\": 5,\n \"samples\": [\n 94683,\n 214499\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":69}]},{"cell_type":"markdown","source":["Here, the `Index` is no longer continuous because a row has been deleted. So let's use `DataFrame.reset_index()` to reassign a new `Index`."],"metadata":{"id":"wo6vYZGaxgn2"}},{"cell_type":"code","source":["anime_data_extracted.drop(index=[0,2]).reset_index().head()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":293},"id":"X-3fo8hZxkXK","outputId":"5c1c51d3-bedf-4705-d8a0-2134f8d8a279","executionInfo":{"status":"ok","timestamp":1789994475427,"user_tz":-540,"elapsed":150,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" index MAL_ID Name Score \\\n","0 1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","1 3 7 Witch Hunter Robin 7.27 \n","2 4 8 Bouken Ou Beet 6.98 \n","3 5 15 Eyeshield 21 7.95 \n","4 6 16 Hachimitsu to Clover 8.06 \n","\n"," Genres Type \\\n","0 Action, Drama, Mystery, Sci-Fi, Space Movie \n","1 Action, Mystery, Police, Supernatural, Drama, ... TV \n","2 Adventure, Fantasy, Shounen, Supernatural TV \n","3 Action, Sports, Comedy, Shounen TV \n","4 Comedy, Drama, Josei, Romance, Slice of Life TV \n","\n"," Aired Studios Source Members \n","0 Sep 1, 2001 Bones Original 273145 \n","1 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","2 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga 13224 \n","3 Apr 6, 2005 to Mar 19, 2008 Gallop Manga 148259 \n","4 Apr 15, 2005 to Sep 27, 2005 J.C.Staff Manga 214499 "],"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","
indexMAL_IDNameScoreGenresTypeAiredStudiosSourceMembers
015Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145
137Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683
248Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224
3515Eyeshield 217.95Action, Sports, Comedy, ShounenTVApr 6, 2005 to Mar 19, 2008GallopManga148259
4616Hachimitsu to Clover8.06Comedy, Drama, Josei, Romance, Slice of LifeTVApr 15, 2005 to Sep 27, 2005J.C.StaffManga214499
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"index\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 1,\n \"max\": 6,\n \"num_unique_values\": 5,\n \"samples\": [\n 3,\n 6,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 5,\n \"max\": 16,\n \"num_unique_values\": 5,\n \"samples\": [\n 7,\n 16,\n 8\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Witch Hunter Robin\",\n \"Hachimitsu to Clover\",\n \"Bouken Ou Beet\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"7.27\",\n \"8.06\",\n \"6.98\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Action, Mystery, Police, Supernatural, Drama, Magic\",\n \"Comedy, Drama, Josei, Romance, Slice of Life\",\n \"Adventure, Fantasy, Shounen, Supernatural\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"TV\",\n \"Movie\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Jul 2, 2002 to Dec 24, 2002\",\n \"Apr 15, 2005 to Sep 27, 2005\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Sunrise\",\n \"J.C.Staff\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Manga\",\n \"Original\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 101350,\n \"min\": 13224,\n \"max\": 273145,\n \"num_unique_values\": 5,\n \"samples\": [\n 94683,\n 214499\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":70}]},{"cell_type":"markdown","source":["Above you can see that the original `Index` has become a new `column`. If you want to delete the original `Index`, set `drop=True`."],"metadata":{"id":"zECGYSeRxqCL"}},{"cell_type":"markdown","source":[" The following example shows how to delete the `Studios` column from `anime_data_extracted`."],"metadata":{"id":"X9o_1aMzxGX6"}},{"cell_type":"code","source":["# Delete column in data\n","anime_data_extracted.drop(['Studios'], axis=1).head()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"S-wWHZKqvhl_","outputId":"3430bb4a-e006-42d9-ca00-1aeb6f7e8280","executionInfo":{"status":"ok","timestamp":1789994475431,"user_tz":-540,"elapsed":20,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","\n"," Aired Source Members \n","0 Apr 3, 1998 to Apr 24, 1999 Original 1251960 \n","1 Sep 1, 2001 Original 273145 \n","2 Apr 1, 1998 to Sep 30, 1998 Manga 558913 \n","3 Jul 2, 2002 to Dec 24, 2002 Original 94683 \n","4 Sep 30, 2004 to Sep 29, 2005 Manga 13224 "],"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","
MAL_IDNameScoreGenresTypeAiredSourceMembers
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999Original1251960
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001Original273145
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998Manga558913
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002Original94683
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Manga13224
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 5,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 8,\n \"num_unique_values\": 5,\n \"samples\": [\n 5,\n 8,\n 6\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Cowboy Bebop: Tengoku no Tobira\",\n \"Bouken Ou Beet\",\n \"Trigun\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"8.39\",\n \"6.98\",\n \"8.24\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Action, Drama, Mystery, Sci-Fi, Space\",\n \"Adventure, Fantasy, Shounen, Supernatural\",\n \"Action, Sci-Fi, Adventure, Comedy, Drama, Shounen\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Movie\",\n \"TV\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Sep 1, 2001\",\n \"Sep 30, 2004 to Sep 29, 2005\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"Manga\",\n \"Original\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 500656,\n \"min\": 13224,\n \"max\": 1251960,\n \"num_unique_values\": 5,\n \"samples\": [\n 273145,\n 13224\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":71}]},{"cell_type":"markdown","source":["Note that deleting a column in the above does not delete the original data column. If you want to replace them, overwrite the dataframe using `anime_data_extracted.drop(['Studios'], axis=1)`. Alternatively, you can specify the argument `inplace=True` to replace the original data."],"metadata":{"id":"pdqik5qywyxJ"}},{"cell_type":"markdown","source":["### 3.6.2 Removing Duplicates\n","\n","This step is important because duplicates may exist in the data when analyzing data, or be created when actually tabulating the data yourself. As different reasons cause duplicates, it is important to look at the data in detail.\n","\n","The `duplicated()` method is used to determine duplicates. Similar to `isnull()` method (see section 3.4.3), this returns a `True` if a duplicate exists in the same column. Note that if there are duplicates, the first one will be `False` and the second one will be `True`.\n","\n","Let's count the number of duplicates in the anime name."],"metadata":{"id":"EXx-PW3KxzHS"}},{"cell_type":"code","source":["anime_data_extracted[\"Name\"].duplicated().sum()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"hWPCP4QkzJxj","outputId":"02c9ec03-c761-4996-b0b4-c7fdb612e4b2","executionInfo":{"status":"ok","timestamp":1789994475470,"user_tz":-540,"elapsed":37,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["np.int64(1)"]},"metadata":{},"execution_count":72}]},{"cell_type":"markdown","source":["The `drop_duplicates()` method returns the resulting data after removing duplicates."],"metadata":{"id":"zBLxVPWd0kf-"}},{"cell_type":"code","source":["anime_data_extracted[\"Name\"].drop_duplicates().isnull().sum()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"IQlAb-II03qu","outputId":"d8795839-f194-4853-92bf-ff14ce2a6037","executionInfo":{"status":"ok","timestamp":1789994475563,"user_tz":-540,"elapsed":92,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["np.int64(0)"]},"metadata":{},"execution_count":73}]},{"cell_type":"markdown","source":["### 3.6.3 Mapping\n","\n","**Mapping** is a function that pulls data corresponding to a common key from one (reference) table to the other.\n","\n","For example, `anime_list` has a column, `watching_status`, which contains numeric codes that represent a user's anime watching status, such as 1 for \"Watching\", 2 for \"Completed\", 3 for \"On-Hold\", 4 for \"Dropped\", and 6 for \"Plan to Watch\". We also know that other values, 0, 5, 33, 55, are invalid statuses, so we will drop those rows.\n","\n","\n","First, prepare a dictionary that maps each code to its category name."],"metadata":{"id":"UtRJS52i1GLe"}},{"cell_type":"code","source":["# Reference data\n","status_map = {\n"," 1: \"Watching\",\n"," 2: \"Completed\",\n"," 3: \"On-Hold\",\n"," 4: \"Dropped\",\n"," 6: \"Plan to Watch\"\n","}\n","status_map"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"I0gtxKA396DB","outputId":"31935d8d-97ce-41ec-f2aa-7134c0615682","executionInfo":{"status":"ok","timestamp":1789994475567,"user_tz":-540,"elapsed":66,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["{1: 'Watching', 2: 'Completed', 3: 'On-Hold', 4: 'Dropped', 6: 'Plan to Watch'}"]},"metadata":{},"execution_count":74}]},{"cell_type":"markdown","source":["Then we apply it to the watching_status column."],"metadata":{"id":"MWj3o9C798bb"}},{"cell_type":"code","source":["# Drop invalid rows first\n","invalid_status = [0, 5, 33, 55]\n","# Use ~ to represent NOT\n","anime_list = anime_list[~anime_list['watching_status'].isin(invalid_status)]\n","\n","anime_list[\"status_label\"] = anime_list[\"watching_status\"].map(status_map)\n","anime_list"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":423},"id":"9XzsvZKy990-","outputId":"91f659fe-408c-4c6a-d254-7ba1143d788a","executionInfo":{"status":"ok","timestamp":1789994475628,"user_tz":-540,"elapsed":21,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" user_id anime_id rating watching_status watched_episodes \\\n","0 0 67 9 1 1 \n","1 0 6702 7 1 4 \n","2 0 242 10 1 4 \n","3 0 4898 0 1 1 \n","4 0 21 10 1 0 \n",".. ... ... ... ... ... \n","494 2 9588 0 6 0 \n","495 2 10325 0 6 0 \n","496 2 8111 0 6 0 \n","497 2 37939 0 6 0 \n","498 2 11969 0 6 0 \n","\n"," status_label \n","0 Watching \n","1 Watching \n","2 Watching \n","3 Watching \n","4 Watching \n",".. ... \n","494 Plan to Watch \n","495 Plan to Watch \n","496 Plan to Watch \n","497 Plan to Watch \n","498 Plan to Watch \n","\n","[499 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","
user_idanime_idratingwatching_statuswatched_episodesstatus_label
0067911Watching
106702714Watching
202421014Watching
304898011Watching
40211010Watching
.....................
49429588060Plan to Watch
495210325060Plan to Watch
49628111060Plan to Watch
497237939060Plan to Watch
498211969060Plan to Watch
\n","

499 rows × 6 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_list","summary":"{\n \"name\": \"anime_list\",\n \"rows\": 499,\n \"fields\": [\n {\n \"column\": \"user_id\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 2,\n \"num_unique_values\": 3,\n \"samples\": [\n 0,\n 1,\n 2\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"anime_id\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 15041,\n \"min\": 15,\n \"max\": 42938,\n \"num_unique_values\": 447,\n \"samples\": [\n 1401,\n 24273,\n 38883\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"rating\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 4,\n \"min\": 0,\n \"max\": 10,\n \"num_unique_values\": 8,\n \"samples\": [\n 7,\n 6,\n 9\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"watching_status\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 6,\n \"num_unique_values\": 5,\n \"samples\": [\n 2,\n 6,\n 3\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"watched_episodes\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 59,\n \"min\": 0,\n \"max\": 958,\n \"num_unique_values\": 44,\n \"samples\": [\n 7,\n 75,\n 13\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"status_label\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Completed\",\n \"Plan to Watch\",\n \"On-Hold\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":75}]},{"cell_type":"markdown","source":["##### Combining an Anonymous Function and `map`\n","\n","The following is an example of using an anonymous function and `map` to retrieve some data in a column. This is an easy way to transform certain column(s) without defining functions or creating for loops to process each element one by one.\n","\n","Below, we transform the scores from numbers to categories of 'Low', 'Average', or 'High'."],"metadata":{"id":"pKTrnJs9-Ntz"}},{"cell_type":"code","source":["# we need to convert score to float type first\n","anime_data_extracted[\"Score\"] = anime_data_extracted[\"Score\"].astype(float)\n","\n","anime_data_extracted['ScoreCategory'] = anime_data_extracted['Score'].map(\n"," lambda x: 'Low' if x < 5 else ('Average' if x <= 7 else 'High')\n",")\n","anime_data_extracted.head()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":293},"id":"-upsYx7Ve1OV","outputId":"9a309a1b-bea8-410b-8fd9-6e0aa7d9b5e0","executionInfo":{"status":"ok","timestamp":1789994475717,"user_tz":-540,"elapsed":95,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","1 Action, Drama, Mystery, Sci-Fi, Space Movie \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","\n"," Aired Studios Source Members \\\n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original 1251960 \n","1 Sep 1, 2001 Bones Original 273145 \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga 558913 \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original 94683 \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga 13224 \n","\n"," ScoreCategory \n","0 High \n","1 High \n","2 High \n","3 High \n","4 Average "],"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","
MAL_IDNameScoreGenresTypeAiredStudiosSourceMembersScoreCategory
01Cowboy Bebop8.78Action, Adventure, Comedy, Drama, Sci-Fi, SpaceTVApr 3, 1998 to Apr 24, 1999SunriseOriginal1251960High
15Cowboy Bebop: Tengoku no Tobira8.39Action, Drama, Mystery, Sci-Fi, SpaceMovieSep 1, 2001BonesOriginal273145High
26Trigun8.24Action, Sci-Fi, Adventure, Comedy, Drama, ShounenTVApr 1, 1998 to Sep 30, 1998MadhouseManga558913High
37Witch Hunter Robin7.27Action, Mystery, Police, Supernatural, Drama, ...TVJul 2, 2002 to Dec 24, 2002SunriseOriginal94683High
48Bouken Ou Beet6.98Adventure, Fantasy, Shounen, SupernaturalTVSep 30, 2004 to Sep 29, 2005Toei AnimationManga13224Average
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_data_extracted","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 12421,\n \"fields\": [\n {\n \"column\": \"MAL_ID\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 14494,\n \"min\": 1,\n \"max\": 48456,\n \"num_unique_values\": 12421,\n \"samples\": [\n 33027,\n 1832,\n 5649\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 12420,\n \"samples\": [\n \"Infini-T Force\",\n \"Meiou Project Zeorymer\",\n \"Injuu Onna Kyoushi\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.8867171492290354,\n \"min\": 1.85,\n \"max\": 9.19,\n \"num_unique_values\": 532,\n \"samples\": [\n 8.06,\n 3.72,\n 6.48\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Genres\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4449,\n \"samples\": [\n \"Action, Historical, Military, Sci-Fi\",\n \"Mystery, Psychological, Supernatural, Thriller, Seinen\",\n \"Action, Sci-Fi, Psychological, Drama, Mecha\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Aired\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 9207,\n \"samples\": [\n \"Apr 6, 1996 to Sep 21, 1996\",\n \"Mar 17, 2010\",\n \"Jan 5, 2004 to Dec 27, 2004\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 948,\n \"samples\": [\n \"Cyclone Graphics\",\n \"ILCA, DRAWIZ, Toho Interactive Animation\",\n \"Group TAC, Animaruya\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"Original\",\n \"Manga\",\n \"4-koma manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Members\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 146665,\n \"min\": 172,\n \"max\": 2589552,\n \"num_unique_values\": 9125,\n \"samples\": [\n 796,\n 514,\n 1074\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ScoreCategory\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 3,\n \"samples\": [\n \"High\",\n \"Average\",\n \"Low\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":76}]},{"cell_type":"markdown","source":["### 3.6.4 Bin Splitting\n","Finally, we will discuss bin splitting. This is a useful feature when you want to divide data into some discrete range for aggregation.\n","\n","For example, as shown below, you can prepare a list to bin the scores per anime. Since the scores range from 0 to 10, let's create 5 bins (0 to 2, 2 to 4, ...). We use Pandas' `pd.cut()` function for bin splitting. In the `pd.cut()` function, the first argument is the data to be split and the second argument is the boundary value to be split."],"metadata":{"id":"xB5hoALD60GJ"}},{"cell_type":"code","source":["scores = [0, 2, 4, 6, 8, 10]\n","\n","anime_data_cut_by_score = pd.cut(anime_data_extracted[\"Score\"], scores)\n","anime_data_cut_by_score"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":458},"id":"CjBq0uXjfqvX","outputId":"4feacad2-96b2-45be-c800-65c5628c9b26","executionInfo":{"status":"ok","timestamp":1789994475731,"user_tz":-540,"elapsed":11,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0 (8, 10]\n","1 (8, 10]\n","2 (8, 10]\n","3 (6, 8]\n","4 (6, 8]\n"," ... \n","17504 (6, 8]\n","17505 (6, 8]\n","17512 (6, 8]\n","17513 (4, 6]\n","17552 (6, 8]\n","Name: Score, Length: 12421, dtype: category\n","Categories (5, interval[int64, right]): [(0, 2] < (2, 4] < (4, 6] < (6, 8] < (8, 10]]"],"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","
Score
0(8, 10]
1(8, 10]
2(8, 10]
3(6, 8]
4(6, 8]
......
17504(6, 8]
17505(6, 8]
17512(6, 8]
17513(4, 6]
17552(6, 8]
\n","

12421 rows × 1 columns

\n","

"]},"metadata":{},"execution_count":77}]},{"cell_type":"markdown","source":["The \"(8, 10]\" means that it **does not** include 8 but **does** include 10. In other words, the specified criterion is used as the delimiter \"more than ~ and less than or equal to ~\". This behavior can be changed by specifying the `left` or `right` option to the `pd.cut()` function.\n","\n","If you want to use the above results to tally the number of each, use the `pd.value_counts()` function."],"metadata":{"id":"Hc30DFYl-PnH"}},{"cell_type":"code","source":["# Aggregate results\n","pd.value_counts(anime_data_cut_by_score)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":308},"id":"9w6LsPkD-kMX","outputId":"a672640b-29a4-4859-da9f-e2e6d2c85ca9","executionInfo":{"status":"ok","timestamp":1789994475834,"user_tz":-540,"elapsed":97,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["/tmp/ipykernel_1579/1511542592.py:2: FutureWarning: pandas.value_counts is deprecated and will be removed in a future version. Use pd.Series(obj).value_counts() instead.\n"," pd.value_counts(anime_data_cut_by_score)\n"]},{"output_type":"execute_result","data":{"text/plain":["Score\n","(6, 8] 8495\n","(4, 6] 3332\n","(8, 10] 533\n","(2, 4] 60\n","(0, 2] 1\n","Name: count, dtype: int64"],"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","
count
Score
(6, 8]8495
(4, 6]3332
(8, 10]533
(2, 4]60
(0, 2]1
\n","

"]},"metadata":{},"execution_count":78}]},{"cell_type":"markdown","source":["You can also name each bin by specifying the labels parameter."],"metadata":{"id":"_x3OecTx-l4e"}},{"cell_type":"code","source":["# rating the score using alphabets\n","group_names = ['D', 'C', 'B', 'A', 'A+']\n","anime_data_cut_by_score = pd.cut(anime_data_extracted[\"Score\"], scores, labels=group_names)\n","pd.value_counts(anime_data_cut_by_score)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":308},"id":"BEdDOdJq-nhh","outputId":"a5a0b446-7a94-4fa3-f299-153f281218a7","executionInfo":{"status":"ok","timestamp":1789994475854,"user_tz":-540,"elapsed":18,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["/tmp/ipykernel_1579/1561197410.py:4: FutureWarning: pandas.value_counts is deprecated and will be removed in a future version. Use pd.Series(obj).value_counts() instead.\n"," pd.value_counts(anime_data_cut_by_score)\n"]},{"output_type":"execute_result","data":{"text/plain":["Score\n","A 8495\n","B 3332\n","A+ 533\n","C 60\n","D 1\n","Name: count, dtype: int64"],"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","
count
Score
A8495
B3332
A+533
C60
D1
\n","

"]},"metadata":{},"execution_count":79}]},{"cell_type":"markdown","source":["Above we have passed a list for bin divisions, but specifying using an integer is also possible. In this case, the bins will be divided at equal intervals between the maximum and minimum values. Note that some data may not be divided cleanly, and some data may have decimal points."],"metadata":{"id":"4LQR76wt-zml"}},{"cell_type":"code","source":["# e.g. divide into two\n","pd.cut(anime_data_extracted[\"Score\"], 2)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":458},"id":"3ATFK6yR_AAI","outputId":"4c41089d-53b0-4739-bcbe-2553541a8453","executionInfo":{"status":"ok","timestamp":1789994476104,"user_tz":-540,"elapsed":83,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0 (5.52, 9.19]\n","1 (5.52, 9.19]\n","2 (5.52, 9.19]\n","3 (5.52, 9.19]\n","4 (5.52, 9.19]\n"," ... \n","17504 (5.52, 9.19]\n","17505 (5.52, 9.19]\n","17512 (5.52, 9.19]\n","17513 (1.843, 5.52]\n","17552 (5.52, 9.19]\n","Name: Score, Length: 12421, dtype: category\n","Categories (2, interval[float64, right]): [(1.843, 5.52] < (5.52, 9.19]]"],"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","
Score
0(5.52, 9.19]
1(5.52, 9.19]
2(5.52, 9.19]
3(5.52, 9.19]
4(5.52, 9.19]
......
17504(5.52, 9.19]
17505(5.52, 9.19]
17512(5.52, 9.19]
17513(1.843, 5.52]
17552(5.52, 9.19]
\n","

12421 rows × 1 columns

\n","

"]},"metadata":{},"execution_count":80}]},{"cell_type":"markdown","source":["The `pd.qcut()` function can also be used to divide bins at quantile points. This creates bins of approximately the same size."],"metadata":{"id":"Bfl1UkBv_FLq"}},{"cell_type":"code","source":["pd.value_counts(pd.qcut(anime_data_extracted[\"Score\"], 2))"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":214},"id":"AhXNJ9cH_Qkd","outputId":"0724f7a0-1f1a-4a1f-8aa8-bc4399b66dcb","executionInfo":{"status":"ok","timestamp":1789994476109,"user_tz":-540,"elapsed":80,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["/tmp/ipykernel_1579/3198627037.py:1: FutureWarning: pandas.value_counts is deprecated and will be removed in a future version. Use pd.Series(obj).value_counts() instead.\n"," pd.value_counts(pd.qcut(anime_data_extracted[\"Score\"], 2))\n"]},{"output_type":"execute_result","data":{"text/plain":["Score\n","(1.8490000000000002, 6.52] 6248\n","(6.52, 9.19] 6173\n","Name: count, dtype: int64"],"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","
count
Score
(1.8490000000000002, 6.52]6248
(6.52, 9.19]6173
\n","

"]},"metadata":{},"execution_count":81}]},{"cell_type":"markdown","source":["One application of bin splitting is marketing analysis. For example, you can analyze each customer segment (e.g. quality customers) by dividing the customers by their total amount of purchase."],"metadata":{"id":"xaqbeMlt_TRk"}},{"cell_type":"markdown","source":["#### \n","\n","Let's examine the relationship between `Score` and `Members`.\n","\n","(1) Group scores into fixed rating ranges and save the result as `score_tiers`:\n","1. 0.0~6.0: 'Low'\n","2. 6.0~7.5: 'Average'\n","3. 7.5~8.5: 'High'\n","4. 8.5~10.0: 'Very High'"],"metadata":{"id":"k-XwLyajeiMj"}},{"cell_type":"code","source":["# (1)\n","# WRITE ME"],"metadata":{"id":"MwIUuVO5jzbD"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["(2) Divide the member counts into 4 equal-sized popularity groups and save the result as `popularity_tiers`. Use the names 'Niche', 'Moderate', 'Popular', and 'Viral Hit' from lowest to highers."],"metadata":{"id":"TYsIM37dj1lx"}},{"cell_type":"code","source":["# (2)\n","# WRITE ME"],"metadata":{"id":"wH0JG1b_kkbB"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["Run this code to display a 4 by 4 frequency grid showing how many anime fall into each score and popularity combination."],"metadata":{"id":"53RJLliAklkv"}},{"cell_type":"code","source":["# Turns row categories into a full 2D table\n","pd.DataFrame({\"Score\": score_tiers, \"Members\": popularity_tiers}).value_counts().unstack()"],"metadata":{"id":"PcQk9SeOeglT"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["## 3.7 Aggregating Data\n","\n","In this section, you will learn the process of aggregating data around a certain column.\n","\n","You can use the `groupby()` method to aggregate around a particular column.\n","\n","Let's group the `anime_data` by the medium of streaming, using `anime_data.groupby('Type')`. Once grouped, we can check various stats.\n","\n","For example, you can calculate how many values of each `Type` by using the `size()` method, as shown below."],"metadata":{"id":"K4zc2r2UkXtZ"}},{"cell_type":"code","source":["anime_data_extracted.groupby('Type').size()"],"metadata":{"id":"5hczXQaRUb8-","colab":{"base_uri":"https://localhost:8080/","height":303},"executionInfo":{"status":"ok","timestamp":1789994485340,"user_tz":-540,"elapsed":84,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"564ef09a-201d-4b6c-dce9-a03360b6c001"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["Type\n","Movie 2017\n","Music 730\n","ONA 1084\n","OVA 2999\n","Special 1754\n","TV 3837\n","dtype: int64"],"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","
0
Type
Movie2017
Music730
ONA1084
OVA2999
Special1754
TV3837
\n","

"]},"metadata":{},"execution_count":89}]},{"cell_type":"markdown","source":["The following is an example of calculating the average `Score` per `Type`."],"metadata":{"id":"459UEMY1VW8y"}},{"cell_type":"code","source":["# calculate average score per medium of streaming\n","anime_data_extracted.groupby('Type')['Score'].mean()"],"metadata":{"id":"_Bf3VdXtXOhk","colab":{"base_uri":"https://localhost:8080/","height":303},"executionInfo":{"status":"ok","timestamp":1789994488275,"user_tz":-540,"elapsed":91,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"8c7aaf14-16a3-42ae-df9e-783e92b5a29c"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["Type\n","Movie 6.497635\n","Music 5.882616\n","ONA 6.132749\n","OVA 6.321410\n","Special 6.500507\n","TV 6.894178\n","Name: Score, dtype: float64"],"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","
Score
Type
Movie6.497635
Music5.882616
ONA6.132749
OVA6.321410
Special6.500507
TV6.894178
\n","

"]},"metadata":{},"execution_count":90}]},{"cell_type":"markdown","source":["The `groupby` method is an iterator, which iteratively extracts values, and is useful for looping through the resulting elements with Python's for loops, as in the following example.\n","\n","In the following example, group extracts the medium type, and subdf extracts all rows in that type only."],"metadata":{"id":"tILqJ3S1uOmn"}},{"cell_type":"code","source":["for group, subdf in anime_data_extracted.groupby('Type'):\n"," print('==========================================================')\n"," print('Type:{0}'.format(group))\n"," print(subdf)"],"metadata":{"id":"UMkY_J7NufsK","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1789994493374,"user_tz":-540,"elapsed":74,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"92ec1c40-50ab-4c79-9b70-30e0956dde50"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["==========================================================\n","Type:Movie\n"," MAL_ID Name Score \\\n","1 5 Cowboy Bebop: Tengoku no Tobira 8.39 \n","21 31 Neon Genesis Evangelion: Death & Rebirth 7.45 \n","22 32 Neon Genesis Evangelion: The End of Evangelion 8.51 \n","24 43 Koukaku Kidoutai 8.29 \n","27 46 Rurouni Kenshin: Meiji Kenkaku Romantan - Ishi... 7.56 \n","... ... ... ... \n","16964 42387 Hataraku Saibou!!: Saikyou no Teki, Futatabi. ... 7.18 \n","16966 42392 Grisaia: Phantom Trigger The Animation - Starg... 6.90 \n","16970 42423 Date A Bullet: Nightmare or Queen 7.47 \n","17134 42836 This Is Not Blue 5.87 \n","17478 46491 Santa Company: Manatsu no Merry Christmas 5.68 \n","\n"," Genres Type Aired \\\n","1 Action, Drama, Mystery, Sci-Fi, Space Movie Sep 1, 2001 \n","21 Drama, Mecha, Psychological, Sci-Fi Movie Mar 15, 1997 \n","22 Sci-Fi, Dementia, Psychological, Drama, Mecha Movie Jul 19, 1997 \n","24 Action, Mecha, Police, Psychological, Sci-Fi, ... Movie Nov 18, 1995 \n","27 Samurai, Historical, Drama, Shounen Movie Dec 20, 1997 \n","... ... ... ... \n","16964 Action, Comedy, Shounen Movie Sep 5, 2020 \n","16966 Action, School Movie Nov 27, 2020 \n","16970 Sci-Fi Movie Nov 13, 2020 \n","17134 Dementia, Music Movie Jul 29, 2020 \n","17478 Fantasy Movie Jan 28, 2021 \n","\n"," Studios Source Members ScoreCategory \\\n","1 Bones Original 273145 High \n","21 Gainax, Production I.G Original 180681 High \n","22 Gainax, Production I.G Original 572080 High \n","24 Production I.G Manga 468279 High \n","27 Gallop Manga 44334 High \n","... ... ... ... ... \n","16964 David Production Manga 18075 High \n","16966 Bibury Animation Studios Visual novel 14211 Average \n","16970 GEEK TOYS Light novel 31206 High \n","17134 Unknown Original 542 Average \n","17478 ORENDA Original 1677 Average \n","\n"," Title_Length Title_Quantile \n","1 31 Top Third \n","21 40 Top Third \n","22 46 Top Third \n","24 16 Bottom Third \n","27 68 Top Third \n","... ... ... \n","16964 80 Top Third \n","16966 50 Top Third \n","16970 33 Top Third \n","17134 16 Bottom Third \n","17478 41 Top Third \n","\n","[2017 rows x 12 columns]\n","==========================================================\n","Type:Music\n"," MAL_ID Name Score \\\n","671 731 Interstella5555: The 5tory of The 5ecret 5tar ... 8.12 \n","952 1047 On Your Mark 7.49 \n","1721 1890 Clover 6.82 \n","1757 1926 Jishu Seisaku Movie Binchou-tan 6.06 \n","1785 1958 Wish 6.58 \n","... ... ... ... \n","17266 43590 Yakusoku (Music) 6.98 \n","17351 44086 Prayer X 6.75 \n","17386 44407 Shinkai 7.23 \n","17502 47307 Shin Gengou Nyankogelion 6.41 \n","17505 47402 Heikousen 7.52 \n","\n"," Genres Type Aired \\\n","671 Adventure, Drama, Music, Sci-Fi Music Dec 1, 2003 \n","952 Sci-Fi, Music, Drama Music Jun 29, 1995 \n","1721 Drama, Fantasy, Music, Sci-Fi, Shoujo Music Aug 21, 1999 \n","1757 Slice of Life, Music Music Aug 14, 2005 \n","1785 Music, Shoujo Music Dec 17, 1997 \n","... ... ... ... \n","17266 Music, Drama Music Oct 24, 2020 \n","17351 Music, Dementia Music Aug 6, 2018 \n","17386 Music Music Dec 7, 2020 \n","17502 Sci-Fi, Music, Mecha Music Jan 22, 2021 \n","17505 Music, Romance Music Feb 5, 2021 \n","\n"," Studios Source Members ScoreCategory Title_Length \\\n","671 Toei Animation Music 56913 High 52 \n","952 Studio Ghibli Music 24466 High 12 \n","1721 Madhouse Manga 11576 Average 6 \n","1757 Ishikawa Pro Manga 2228 Average 31 \n","1785 Unknown Manga 6826 Average 4 \n","... ... ... ... ... ... \n","17266 CloverWorks Original 599 Average 16 \n","17351 PERIMETRON Original 236 Average 8 \n","17386 Unknown Original 437 High 7 \n","17502 PONOS Corporation Original 472 Average 24 \n","17505 10Gauge, Studio DURIAN Original 832 High 9 \n","\n"," Title_Quantile \n","671 Top Third \n","952 Bottom Third \n","1721 Bottom Third \n","1757 Top Third \n","1785 Bottom Third \n","... ... \n","17266 Bottom Third \n","17351 Bottom Third \n","17386 Bottom Third \n","17502 Middle Third \n","17505 Bottom Third \n","\n","[730 rows x 12 columns]\n","==========================================================\n","Type:ONA\n"," MAL_ID Name Score \\\n","539 574 Rean no Tsubasa 5.74 \n","691 756 School Days ONA 5.96 \n","746 825 King of Fighters: Another Day 6.32 \n","959 1055 Blame! 5.98 \n","1002 1102 Urda 4.59 \n","... ... ... ... \n","17369 44221 Xie Wang Zhui Qi Zhi Yishi Qingcheng 7.10 \n","17430 45567 Gekidan Nanatsu no Taizai 5.41 \n","17432 45574 Holy Knight Light 6.94 \n","17462 45999 Enen no Shouboutai Mini Anime 5.92 \n","17504 47398 Kimetsu Gakuen: Valentine-hen 6.59 \n","\n"," Genres Type \\\n","539 Sci-Fi, Fantasy, Mecha ONA \n","691 Romance, School, Drama ONA \n","746 Adventure, Drama, Shounen ONA \n","959 Sci-Fi, Mecha ONA \n","1002 Action, Historical, Military, Sci-Fi ONA \n","... ... ... \n","17369 Action, Comedy, Drama, Romance, Martial Arts, ... ONA \n","17430 Comedy, Supernatural, Fantasy ONA \n","17432 Action, Fantasy ONA \n","17462 Comedy ONA \n","17504 Comedy ONA \n","\n"," Aired Studios Source Members \\\n","539 Dec 16, 2005 to Aug 18, 2006 Sunrise Novel 3255 \n","691 Feb 25, 2005 Unknown Visual novel 31294 \n","746 Dec 2, 2005 to Mar 3, 2006 Production I.G Game 11152 \n","959 Oct 24, 2003 Group TAC Manga 25584 \n","1002 Jan 5, 2002 to Jan 5, 2003 Romanov Films Unknown 3378 \n","... ... ... ... ... \n","17369 Dec 4, 2020 to Feb 19, 2021 Unknown Novel 2138 \n","17430 Dec 24, 2020 to Jan 5, 2021 Unknown Original 3524 \n","17432 Dec 26, 2020 Yostar Pictures Game 1093 \n","17462 Jan 8, 2021 to ? Unknown Manga 5392 \n","17504 Feb 14, 2021 Unknown Original 18161 \n","\n"," ScoreCategory Title_Length Title_Quantile \n","539 Average 15 Bottom Third \n","691 Average 15 Bottom Third \n","746 Average 29 Middle Third \n","959 Average 6 Bottom Third \n","1002 Low 4 Bottom Third \n","... ... ... ... \n","17369 High 36 Top Third \n","17430 Average 25 Middle Third \n","17432 Average 17 Bottom Third \n","17462 Average 29 Middle Third \n","17504 Average 29 Middle Third \n","\n","[1084 rows x 12 columns]\n","==========================================================\n","Type:OVA\n"," MAL_ID Name Score \\\n","25 44 Rurouni Kenshin: Meiji Kenkaku Romantan - Tsui... 8.73 \n","30 49 Aa! Megami-sama! 7.32 \n","32 51 Tenshi Kinryouku 6.31 \n","60 81 Mobile Suit Gundam: The 08th MS Team 8.03 \n","61 82 Mobile Suit Gundam 0080: War in the Pocket 7.90 \n","... ... ... ... \n","17317 43793 Knight of Erin 6.58 \n","17358 44192 Kimi ga Suki. The Animation 6.83 \n","17359 44193 Ano Ko no Kawari ni Suki na Dake 5.91 \n","17360 44194 Haitoku no Kyoukai 6.18 \n","17375 44248 Fate/Grand Carnival 8.18 \n","\n"," Genres Type \\\n","25 Action, Historical, Drama, Romance, Martial Ar... OVA \n","30 Comedy, Magic, Romance, Seinen, Supernatural OVA \n","32 Action, Drama, Romance, Shoujo, Supernatural OVA \n","60 Adventure, Drama, Mecha, Military, Romance, Sc... OVA \n","61 Military, Sci-Fi, Space, Drama, Mecha OVA \n","... ... ... \n","17317 Hentai, Fantasy OVA \n","17358 Hentai OVA \n","17359 Hentai OVA \n","17360 Hentai OVA \n","17375 Comedy, Supernatural, Magic, Fantasy OVA \n","\n"," Aired Studios Source Members \\\n","25 Feb 20, 1999 to Sep 22, 1999 Studio Deen Manga 228484 \n","30 Feb 21, 1993 to May 17, 1994 AIC Manga 46428 \n","32 May 25, 2000 to Aug 25, 2000 Hal Film Maker Manga 43960 \n","60 Jan 25, 1996 to Jul 25, 1999 Sunrise Original 62655 \n","61 Mar 25, 1989 to Aug 25, 1989 Sunrise Original 43308 \n","... ... ... ... ... \n","17317 Oct 30, 2020 to ? Majin Visual novel 2082 \n","17358 Jan 29, 2021 to Mar 26, 2021 Seven Manga 2745 \n","17359 Dec 18, 2020 to ? Unknown Manga 1097 \n","17360 Jan 29, 2021 to ? Unknown Original 1226 \n","17375 Dec 31, 2020 to Aug 25, 2021 Lerche Game 16288 \n","\n"," ScoreCategory Title_Length Title_Quantile \n","25 High 53 Top Third \n","30 High 16 Bottom Third \n","32 Average 16 Bottom Third \n","60 High 36 Top Third \n","61 High 42 Top Third \n","... ... ... ... \n","17317 Average 14 Bottom Third \n","17358 Average 27 Middle Third \n","17359 Average 32 Top Third \n","17360 Average 18 Middle Third \n","17375 High 19 Middle Third \n","\n","[2999 rows x 12 columns]\n","==========================================================\n","Type:Special\n"," MAL_ID Name Score \\\n","168 191 Love Hina Christmas Special: Silent Eve 7.34 \n","169 192 Love Hina Haru Special: Kimi Sakura Chiru Naka... 7.21 \n","240 264 Hajime no Ippo: Champion Road 8.29 \n","352 376 Elfen Lied: Tooriame nite Arui wa, Shoujo wa I... 7.19 \n","375 399 Seikai no Senki Special 7.26 \n","... ... ... ... \n","17439 45598 Tonikaku Kawaii: Kaisou 6.92 \n","17458 45753 Tensei shitara Slime Datta Ken: Kanwa - Hinata... 6.54 \n","17512 47614 Nu Wushen de Canzhuo Spring Festival Special 6.83 \n","17513 47616 Yakusoku no Neverland 2nd Season: Michishirube 4.81 \n","17552 48456 SK∞: Crazy Rock Jam 6.52 \n","\n"," Genres Type \\\n","168 Slice of Life, Comedy, Romance Special \n","169 Adventure, Comedy, Romance Special \n","240 Comedy, Shounen, Sports Special \n","352 Horror, Psychological, Supernatural, Drama, Ec... Special \n","375 Action, Military, Romance, Sci-Fi, Space Special \n","... ... ... \n","17439 Comedy, Romance, Shounen Special \n","17458 Fantasy, Shounen Special \n","17512 Slice of Life, Comedy Special \n","17513 Mystery, Psychological, Supernatural, Thriller... Special \n","17552 Comedy, Sports Special \n","\n"," Aired Studios Source Members ScoreCategory \\\n","168 Dec 25, 2000 Xebec Manga 53291 High \n","169 Apr 2, 2001 Xebec Unknown 48221 High \n","240 Apr 18, 2003 Madhouse Manga 97346 High \n","352 Apr 21, 2005 Arms Manga 166365 High \n","375 Jul 4, 2001 Sunrise Light novel 2978 High \n","... ... ... ... ... ... \n","17439 Dec 26, 2020 Seven Arcs Manga 18657 Average \n","17458 Jan 5, 2021 8bit Light novel 18717 Average \n","17512 Feb 11, 2021 Unknown Game 540 Average \n","17513 Feb 12, 2021 CloverWorks Manga 13070 Low \n","17552 Mar 14, 2021 Bones Original 10722 Average \n","\n"," Title_Length Title_Quantile \n","168 39 Top Third \n","169 50 Top Third \n","240 29 Middle Third \n","352 98 Top Third \n","375 23 Middle Third \n","... ... ... \n","17439 23 Middle Third \n","17458 56 Top Third \n","17512 44 Top Third \n","17513 46 Top Third \n","17552 19 Middle Third \n","\n","[1754 rows x 12 columns]\n","==========================================================\n","Type:TV\n"," MAL_ID Name Score \\\n","0 1 Cowboy Bebop 8.78 \n","2 6 Trigun 8.24 \n","3 7 Witch Hunter Robin 7.27 \n","4 8 Bouken Ou Beet 6.98 \n","5 15 Eyeshield 21 7.95 \n","... ... ... ... \n","17328 44044 Jimihen!!: Jimiko wo Kaechau Jun Isei Kouyuu!! 6.12 \n","17365 44208 Yami Shibai 8 6.09 \n","17373 44235 Pui Pui Molcar 8.33 \n","17459 45782 D4DJ Petit Mix 6.51 \n","17469 46118 Wave!!: Surfing Yappe!! (TV) 6.05 \n","\n"," Genres Type \\\n","0 Action, Adventure, Comedy, Drama, Sci-Fi, Space TV \n","2 Action, Sci-Fi, Adventure, Comedy, Drama, Shounen TV \n","3 Action, Mystery, Police, Supernatural, Drama, ... TV \n","4 Adventure, Fantasy, Shounen, Supernatural TV \n","5 Action, Sports, Comedy, Shounen TV \n","... ... ... \n","17328 Romance, Ecchi TV \n","17365 Dementia, Horror, Supernatural TV \n","17373 Kids TV \n","17459 Music, Comedy TV \n","17469 Slice of Life, Sports TV \n","\n"," Aired Studios Source \\\n","0 Apr 3, 1998 to Apr 24, 1999 Sunrise Original \n","2 Apr 1, 1998 to Sep 30, 1998 Madhouse Manga \n","3 Jul 2, 2002 to Dec 24, 2002 Sunrise Original \n","4 Sep 30, 2004 to Sep 29, 2005 Toei Animation Manga \n","5 Apr 6, 2005 to Mar 19, 2008 Gallop Manga \n","... ... ... ... \n","17328 Jan 4, 2021 to Feb 22, 2021 Studio Hokiboshi Manga \n","17365 Jan 11, 2021 to ? ILCA Original \n","17373 Jan 5, 2021 to ? Shin-Ei Animation Other \n","17459 Feb 5, 2021 to ? W-Toon Studio, DMM.futureworks Original \n","17469 Jan 12, 2021 to ? Asahi Production Other \n","\n"," Members ScoreCategory Title_Length Title_Quantile \n","0 1251960 High 12 Bottom Third \n","2 558913 High 6 Bottom Third \n","3 94683 High 18 Middle Third \n","4 13224 Average 14 Bottom Third \n","5 148259 High 12 Bottom Third \n","... ... ... ... ... \n","17328 17613 Average 46 Top Third \n","17365 5556 Average 13 Bottom Third \n","17373 3418 High 14 Bottom Third \n","17459 1575 Average 14 Bottom Third \n","17469 19952 Average 28 Middle Third \n","\n","[3837 rows x 12 columns]\n"]}]},{"cell_type":"markdown","source":["The `agg()` method is useful when you want to perform multiple calculations on data at once. The argument of the `agg()` method is a list of function names to be executed. The following is an example of calculating count, average, maximum, and minimum.\n","\n","The following example uses `student-mat.csv` for the calculations."],"metadata":{"id":"EMo1xaTBus_s"}},{"cell_type":"code","source":["# Specify the url with data\n","url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/00320/student.zip'\n","\n","# Acquire data from the url\n","r = requests.get(url, stream=True)\n","\n","# read and extract the zipfile\n","z = zipfile.ZipFile(io.BytesIO(r.content))\n","z.extractall()\n","\n","# Load the data\n","student_data_math = pd.read_csv('student-mat.csv', sep=';')\n","\n","# Adapt multiple functions to a column\n","functions = ['count', 'mean', 'max', 'min']\n","grouped_student_math_data1 = student_data_math.groupby(['sex', 'address'])\n","grouped_student_math_data1[['age','G1']].agg(functions)"],"metadata":{"id":"Y3RnZ1F1u7fD","colab":{"base_uri":"https://localhost:8080/","height":237},"executionInfo":{"status":"ok","timestamp":1789994497065,"user_tz":-540,"elapsed":234,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"348aed03-9e06-4a45-cba5-03f0e532c841"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" age G1 \n"," count mean max min count mean max min\n","sex address \n","F R 44 16.977273 19 15 44 10.295455 19 6\n"," U 164 16.664634 20 15 164 10.707317 18 4\n","M R 44 17.113636 21 15 44 10.659091 18 3\n"," U 143 16.517483 22 15 143 11.405594 19 5"],"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","
ageG1
countmeanmaxmincountmeanmaxmin
sexaddress
FR4416.97727319154410.295455196
U16416.664634201516410.707317184
MR4417.11363621154410.659091183
U14316.517483221514311.405594195
\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"grouped_student_math_data1[['age','G1']]\",\n \"rows\": 4,\n \"fields\": [\n {\n \"column\": [\n \"age\",\n \"count\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 63,\n \"min\": 44,\n \"max\": 164,\n \"num_unique_values\": 3,\n \"samples\": [\n 44,\n 164,\n 143\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": [\n \"age\",\n \"mean\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.2748334286320165,\n \"min\": 16.517482517482517,\n \"max\": 17.113636363636363,\n \"num_unique_values\": 4,\n \"samples\": [\n 16.664634146341463,\n 16.517482517482517,\n 16.977272727272727\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": [\n \"age\",\n \"max\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 19,\n \"max\": 22,\n \"num_unique_values\": 4,\n \"samples\": [\n 20,\n 22,\n 19\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": [\n \"age\",\n \"min\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 15,\n \"max\": 15,\n \"num_unique_values\": 1,\n \"samples\": [\n 15\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": [\n \"G1\",\n \"count\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 63,\n \"min\": 44,\n \"max\": 164,\n \"num_unique_values\": 3,\n \"samples\": [\n 44\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": [\n \"G1\",\n \"mean\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.4638118442085211,\n \"min\": 10.295454545454545,\n \"max\": 11.405594405594405,\n \"num_unique_values\": 4,\n \"samples\": [\n 10.707317073170731\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": [\n \"G1\",\n \"max\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 18,\n \"max\": 19,\n \"num_unique_values\": 2,\n \"samples\": [\n 18\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": [\n \"G1\",\n \"min\"\n ],\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 3,\n \"max\": 6,\n \"num_unique_values\": 4,\n \"samples\": [\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":92}]},{"cell_type":"markdown","source":["#### \n","\n","Anime fans often joke that shows adapted from \"Light Novels\" have ridiculously long titles compared to original shows or manga. Let's see if this is true with `anime_data_extracted`. Group the dataset by `Source` and calculate the average (mean) `Title_Length` for each source type.\n"],"metadata":{"id":"pVtAyo6QBWxg"}},{"cell_type":"code","source":["# Creates a new column named 'Title_Length' that will store the length of each anime\n","anime_data_extracted['Title_Length'] = anime_data_extracted['Name'].str.len()\n","# WRITE ME"],"metadata":{"id":"tpMpJykiBWjl"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["#### \n","\n","Let's investigate the different animation studios. Group the `anime_data_extracted` dataset by `Studios`, then use the `agg()` function on the `Score` column to find the `mean`, `max`, and `count` for each studio."],"metadata":{"id":"7AV3GsNEFQyd"}},{"cell_type":"code","source":["# WRITE ME"],"metadata":{"id":"_u4jGbO9GQ5h"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["## 3.8 Advanced: Hierarchical Grouping\n","\n","In grouping (see section 3.7), multiple axes can be set. For example, we can examine the average `Score` per `Type` and `Source` using `anime_data`."],"metadata":{"id":"1qdaJXTN68E8"}},{"cell_type":"code","source":["anime_data_extracted.groupby(['Type', 'Source'])['Score'].mean()"],"metadata":{"id":"uEC86BIgt_xo","colab":{"base_uri":"https://localhost:8080/","height":489},"executionInfo":{"status":"ok","timestamp":1789994506447,"user_tz":-540,"elapsed":40,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"2a489625-7466-486c-e95e-88578b756a7b"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["Type Source \n","Movie 4-koma manga 7.168750\n"," Book 6.460000\n"," Card game 6.670000\n"," Game 6.782381\n"," Light novel 7.601831\n"," ... \n","TV Picture book 6.132143\n"," Radio 6.163333\n"," Unknown 6.353313\n"," Visual novel 6.774323\n"," Web manga 6.860253\n","Name: Score, Length: 86, dtype: float64"],"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","
Score
TypeSource
Movie4-koma manga7.168750
Book6.460000
Card game6.670000
Game6.782381
Light novel7.601831
.........
TVPicture book6.132143
Radio6.163333
Unknown6.353313
Visual novel6.774323
Web manga6.860253
\n","

86 rows × 1 columns

\n","

"]},"metadata":{},"execution_count":93}]},{"cell_type":"markdown","source":["Note that if you set the parameter `as_index = False` to the `groupby()` method, the index will not be set. This is useful when you want to treat the table as it is."],"metadata":{"id":"t9L3dQk0uGom"}},{"cell_type":"code","source":["anime_data_extracted.groupby(['Type', 'Source'], as_index=False)['Score'].mean()"],"metadata":{"id":"-HjKuvThuKcz","colab":{"base_uri":"https://localhost:8080/","height":423},"executionInfo":{"status":"ok","timestamp":1789994509179,"user_tz":-540,"elapsed":112,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"477f43e8-bc42-4672-c813-2c2b67a8113c"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" Type Source Score\n","0 Movie 4-koma manga 7.168750\n","1 Movie Book 6.460000\n","2 Movie Card game 6.670000\n","3 Movie Game 6.782381\n","4 Movie Light novel 7.601831\n",".. ... ... ...\n","81 TV Picture book 6.132143\n","82 TV Radio 6.163333\n","83 TV Unknown 6.353313\n","84 TV Visual novel 6.774323\n","85 TV Web manga 6.860253\n","\n","[86 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","
TypeSourceScore
0Movie4-koma manga7.168750
1MovieBook6.460000
2MovieCard game6.670000
3MovieGame6.782381
4MovieLight novel7.601831
............
81TVPicture book6.132143
82TVRadio6.163333
83TVUnknown6.353313
84TVVisual novel6.774323
85TVWeb manga6.860253
\n","

86 rows × 3 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted\",\n \"rows\": 86,\n \"fields\": [\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"Movie\",\n \"Music\",\n \"TV\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 16,\n \"samples\": [\n \"4-koma manga\",\n \"Book\",\n \"Manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.5246776534401157,\n \"min\": 5.19,\n \"max\": 7.7540000000000004,\n \"num_unique_values\": 86,\n \"samples\": [\n 7.200117647058823,\n 7.16875,\n 6.813185185185185\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":94}]},{"cell_type":"markdown","source":["## 3.9 Advanced: Handling Missing or Anomalous Data\n","\n","When handling data, there is always the presence of missing data and outlier data. In this section, you will learn how to determine and handle missing and abnormal data at a basic foundation level."],"metadata":{"id":"EyLIHF7kku6x"}},{"cell_type":"markdown","source":["### 3.9.1 How to Handle Missing Data\n","\n","First, we will discuss how to handle missing data. **Missing data** can be caused by a variety of factors, such as forgotten entries, non-response, or system problems. The main question is whether it is better to ignore, exclude, or include these plausible values. Depending on the approach, it may give results with significant bias, leading to erroneous decisions and potentially significant losses. Let's treat this issue with caution.\n","\n","We will use the `anime_data` dataset. The data contains `Unknown`, which should be treated as missing values. We will first convert all missing values as NaNs (`np.nan`).\n","\n"],"metadata":{"id":"rdb_XjdLkWQb"}},{"cell_type":"code","source":["anime_data = anime_data.replace('Unknown', np.nan)"],"metadata":{"id":"bv5XKI5ZlSgQ"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["We will use only some selected features in the examples below."],"metadata":{"id":"RxHzh8pLqH7g"}},{"cell_type":"code","source":["cols_to_use2 = [\n"," \"Name\", \"Score\", \"Type\", \"Premiered\", \"Studios\", \"Source\",\n","]\n","anime_data_extracted2 = anime_data[cols_to_use2]\n","print(len(anime_data_extracted2))"],"metadata":{"id":"s8A-SFSkqNk8","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1789994515752,"user_tz":-540,"elapsed":25,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"dde28ee8-32a5-4962-e435-c656eb6a1245"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["17562\n"]}]},{"cell_type":"markdown","source":["#### Listwise Deletion\n","To remove all rows with NaNs, use the `dropna()` method. This is called **listwise deletion**.\n","\n","The following is the data from the previous example, where the `dropna()` method is applied to extract only rows with data in all columns. Rows with `NaN` are excluded."],"metadata":{"id":"SuK_1QjCnTf4"}},{"cell_type":"code","source":["anime_data_extracted2.dropna()"],"metadata":{"id":"2H4aaIJinflC","colab":{"base_uri":"https://localhost:8080/","height":423},"executionInfo":{"status":"ok","timestamp":1789994519466,"user_tz":-540,"elapsed":119,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"812959f7-d927-4fd9-8b44-ca30aa05b23d"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" Name Score Type Premiered \\\n","0 Cowboy Bebop 8.78 TV Spring 1998 \n","2 Trigun 8.24 TV Spring 1998 \n","3 Witch Hunter Robin 7.27 TV Summer 2002 \n","4 Bouken Ou Beet 6.98 TV Fall 2004 \n","5 Eyeshield 21 7.95 TV Spring 2005 \n","... ... ... ... ... \n","17328 Jimihen!!: Jimiko wo Kaechau Jun Isei Kouyuu!! 6.12 TV Winter 2021 \n","17365 Yami Shibai 8 6.09 TV Winter 2021 \n","17373 Pui Pui Molcar 8.33 TV Winter 2021 \n","17459 D4DJ Petit Mix 6.51 TV Winter 2021 \n","17469 Wave!!: Surfing Yappe!! (TV) 6.05 TV Winter 2021 \n","\n"," Studios Source \n","0 Sunrise Original \n","2 Madhouse Manga \n","3 Sunrise Original \n","4 Toei Animation Manga \n","5 Gallop Manga \n","... ... ... \n","17328 Studio Hokiboshi Manga \n","17365 ILCA Original \n","17373 Shin-Ei Animation Other \n","17459 W-Toon Studio, DMM.futureworks Original \n","17469 Asahi Production Other \n","\n","[3376 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","
NameScoreTypePremieredStudiosSource
0Cowboy Bebop8.78TVSpring 1998SunriseOriginal
2Trigun8.24TVSpring 1998MadhouseManga
3Witch Hunter Robin7.27TVSummer 2002SunriseOriginal
4Bouken Ou Beet6.98TVFall 2004Toei AnimationManga
5Eyeshield 217.95TVSpring 2005GallopManga
.....................
17328Jimihen!!: Jimiko wo Kaechau Jun Isei Kouyuu!!6.12TVWinter 2021Studio HokiboshiManga
17365Yami Shibai 86.09TVWinter 2021ILCAOriginal
17373Pui Pui Molcar8.33TVWinter 2021Shin-Ei AnimationOther
17459D4DJ Petit Mix6.51TVWinter 2021W-Toon Studio, DMM.futureworksOriginal
17469Wave!!: Surfing Yappe!! (TV)6.05TVWinter 2021Asahi ProductionOther
\n","

3376 rows × 6 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"anime_data_extracted2\",\n \"rows\": 3376,\n \"fields\": [\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 3376,\n \"samples\": [\n \"Ex-Arm\",\n \"Lodoss-tou Senki: Eiyuu Kishi Den\",\n \"Koihime\\u2020Musou\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 411,\n \"samples\": [\n \"8.04\",\n \"7.65\",\n \"6.91\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 1,\n \"samples\": [\n \"TV\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Premiered\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 203,\n \"samples\": [\n \"Spring 1999\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 499,\n \"samples\": [\n \"Production I.G, Nihon Ad Systems\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 15,\n \"samples\": [\n \"Web manga\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":97}]},{"cell_type":"markdown","source":["However, we can see that this reduces the number of rows by a large margin (17562 → 3376). It may not be the wisest choice to drop all rows when processing your data."],"metadata":{"id":"uK4RXOD_njDs"}},{"cell_type":"markdown","source":["#### Pairwise Deletion\n","As you can see from the results, listwise deletion can lead to a situation where the original 10 rows of data are extremely small and the data is completely unusable. In this case, there is a way to ignore the missing column data and use only the available data. This is called **pairwise deletion**. In pairwise deletion, the `dropna` method is applied after extracting the columns you want to use."],"metadata":{"id":"UiWR_OOznxYc"}},{"cell_type":"markdown","source":["#### Fill with `fillna`\n","Another method is to use `fillna()` method by passing a value to fill in the `NaN`.\n","\n","For example, we can fill the missing values in `Score` with -1 using `fillna(-1)`."],"metadata":{"id":"fSc7VasRoU7G"}},{"cell_type":"code","source":["anime_data_extracted2[\"Score\"] = anime_data_extracted2[\"Score\"].fillna(-1)\n","anime_data_extracted2"],"metadata":{"id":"ScOjuuQxofQt","colab":{"base_uri":"https://localhost:8080/","height":533},"executionInfo":{"status":"ok","timestamp":1789994522801,"user_tz":-540,"elapsed":73,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"5d2895be-3f30-4729-b6a1-008bd6324012"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["/tmp/ipykernel_1579/3938738411.py:1: 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"," anime_data_extracted2[\"Score\"] = anime_data_extracted2[\"Score\"].fillna(-1)\n"]},{"output_type":"execute_result","data":{"text/plain":[" Name Score Type Premiered \\\n","0 Cowboy Bebop 8.78 TV Spring 1998 \n","1 Cowboy Bebop: Tengoku no Tobira 8.39 Movie NaN \n","2 Trigun 8.24 TV Spring 1998 \n","3 Witch Hunter Robin 7.27 TV Summer 2002 \n","4 Bouken Ou Beet 6.98 TV Fall 2004 \n","... ... ... ... ... \n","17557 Daomu Biji Zhi Qinling Shen Shu -1 ONA NaN \n","17558 Mieruko-chan -1 TV NaN \n","17559 Higurashi no Naku Koro ni Sotsu -1 TV Summer 2021 \n","17560 Yama no Susume: Next Summit -1 TV NaN \n","17561 Scarlet Nexus -1 TV Summer 2021 \n","\n"," Studios Source \n","0 Sunrise Original \n","1 Bones Original \n","2 Madhouse Manga \n","3 Sunrise Original \n","4 Toei Animation Manga \n","... ... ... \n","17557 NaN Novel \n","17558 Passione Manga \n","17559 NaN Visual novel \n","17560 8bit Manga \n","17561 Sunrise Game \n","\n","[17562 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","
NameScoreTypePremieredStudiosSource
0Cowboy Bebop8.78TVSpring 1998SunriseOriginal
1Cowboy Bebop: Tengoku no Tobira8.39MovieNaNBonesOriginal
2Trigun8.24TVSpring 1998MadhouseManga
3Witch Hunter Robin7.27TVSummer 2002SunriseOriginal
4Bouken Ou Beet6.98TVFall 2004Toei AnimationManga
.....................
17557Daomu Biji Zhi Qinling Shen Shu-1ONANaNNaNNovel
17558Mieruko-chan-1TVNaNPassioneManga
17559Higurashi no Naku Koro ni Sotsu-1TVSummer 2021NaNVisual novel
17560Yama no Susume: Next Summit-1TVNaN8bitManga
17561Scarlet Nexus-1TVSummer 2021SunriseGame
\n","

17562 rows × 6 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","variable_name":"anime_data_extracted2","summary":"{\n \"name\": \"anime_data_extracted2\",\n \"rows\": 17562,\n \"fields\": [\n {\n \"column\": \"Name\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 17558,\n \"samples\": [\n \"Soukou Kijo Iris Special\",\n \"Sugar Bunnies Fleur\",\n \"Code-E\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Score\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 533,\n \"samples\": [\n \"8.06\",\n \"3.72\",\n \"6.48\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"TV\",\n \"Movie\",\n \"Music\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Premiered\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 230,\n \"samples\": [\n \"Summer 2017\",\n \"Winter 1993\",\n \"Fall 1995\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Studios\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 1089,\n \"samples\": [\n \"Dai-Ichi Douga\",\n \"ufotable\",\n \"Production I.G, Welz Animation Studios\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Source\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 15,\n \"samples\": [\n \"Web manga\",\n \"Radio\",\n \"Original\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":98}]},{"cell_type":"markdown","source":["Another method is to use the mean value to fill in the blanks. This is called the **mean value assignment method** and uses the `mean` method. Note that when dealing with time series data, this method may include future information (missing data in the past is filled with a mean value using future data).\n","\n","```python\n","df = pd.DataFrame(...)\n","df.fillna(df.mean())\n","```"],"metadata":{"id":"QRZV-ifCryN3"}},{"cell_type":"markdown","source":["There are many other options, so check with `?df.fillna`, etc."],"metadata":{"id":"arI-quZ3r-_I"}},{"cell_type":"markdown","source":["#### Fill with the Previous Value\n","The `ffill()` method can be applied to fill with the value of the previous row.\n","\n","```python\n","df = pd.DataFrame(...)\n","df.ffill()\n","```\n","\n","This process can be used in financial time series data processing and is useful."],"metadata":{"id":"_OVNEsYnoloc"}},{"cell_type":"markdown","source":["For missing data, here we have mechanically replaced certain values in the sample data. However, these methods are not always available. It is important to consider the data situation, background, etc., and deal with them appropriately."],"metadata":{"id":"onz2jKTwsCW2"}},{"cell_type":"markdown","source":["### 3.9.2 How to Handle Anomaly Data\n","\n","This section discusses **anomalous values (outliers)**. The question is whether to leave the outlier data as is and do nothing, remove the outlier, or replace it with a plausible value.\n","\n","What exactly is an outlier? In fact, there is no unified view, and the analyst or decision maker who handles the data may make the decision. In the business world, they are used in analyzing variety of fields, such as unauthorized access patterns (in the security field), machine failures, and financial risk management (VaR), each of which is approached in a variety of ways.\n","\n","Approaches to anomaly detection include simply drawing a box-and-whisker diagram to consider data above a certain percentile as an outlier, using a normal distribution, and basing the approach on the spatial proximity of the data. Other methods use machine learning (including unsupervised learning), which you will learn in subsequent chapters.\n","\n","Also related to the field of anomalies is the field of extreme value statistics, which studies extreme values. Various studies have been conducted on the behavior of extreme value data, which take large values in data, and study phenomena (natural phenomena, disasters, etc.) that are rare but have a very large impact when they occur. It is applied not only in meteorology but also in the fields of finance and information communication."],"metadata":{"id":"DLN75_OpsZk5"}},{"cell_type":"markdown","source":["This concludes our treatment of missing and outlier data. It is often said that data preprocessing is 80% of data analysis, and we often encounter missing and outlier data. In addition, there are so many different forms of data in the world that just getting them in order is a daunting task. The techniques introduced here are important, but it is also important to develop a strategy for how to deal with them."],"metadata":{"id":"MsV95lG1s0Y6"}},{"cell_type":"markdown","source":["#### \n","\n","We discussed many methods of handling missing data. Now let's observe how the choice of which method to use affects our analysis of the data. We are going to test these three methods on the `Score` column and see how it affects the mean value of `Score`.\n","\n","1. Drop all rows with missing data\n","2. Fill all missing `Score` data with -1\n","3. Fill all missing `Score` data with the mean value of the `Score` data we have\n","\n","Run this cell to turn all of the values in `Score` into `float` so we can calculate the mean.\n"],"metadata":{"id":"hMoKB8mS7SZz"}},{"cell_type":"code","source":["anime_data_extracted_pracq = anime_data[cols_to_use2]\n","anime_data_extracted_pracq[\"Score\"] = anime_data_extracted_pracq[\"Score\"].astype(float)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"lVlC_zvV-Pyn","executionInfo":{"status":"ok","timestamp":1789996940384,"user_tz":-540,"elapsed":29,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}},"outputId":"f336cfb0-db0e-45dd-f218-f20fb72ccbe6"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["/tmp/ipykernel_1579/3740744831.py: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"," anime_data_extracted_pracq[\"Score\"] = anime_data_extracted_pracq[\"Score\"].astype(float)\n"]}]},{"cell_type":"markdown","source":["(1) Calculate the mean `Score` after removing all rows with at least one missing value."],"metadata":{"id":"UEluajlsIcmy"}},{"cell_type":"code","source":["# (1)\n","# WRITE ME"],"metadata":{"id":"pz_j75f6DWdF","executionInfo":{"status":"ok","timestamp":1790239164815,"user_tz":-540,"elapsed":14,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":1,"outputs":[]},{"cell_type":"markdown","source":["(2) Calculate the mean `Score` after filling all missing values with -1."],"metadata":{"id":"WiHAzvMnI1_c"}},{"cell_type":"code","source":["# (2)\n","# WRITE ME"],"metadata":{"id":"4THtg03dFr3t","executionInfo":{"status":"ok","timestamp":1790239208983,"user_tz":-540,"elapsed":49,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":2,"outputs":[]},{"cell_type":"markdown","source":["(3) Calculate the mean `Score` after filling all missing `Score` values with the mean `Score` value for the data we currently have."],"metadata":{"id":"Nrk3cHLuI9Op"}},{"cell_type":"code","source":["# (3)\n","# WRITE ME"],"metadata":{"id":"gXoehqdkF2uJ","executionInfo":{"status":"ok","timestamp":1790239211916,"user_tz":-540,"elapsed":16,"user":{"displayName":"木村進太郎","userId":"02485141327510571181"}}},"execution_count":3,"outputs":[]},{"cell_type":"markdown","source":["As we can see, the method we choose to handle the missing values greatly affects the mean `Score` value. There is never an absolute correct method to choose, and it is your job as a data scientist to balance the trade offs from both the data science side and the domain side and to choose the method that makes the most sense."],"metadata":{"id":"PABRr2t1Jh9Y"}},{"cell_type":"markdown","metadata":{"id":"1D70XgYN_i__"},"source":["## 3.10 Comprehensive Question"]},{"cell_type":"markdown","metadata":{"id":"WGOy0fjt_i__"},"source":["### Comprehensive Question 3-1 Data Manipulation\n","\n","Using the data `student-mat.csv', which is the data showing math scores, answer the following questions.\n","\n","(1) For the above data, calculate the average score of `G1` by age (`age`) x sex (`sex`) and create a table (table) such that the vertical axis is age (`age`) and the horizontal axis is sex (`sex`).\n","\n","(2) For the result table displayed in (1), delete all the rows (records) that are NaN."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"kwYUaOxL_i__"},"outputs":[],"source":["# WRITE ME"]},{"cell_type":"markdown","metadata":{"id":"0nCCaSxrBJSL"},"source":["\n","\n","---\n","\n"]},{"cell_type":"markdown","metadata":{"id":"TSB9emFgHW87"},"source":["**Acknowledgements**: For use of the following three datasets\n","1. https://www.kaggle.com/datasets/hernan4444/anime-recommendation-database-2020/data\n","2. https://archive.ics.uci.edu/ml/machine-learning-databases/00320/student.zip\n","3. https://archive.ics.uci.edu/ml/machine-learning-databases/00381/PRSA_data_2010.1.1-2014.12.31.csv\n","\n","**References**: Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [[http://archive.ics.uci.edu/ml](http://archive.ics.uci.edu/ml)]. Irvine, CA: University of California, School of Information and Computer Science.\n","\n","- Note on citation of dataset in 1: \n","P. Cortez and A. Silva. Using Data Mining to Predict Secondary School Student Performance. In A. Brito and J. Teixeira Eds., Proceedings of 5th FUture BUsiness TEChnology Conference (FUBUTEC 2008) pp.5-12, Porto, Portugal, April, 2008, EUROSIS, ISBN 978-9077381-39-7.\n","[http://www3.dsi.uminho.pt/pcortez/student.pdf](http://www3.dsi.uminho.pt/pcortez/student.pdf)\n","- Note on citation of dataset in 2: \n","Liang, X., Zou, T., Guo, B., Li, S., Zhang, H., Zhang, S., Huang, H. and Chen, S. X. (2015). Assessing Beijing's PM2.5 pollution: severity, weather impact, APEC and winter heating. Proceedings of the Royal Society A, 471, 20150257."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"5SO1nA3DBzy7"},"outputs":[],"source":[]}],"metadata":{"anaconda-cloud":{},"colab":{"provenance":[],"toc_visible":true},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.6.6"},"nbpresent":{"slides":{"008a788b-b456-4a0c-8288-6f60967c483e":{"id":"008a788b-b456-4a0c-8288-6f60967c483e","prev":"17036b1e-8781-4a7e-a909-a179f499bbc9","regions":{"072dbee3-3b47-4389-a934-e0168ebd835e":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"378cb846-5485-41d5-9983-fec98a22072a","part":"whole"},"id":"072dbee3-3b47-4389-a934-e0168ebd835e"}}},"01ab9067-898c-46a1-91d9-18ca4fe5a937":{"id":"01ab9067-898c-46a1-91d9-18ca4fe5a937","prev":"008a788b-b456-4a0c-8288-6f60967c483e","regions":{"42da7aa5-8de9-4631-8abe-4ab35c510140":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"7f0f7ef4-e90b-41de-8f73-6165e1b3c1cb","part":"whole"},"id":"42da7aa5-8de9-4631-8abe-4ab35c510140"}}},"02225e5f-f35d-40ef-8f23-5431b19121ab":{"id":"02225e5f-f35d-40ef-8f23-5431b19121ab","prev":"430a8f03-8947-469c-a376-2f271448284d","regions":{"5bf42e3a-831e-4238-ae19-d2212b26edc0":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"c68c4e4e-072e-4620-a325-3ebb19ebe1ce","part":"whole"},"id":"5bf42e3a-831e-4238-ae19-d2212b26edc0"}}},"094d2d0d-c7e5-40bc-bed7-bd80198e8e18":{"id":"094d2d0d-c7e5-40bc-bed7-bd80198e8e18","prev":"de950ae7-a7c1-424c-afe2-42f481db181e","regions":{"95429590-c6e8-4e00-a061-62d2a454c52f":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"aa08360f-e7dd-4647-bbfb-cadd5f19af31","part":"whole"},"id":"95429590-c6e8-4e00-a061-62d2a454c52f"}}},"0aa8229e-9b5c-4f49-bd1e-34de4cd2e82f":{"id":"0aa8229e-9b5c-4f49-bd1e-34de4cd2e82f","prev":"11f1d1c4-4848-4b7d-a62d-5427e055bbe3","regions":{"9504ff07-d651-4294-ba2e-a89ec52ca708":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"e73995f2-c960-4881-b3d3-82c24b06c64c","part":"whole"},"id":"9504ff07-d651-4294-ba2e-a89ec52ca708"}}},"0c50d9ca-fef0-4e5c-8a4e-f18d1c2dbb9e":{"id":"0c50d9ca-fef0-4e5c-8a4e-f18d1c2dbb9e","prev":"b248eaf4-2e85-4c32-8f88-7b2ef510ee7c","regions":{"8b734704-6740-44f7-8c87-17350c882ed3":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"cc42c471-e943-450e-a441-3dc962f1c40d","part":"whole"},"id":"8b734704-6740-44f7-8c87-17350c882ed3"}}},"107cd2c7-0a77-4fd7-922b-56df6615dcca":{"id":"107cd2c7-0a77-4fd7-922b-56df6615dcca","prev":"2e7deda1-5486-4b26-8e0a-c91e4c88dbe8","regions":{"2ee1a19b-7a00-46b1-b393-485ddb7c2b9b":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"d27b23aa-809c-4965-8399-5e67901e2ae4","part":"whole"},"id":"2ee1a19b-7a00-46b1-b393-485ddb7c2b9b"}}},"11f1d1c4-4848-4b7d-a62d-5427e055bbe3":{"id":"11f1d1c4-4848-4b7d-a62d-5427e055bbe3","prev":"9461c0f4-d87e-441d-915d-95c69b105ecb","regions":{"185d0c6f-1e15-43e1-81f5-1234d5ac3ade":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"18703937-12da-40b5-960d-e7a50467e7d0","part":"whole"},"id":"185d0c6f-1e15-43e1-81f5-1234d5ac3ade"}}},"17036b1e-8781-4a7e-a909-a179f499bbc9":{"id":"17036b1e-8781-4a7e-a909-a179f499bbc9","prev":"5494c0f6-12d4-4627-9481-26c7858f8f09","regions":{"4757fb07-c8f0-49b5-bb28-9a5bb61995ff":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"6452b3ab-84b7-4f3c-b74f-ae118e4ed9f2","part":"whole"},"id":"4757fb07-c8f0-49b5-bb28-9a5bb61995ff"}}},"1d02d174-1ae1-4900-bb8e-92083b3f723b":{"id":"1d02d174-1ae1-4900-bb8e-92083b3f723b","prev":"466c6928-dc5e-4aeb-abad-2dbb2c797793","regions":{"2e5e7aee-fec1-4322-82df-30c9bda076ce":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"e89daf11-82d5-4ae2-905b-b73662884e4e","part":"whole"},"id":"2e5e7aee-fec1-4322-82df-30c9bda076ce"}}},"26984d6c-6cdd-4fb6-a80c-b16f643b3802":{"id":"26984d6c-6cdd-4fb6-a80c-b16f643b3802","prev":"dfaeb098-c3a9-4980-ae35-70f9b6296a7d","regions":{"e3a7924f-b4ad-4919-b97c-a9f0da0027ec":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"5683d4a6-3bdb-44ea-8a8e-6203da028f73","part":"whole"},"id":"e3a7924f-b4ad-4919-b97c-a9f0da0027ec"}}},"2e7deda1-5486-4b26-8e0a-c91e4c88dbe8":{"id":"2e7deda1-5486-4b26-8e0a-c91e4c88dbe8","prev":"67a167dd-f578-4c00-9a52-77864d640afa","regions":{"eb91815b-1df2-4bfb-b2d9-b47359f388f3":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"2b936ae8-a540-4353-8b1d-42f7a3bdc763","part":"whole"},"id":"eb91815b-1df2-4bfb-b2d9-b47359f388f3"}}},"35c31f44-06e2-4d75-a9b7-0c168d125d04":{"id":"35c31f44-06e2-4d75-a9b7-0c168d125d04","prev":"8b46588c-ad23-4509-b67d-62702ed7afd1","regions":{"82c3daba-b8de-42a1-b157-7274603802ae":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"35e93b3d-957c-4833-a2a5-b980ecffa5b1","part":"whole"},"id":"82c3daba-b8de-42a1-b157-7274603802ae"}}},"3671ddb9-95b3-4245-b062-03cc90ea386d":{"id":"3671ddb9-95b3-4245-b062-03cc90ea386d","prev":"3c3ef584-2982-4a35-afcf-4772c65dc2ac","regions":{"faddc9ae-ef33-4d8e-a04e-e9f73ea0310e":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"bea98316-c64e-4810-b176-ed4947524f8c","part":"whole"},"id":"faddc9ae-ef33-4d8e-a04e-e9f73ea0310e"}}},"37edb96d-7d51-438f-bd46-fc06e161e205":{"id":"37edb96d-7d51-438f-bd46-fc06e161e205","prev":"58980228-1ba8-4ba6-89d3-dd7694662786","regions":{"d1ee61d0-5e72-4925-b975-1cc103761137":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"b0fc1861-b979-45c5-abd0-3b05200de3b6","part":"whole"},"id":"d1ee61d0-5e72-4925-b975-1cc103761137"}}},"3a9ce2a4-6dd4-463e-8d2d-4aa731447f39":{"id":"3a9ce2a4-6dd4-463e-8d2d-4aa731447f39","prev":"0aa8229e-9b5c-4f49-bd1e-34de4cd2e82f","regions":{"80f94dd5-569c-4105-9db9-746bc3a0d979":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"d3d6e29a-a939-4ab4-95e0-5645d4eb97a4","part":"whole"},"id":"80f94dd5-569c-4105-9db9-746bc3a0d979"}}},"3c3ef584-2982-4a35-afcf-4772c65dc2ac":{"id":"3c3ef584-2982-4a35-afcf-4772c65dc2ac","prev":"523566b9-8158-4001-91b2-f7d1d61ec04b","regions":{"8182730f-8099-4a3f-815d-c92171a084a7":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"2ff35469-eeef-46b0-8b36-f2b6d4580bd4","part":"whole"},"id":"8182730f-8099-4a3f-815d-c92171a084a7"}}},"3e8e0818-4535-4e50-b8da-423cfa6bda87":{"id":"3e8e0818-4535-4e50-b8da-423cfa6bda87","prev":"bff971e4-b2b6-497d-8f6b-6401514ee2ca","regions":{"859f95ab-5314-4f50-9fc8-7f8a76741c82":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"0893c4bd-30b9-4137-bc19-c40d5def546a","part":"whole"},"id":"859f95ab-5314-4f50-9fc8-7f8a76741c82"}}},"430a8f03-8947-469c-a376-2f271448284d":{"id":"430a8f03-8947-469c-a376-2f271448284d","prev":"ae384cc7-844b-4a3a-816d-4275e60a5020","regions":{"cc346300-13a7-4c57-9eea-13d379d8f845":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"3b3885c1-a497-4d41-bb48-76a6d8b43a62","part":"whole"},"id":"cc346300-13a7-4c57-9eea-13d379d8f845"}}},"43517c80-f987-4261-bad2-6844f9f11a43":{"id":"43517c80-f987-4261-bad2-6844f9f11a43","prev":"02225e5f-f35d-40ef-8f23-5431b19121ab","regions":{"386e1c27-adc8-4888-b278-a730e1a06a1b":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"c34d5c93-c65c-4e47-8c92-b38faead2dc2","part":"whole"},"id":"386e1c27-adc8-4888-b278-a730e1a06a1b"}}},"466c6928-dc5e-4aeb-abad-2dbb2c797793":{"id":"466c6928-dc5e-4aeb-abad-2dbb2c797793","prev":"01ab9067-898c-46a1-91d9-18ca4fe5a937","regions":{"dadc7530-a88a-474c-93b1-a6b13fdeb671":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"07dd10e2-514b-4435-afa4-cab572e54611","part":"whole"},"id":"dadc7530-a88a-474c-93b1-a6b13fdeb671"}}},"523566b9-8158-4001-91b2-f7d1d61ec04b":{"id":"523566b9-8158-4001-91b2-f7d1d61ec04b","prev":"db6c2c84-14f3-4a3f-972c-ea1e9b45b091","regions":{"fa40db73-7f38-419f-b6d1-2d0c9854ad3d":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"9c7b5502-7d21-45ef-9801-c8ab89c0cb1b","part":"whole"},"id":"fa40db73-7f38-419f-b6d1-2d0c9854ad3d"}}},"5342b691-167b-4e0f-a28f-aee2f74648b3":{"id":"5342b691-167b-4e0f-a28f-aee2f74648b3","prev":"9750cf96-7612-4159-bac1-bf26fe2f60c8","regions":{"8bf6c96e-7113-4293-9db9-3999fd5dc82b":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"21eb3ee8-f72c-4842-a2b2-98bc6b4b06b2","part":"whole"},"id":"8bf6c96e-7113-4293-9db9-3999fd5dc82b"}}},"5494c0f6-12d4-4627-9481-26c7858f8f09":{"id":"5494c0f6-12d4-4627-9481-26c7858f8f09","prev":"3671ddb9-95b3-4245-b062-03cc90ea386d","regions":{"8f4923d7-89d2-4193-a542-786412d24121":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"47413f67-a333-4cd6-8a6e-6b268aa4f4ff","part":"whole"},"id":"8f4923d7-89d2-4193-a542-786412d24121"}}},"57d8f821-fdaf-412d-bc5c-fbaf939e7850":{"id":"57d8f821-fdaf-412d-bc5c-fbaf939e7850","prev":"5342b691-167b-4e0f-a28f-aee2f74648b3","regions":{"595c1191-37e3-41c2-8807-172c5221490d":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"885a45ac-f069-4988-b245-fcd79646e17f","part":"whole"},"id":"595c1191-37e3-41c2-8807-172c5221490d"}}},"58980228-1ba8-4ba6-89d3-dd7694662786":{"id":"58980228-1ba8-4ba6-89d3-dd7694662786","prev":"ee0491f8-b146-4b0e-99d3-ceb5eb2f3a1d","regions":{"c5224b5d-aad4-4862-a3d1-7e6996d3d33d":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"8972370e-3b2e-4fe5-b7d5-e6f410f4df68","part":"whole"},"id":"c5224b5d-aad4-4862-a3d1-7e6996d3d33d"}}},"58fe1e15-bd81-4c14-8c10-08606b7f56ae":{"id":"58fe1e15-bd81-4c14-8c10-08606b7f56ae","prev":"8511eb84-692c-4a63-b3c3-7e1f86c137bd","regions":{"c29ef705-df31-4240-987b-1697100d6ae4":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"b5e81c61-d695-4fc4-b784-45ed41026d4a","part":"whole"},"id":"c29ef705-df31-4240-987b-1697100d6ae4"}}},"6156681f-3fe2-4d80-aab1-f7c28e200404":{"id":"6156681f-3fe2-4d80-aab1-f7c28e200404","prev":"c17f7347-3cbe-420c-a499-3131e4eaac59","regions":{"28d9588e-1085-432e-9b58-6e28c4d7c74f":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"3dbf6370-0a3a-44be-ade7-2a32586e4508","part":"whole"},"id":"28d9588e-1085-432e-9b58-6e28c4d7c74f"}}},"67a167dd-f578-4c00-9a52-77864d640afa":{"id":"67a167dd-f578-4c00-9a52-77864d640afa","prev":"b7ce05ff-6ab9-49ba-9235-05d97e6d8b19","regions":{"b3a441dc-47d2-402e-b9fe-68a0472d5670":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"a67a0f57-b7bb-4ad2-89a8-f53f514d52d5","part":"whole"},"id":"b3a441dc-47d2-402e-b9fe-68a0472d5670"}}},"76cecc6a-4ff3-4f36-9fcd-dc72da22db7a":{"id":"76cecc6a-4ff3-4f36-9fcd-dc72da22db7a","prev":"107cd2c7-0a77-4fd7-922b-56df6615dcca","regions":{"3d9e9ca1-88f1-4d57-b1ce-1cd3377e1f1e":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"c3f25ce7-4ac2-4e7e-ae0d-0d354b7aa34a","part":"whole"},"id":"3d9e9ca1-88f1-4d57-b1ce-1cd3377e1f1e"}}},"7a3d7039-5de1-4759-9129-49437077ec67":{"id":"7a3d7039-5de1-4759-9129-49437077ec67","prev":"76cecc6a-4ff3-4f36-9fcd-dc72da22db7a","regions":{"f8ee8b52-b882-4e27-b1e2-4db18e65b256":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"4a0d9ca6-f3a4-453d-b52e-ad5d17ca5883","part":"whole"},"id":"f8ee8b52-b882-4e27-b1e2-4db18e65b256"}}},"7c9758fa-71de-4938-8eed-be5dabd2d61c":{"id":"7c9758fa-71de-4938-8eed-be5dabd2d61c","prev":"3e8e0818-4535-4e50-b8da-423cfa6bda87","regions":{"94b0287c-da12-4bf9-ab24-b6041cab0a0f":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"5e5e8200-af66-4ffa-85d8-0ca019d398d8","part":"whole"},"id":"94b0287c-da12-4bf9-ab24-b6041cab0a0f"}}},"8511eb84-692c-4a63-b3c3-7e1f86c137bd":{"id":"8511eb84-692c-4a63-b3c3-7e1f86c137bd","prev":"3a9ce2a4-6dd4-463e-8d2d-4aa731447f39","regions":{"d512994f-a930-4cb5-9feb-0c9e9b3eca21":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"93a5d1f3-e3b5-4840-95c2-503725844dc3","part":"whole"},"id":"d512994f-a930-4cb5-9feb-0c9e9b3eca21"}}},"863c2f5d-5ed6-4abd-9212-ac3aa08b7c2d":{"id":"863c2f5d-5ed6-4abd-9212-ac3aa08b7c2d","prev":"fa1e9266-57b6-41c8-9ad2-05119a8154fa","regions":{"2efc3ace-624d-49f2-8602-18d3ce4fd9d1":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"1c22acff-5c31-4b42-a557-2be121021d1e","part":"whole"},"id":"2efc3ace-624d-49f2-8602-18d3ce4fd9d1"}}},"8a00b47c-c1da-479f-b5e8-16224b1bc1ad":{"id":"8a00b47c-c1da-479f-b5e8-16224b1bc1ad","prev":"c372f9ff-ce00-4768-8a0a-cb894e0fa65d","regions":{"88f7e3bd-c1f1-4783-aa29-4b3871ed83c9":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"4bcabd6c-13d5-4a8e-a4cf-46d12550458b","part":"whole"},"id":"88f7e3bd-c1f1-4783-aa29-4b3871ed83c9"}}},"8b46588c-ad23-4509-b67d-62702ed7afd1":{"id":"8b46588c-ad23-4509-b67d-62702ed7afd1","prev":"37edb96d-7d51-438f-bd46-fc06e161e205","regions":{"6e4458c9-28eb-4025-8ac9-d7fc0ffb8fee":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"575abe68-ac1a-489a-8b14-aef861c188e3","part":"whole"},"id":"6e4458c9-28eb-4025-8ac9-d7fc0ffb8fee"}}},"92033db1-1754-4f97-a65f-d7fcd5e5ef5f":{"id":"92033db1-1754-4f97-a65f-d7fcd5e5ef5f","prev":"7c9758fa-71de-4938-8eed-be5dabd2d61c","regions":{"73b1869c-52b3-4f19-8918-f9d27d1ce96a":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"31f1dd1c-7279-4590-a581-4789248b9d95","part":"whole"},"id":"73b1869c-52b3-4f19-8918-f9d27d1ce96a"}}},"9461c0f4-d87e-441d-915d-95c69b105ecb":{"id":"9461c0f4-d87e-441d-915d-95c69b105ecb","prev":"92033db1-1754-4f97-a65f-d7fcd5e5ef5f","regions":{"4dd7f598-05d6-4e49-883d-978967a66cc5":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"674e452c-7ba7-4c07-be5e-1e73553f8849","part":"whole"},"id":"4dd7f598-05d6-4e49-883d-978967a66cc5"}}},"94c7954c-21de-44d2-81f0-746748834167":{"id":"94c7954c-21de-44d2-81f0-746748834167","prev":"d806c3fb-ea3d-4b90-be5b-e78113b3e887","regions":{"a853df0e-2a78-45f8-8841-72a437ba5d68":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"f581b3c5-979f-4ad2-95b7-e89dc86afee3","part":"whole"},"id":"a853df0e-2a78-45f8-8841-72a437ba5d68"}}},"94c969b1-892d-4f1a-a832-8154573c893c":{"id":"94c969b1-892d-4f1a-a832-8154573c893c","prev":"94c7954c-21de-44d2-81f0-746748834167","regions":{"c1ade563-9e9b-490c-970b-37faba235b7e":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"e965b847-7d60-48e2-b72f-972816a1e6fc","part":"whole"},"id":"c1ade563-9e9b-490c-970b-37faba235b7e"}}},"9750cf96-7612-4159-bac1-bf26fe2f60c8":{"id":"9750cf96-7612-4159-bac1-bf26fe2f60c8","prev":"94c969b1-892d-4f1a-a832-8154573c893c","regions":{"116d14ce-3f3d-44a1-aa86-61b1ac19354f":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"ddd82eaf-9b54-48bf-ac57-aa797a3a970a","part":"whole"},"id":"116d14ce-3f3d-44a1-aa86-61b1ac19354f"}}},"a40bc8a7-660a-4478-8071-b97c5127c4b5":{"id":"a40bc8a7-660a-4478-8071-b97c5127c4b5","prev":"863c2f5d-5ed6-4abd-9212-ac3aa08b7c2d","regions":{"929e10a6-a0b0-4d31-99b1-311fcfc150a1":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"d7d32de7-bcdd-486d-b6c9-d5caad1164e3","part":"whole"},"id":"929e10a6-a0b0-4d31-99b1-311fcfc150a1"}}},"ae384cc7-844b-4a3a-816d-4275e60a5020":{"id":"ae384cc7-844b-4a3a-816d-4275e60a5020","prev":"26984d6c-6cdd-4fb6-a80c-b16f643b3802","regions":{"b7a26fcd-98a6-4c24-893f-14ab3d6257bb":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"ddc73611-ffe2-434e-b3bd-cd417ef42b68","part":"whole"},"id":"b7a26fcd-98a6-4c24-893f-14ab3d6257bb"}}},"b248eaf4-2e85-4c32-8f88-7b2ef510ee7c":{"id":"b248eaf4-2e85-4c32-8f88-7b2ef510ee7c","prev":null,"regions":{"729796eb-5023-4fc8-b32f-83045cda3258":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"dad3a857-8628-4c15-a8ad-312792cb88ac","part":"whole"},"id":"729796eb-5023-4fc8-b32f-83045cda3258"}}},"b7ce05ff-6ab9-49ba-9235-05d97e6d8b19":{"id":"b7ce05ff-6ab9-49ba-9235-05d97e6d8b19","prev":"fd5b9f11-7cb4-4280-8955-7da1f2a0eafd","regions":{"44f843a2-f9a7-4c01-be36-f2b39de5a725":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"852d31b9-64ee-4906-8865-dc217141338a","part":"whole"},"id":"44f843a2-f9a7-4c01-be36-f2b39de5a725"}}},"bff971e4-b2b6-497d-8f6b-6401514ee2ca":{"id":"bff971e4-b2b6-497d-8f6b-6401514ee2ca","prev":"7a3d7039-5de1-4759-9129-49437077ec67","regions":{"07dd02d3-5ac3-4d96-9291-c3870d15f11e":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"31a44e48-3de3-4fa2-9c03-2063209cce11","part":"whole"},"id":"07dd02d3-5ac3-4d96-9291-c3870d15f11e"}}},"c17f7347-3cbe-420c-a499-3131e4eaac59":{"id":"c17f7347-3cbe-420c-a499-3131e4eaac59","prev":"57d8f821-fdaf-412d-bc5c-fbaf939e7850","regions":{"7d4b25fd-aa9a-4d62-8181-05324639ff0d":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"35043c9c-279e-47cd-b82f-9dae8c5f9fec","part":"whole"},"id":"7d4b25fd-aa9a-4d62-8181-05324639ff0d"}}},"c372f9ff-ce00-4768-8a0a-cb894e0fa65d":{"id":"c372f9ff-ce00-4768-8a0a-cb894e0fa65d","prev":"35c31f44-06e2-4d75-a9b7-0c168d125d04","regions":{"c3931b7b-0a33-46e0-a5b6-6b33b0075fd5":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"6dccff7c-9bb1-447a-9692-656ca1687626","part":"whole"},"id":"c3931b7b-0a33-46e0-a5b6-6b33b0075fd5"}}},"d806c3fb-ea3d-4b90-be5b-e78113b3e887":{"id":"d806c3fb-ea3d-4b90-be5b-e78113b3e887","prev":"094d2d0d-c7e5-40bc-bed7-bd80198e8e18","regions":{"8ec4249f-2827-4eb0-bb27-152d4dea703f":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"25b7da30-19eb-4326-ba15-d969f9c1ad12","part":"whole"},"id":"8ec4249f-2827-4eb0-bb27-152d4dea703f"}}},"db6c2c84-14f3-4a3f-972c-ea1e9b45b091":{"id":"db6c2c84-14f3-4a3f-972c-ea1e9b45b091","prev":"ff25a0ae-0958-4983-b72b-6d655554983e","regions":{"33e20b90-5ef8-482a-af30-6ebe50fa5247":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"b2282939-76b5-4358-8caf-bda59cd4dfc8","part":"whole"},"id":"33e20b90-5ef8-482a-af30-6ebe50fa5247"}}},"de950ae7-a7c1-424c-afe2-42f481db181e":{"id":"de950ae7-a7c1-424c-afe2-42f481db181e","prev":"58fe1e15-bd81-4c14-8c10-08606b7f56ae","regions":{"157e2366-91bc-4374-b005-296b72401f19":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"6eff5466-e51a-40e9-b5d6-0e511d329721","part":"whole"},"id":"157e2366-91bc-4374-b005-296b72401f19"}}},"dfaeb098-c3a9-4980-ae35-70f9b6296a7d":{"id":"dfaeb098-c3a9-4980-ae35-70f9b6296a7d","prev":"a40bc8a7-660a-4478-8071-b97c5127c4b5","regions":{"ff8a9509-83fc-43b8-b85d-05642f796426":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"139cbba6-15fb-4eb9-b2d8-a25bdbf3a874","part":"whole"},"id":"ff8a9509-83fc-43b8-b85d-05642f796426"}}},"ee0491f8-b146-4b0e-99d3-ceb5eb2f3a1d":{"id":"ee0491f8-b146-4b0e-99d3-ceb5eb2f3a1d","prev":"0c50d9ca-fef0-4e5c-8a4e-f18d1c2dbb9e","regions":{"7e1317fc-37fb-47f2-9822-1b464ab3a0f1":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"93b648ee-643e-46b2-a289-f6b562875bc4","part":"whole"},"id":"7e1317fc-37fb-47f2-9822-1b464ab3a0f1"}}},"fa1e9266-57b6-41c8-9ad2-05119a8154fa":{"id":"fa1e9266-57b6-41c8-9ad2-05119a8154fa","prev":"1d02d174-1ae1-4900-bb8e-92083b3f723b","regions":{"642cb521-a4bf-4bdf-94e4-c4e1db951bed":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"7bcdf43b-5617-4e59-b3d7-0c3706c527f1","part":"whole"},"id":"642cb521-a4bf-4bdf-94e4-c4e1db951bed"}}},"fd5b9f11-7cb4-4280-8955-7da1f2a0eafd":{"id":"fd5b9f11-7cb4-4280-8955-7da1f2a0eafd","prev":"8a00b47c-c1da-479f-b5e8-16224b1bc1ad","regions":{"bafa4b52-8d5e-4af8-9b56-5cfb28caec46":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"d110e3f4-e865-4198-8668-17bd4f1e9540","part":"whole"},"id":"bafa4b52-8d5e-4af8-9b56-5cfb28caec46"}}},"ff25a0ae-0958-4983-b72b-6d655554983e":{"id":"ff25a0ae-0958-4983-b72b-6d655554983e","prev":"6156681f-3fe2-4d80-aab1-f7c28e200404","regions":{"4536da0e-7194-48f1-a4eb-13fb6d74ecf5":{"attrs":{"height":0.8,"width":0.8,"x":0.1,"y":0.1},"content":{"cell":"72beaf23-bcc8-4311-b327-b67a3b07436a","part":"whole"},"id":"4536da0e-7194-48f1-a4eb-13fb6d74ecf5"}}}},"themes":{}}},"nbformat":4,"nbformat_minor":0}