{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Deduplicate data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Load sample data" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:35.593644Z", "iopub.status.busy": "2026-05-20T13:54:35.593025Z", "iopub.status.idle": "2026-05-20T13:54:35.819606Z", "shell.execute_reply": "2026-05-20T13:54:35.819256Z", "shell.execute_reply.started": "2026-05-20T13:54:35.593594Z" } }, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:35.871814Z", "iopub.status.busy": "2026-05-20T13:54:35.871569Z", "iopub.status.idle": "2026-05-20T13:54:36.164817Z", "shell.execute_reply": "2026-05-20T13:54:36.163923Z", "shell.execute_reply.started": "2026-05-20T13:54:35.871801Z" } }, "outputs": [], "source": [ "customers = pd.read_csv(\n", " \"https://raw.githubusercontent.com/kjam/data-cleaning-101/master/data/customer_data_duped.csv\",\n", " encoding=\"utf-8\",\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Deduplication with pandas" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.1 Overview" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:36.654059Z", "iopub.status.busy": "2026-05-20T13:54:36.653772Z", "iopub.status.idle": "2026-05-20T13:54:36.673898Z", "shell.execute_reply": "2026-05-20T13:54:36.673397Z", "shell.execute_reply.started": "2026-05-20T13:54:36.654041Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namejobcompanystreet_addresscitystateemailuser_name
0Patricia SchaeferProgrammer, systemsEstrada-Best398 Paul DriveChristianviewDelawarelambdavid@gmail.comndavidson
1Olivie DuboisIngénieur recherche et développement en agroal...Morenorue Lucas BenardSaint Anastasie-les-BainsARberthelotjacqueline@mahe.frmanonallain
2Mary Davies-KirkPublic affairs consultantBaker LtdFlat 3\\nPugh mewsStanleyfurtZAmiddletonconor@hotmail.comcolemanmichael
3Miroslawa EckbauerDispensing opticianLadeck GmbHMijo-Lübs-Straße 12NeubrandenburgBerlinsophia01@yahoo.deromanjunitz
4Richard BauerAccountant, chartered certifiedHoffman-Rocha6541 Rodriguez WallCarlosmouthTexastross@jensen-ware.orgadam78
...........................
2075Maurice SteySystems developerLinke Margraf GmbH & Co. OHGLaila-Scheibe-Allee 2/0LuckenwaldeHamburggutknechtevelyn@niemeier.comdkreusel
2076Linda AlexanderCommrcil horiculuriWebb, Ballald and Vasquel5594 Persn CiffMooneyburyMarylandahleythoa@ail.cokennethrchn
2077Diane BaillyPharmacienVoisin527, rue DijouxDuval-les-BainsCHaruiz@reynaud.frdorothee41
2078Jorge Riba CerdánHotel managerAmador-DiegoRambla de Adriana Barceló 854 Puerta 3HuescaAsturiasmanuelamosquera@yahoo.comeugenia17
2079Ryan ThompsonBrewing technologistSmith-Sullivan136 Rodriguez PointBradfordboroughNorth Dakotalcruz@gmail.comcnewton
\n", "

2080 rows × 8 columns

\n", "
" ], "text/plain": [ " name job \\\n", "0 Patricia Schaefer Programmer, systems \n", "1 Olivie Dubois Ingénieur recherche et développement en agroal... \n", "2 Mary Davies-Kirk Public affairs consultant \n", "3 Miroslawa Eckbauer Dispensing optician \n", "4 Richard Bauer Accountant, chartered certified \n", "... ... ... \n", "2075 Maurice Stey Systems developer \n", "2076 Linda Alexander Commrcil horiculuri \n", "2077 Diane Bailly Pharmacien \n", "2078 Jorge Riba Cerdán Hotel manager \n", "2079 Ryan Thompson Brewing technologist \n", "\n", " company street_address \\\n", "0 Estrada-Best 398 Paul Drive \n", "1 Moreno rue Lucas Benard \n", "2 Baker Ltd Flat 3\\nPugh mews \n", "3 Ladeck GmbH Mijo-Lübs-Straße 12 \n", "4 Hoffman-Rocha 6541 Rodriguez Wall \n", "... ... ... \n", "2075 Linke Margraf GmbH & Co. OHG Laila-Scheibe-Allee 2/0 \n", "2076 Webb, Ballald and Vasquel 5594 Persn Ciff \n", "2077 Voisin 527, rue Dijoux \n", "2078 Amador-Diego Rambla de Adriana Barceló 854 Puerta 3 \n", "2079 Smith-Sullivan 136 Rodriguez Point \n", "\n", " city state email \\\n", "0 Christianview Delaware lambdavid@gmail.com \n", "1 Saint Anastasie-les-Bains AR berthelotjacqueline@mahe.fr \n", "2 Stanleyfurt ZA middletonconor@hotmail.com \n", "3 Neubrandenburg Berlin sophia01@yahoo.de \n", "4 Carlosmouth Texas tross@jensen-ware.org \n", "... ... ... ... \n", "2075 Luckenwalde Hamburg gutknechtevelyn@niemeier.com \n", "2076 Mooneybury Maryland ahleythoa@ail.co \n", "2077 Duval-les-Bains CH aruiz@reynaud.fr \n", "2078 Huesca Asturias manuelamosquera@yahoo.com \n", "2079 Bradfordborough North Dakota lcruz@gmail.com \n", "\n", " user_name \n", "0 ndavidson \n", "1 manonallain \n", "2 colemanmichael \n", "3 romanjunitz \n", "4 adam78 \n", "... ... \n", "2075 dkreusel \n", "2076 kennethrchn \n", "2077 dorothee41 \n", "2078 eugenia17 \n", "2079 cnewton \n", "\n", "[2080 rows x 8 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.2 Display data types\n", "\n", "For this we use [pandas.DataFrame.dtypes](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dtypes.html):" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:37.234059Z", "iopub.status.busy": "2026-05-20T13:54:37.233659Z", "iopub.status.idle": "2026-05-20T13:54:37.240275Z", "shell.execute_reply": "2026-05-20T13:54:37.239253Z", "shell.execute_reply.started": "2026-05-20T13:54:37.234018Z" } }, "outputs": [ { "data": { "text/plain": [ "name object\n", "job object\n", "company object\n", "street_address object\n", "city object\n", "state object\n", "email object\n", "user_name object\n", "dtype: object" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers.dtypes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.3 Determining missing values\n", "\n", "[pandas.isnull](https://pandas.pydata.org/docs/reference/api/pandas.isnull.html) shows whether values are missing for an array-like object:\n", "\n", "* `NaN` in numeric arrays\n", "* `None` or `NaN` in object arrays\n", "* `NaT` in [datetimelike](https://pandas.pydata.org/docs/reference/general_functions.html#top-level-dealing-with-datetimelike-data)\n", "\n", "> **See also:**\n", "> \n", "> * [notna](https://pandas.pydata.org/docs/reference/api/pandas.notna.html) for the Boolean inverse of [pandas.isna](https://pandas.pydata.org/docs/reference/api/pandas.isna.html)\n", "> * [Series.isna](https://pandas.pydata.org/docs/reference/api/pandas.Series.isna.html) for the missing values in a series\n", "> * [DataFrame.isna](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.isna.html) for the missing values in a DataFrame\n", "> * [Index.isna](https://pandas.pydata.org/docs/reference/api/pandas.Index.isna.html) for the missing values in an index" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:37.822319Z", "iopub.status.busy": "2026-05-20T13:54:37.821726Z", "iopub.status.idle": "2026-05-20T13:54:37.828532Z", "shell.execute_reply": "2026-05-20T13:54:37.827715Z", "shell.execute_reply.started": "2026-05-20T13:54:37.822277Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "name 0\n", "job 0\n", "company 0\n", "street_address 0\n", "city 0\n", "state 0\n", "email 0\n", "user_name 0\n" ] } ], "source": [ "for col in customers.columns:\n", " print(col, customers[col].isna().sum())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.4 Determine duplicated data records" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:38.333475Z", "iopub.status.busy": "2026-05-20T13:54:38.333169Z", "iopub.status.idle": "2026-05-20T13:54:38.341147Z", "shell.execute_reply": "2026-05-20T13:54:38.340739Z", "shell.execute_reply.started": "2026-05-20T13:54:38.333453Z" } }, "outputs": [ { "data": { "text/plain": [ "0 False\n", "1 False\n", "2 False\n", "3 False\n", "4 False\n", " ... \n", "2075 False\n", "2076 False\n", "2077 False\n", "2078 False\n", "2079 False\n", "Length: 2080, dtype: bool" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers.duplicated()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`customers.duplicated()` does not yet give us the desired indication of whether there are duplicate data records. In the following, we display all data records for which `True` is returned:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:38.879438Z", "iopub.status.busy": "2026-05-20T13:54:38.879011Z", "iopub.status.idle": "2026-05-20T13:54:38.891583Z", "shell.execute_reply": "2026-05-20T13:54:38.891186Z", "shell.execute_reply.started": "2026-05-20T13:54:38.879409Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namejobcompanystreet_addresscitystateemailuser_name
\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: [name, job, company, street_address, city, state, email, user_name]\n", "Index: []" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers[customers.duplicated()]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Obviously there are no identical data records." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.5 Deleting duplicated data\n", "\n", "Deleting duplicate data records with `drop_duplicates` should therefore not change anything and leave the number of data records at 2080:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:39.747365Z", "iopub.status.busy": "2026-05-20T13:54:39.746779Z", "iopub.status.idle": "2026-05-20T13:54:39.759970Z", "shell.execute_reply": "2026-05-20T13:54:39.759482Z", "shell.execute_reply.started": "2026-05-20T13:54:39.747319Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namejobcompanystreet_addresscitystateemailuser_name
0Patricia SchaeferProgrammer, systemsEstrada-Best398 Paul DriveChristianviewDelawarelambdavid@gmail.comndavidson
1Olivie DuboisIngénieur recherche et développement en agroal...Morenorue Lucas BenardSaint Anastasie-les-BainsARberthelotjacqueline@mahe.frmanonallain
2Mary Davies-KirkPublic affairs consultantBaker LtdFlat 3\\nPugh mewsStanleyfurtZAmiddletonconor@hotmail.comcolemanmichael
3Miroslawa EckbauerDispensing opticianLadeck GmbHMijo-Lübs-Straße 12NeubrandenburgBerlinsophia01@yahoo.deromanjunitz
4Richard BauerAccountant, chartered certifiedHoffman-Rocha6541 Rodriguez WallCarlosmouthTexastross@jensen-ware.orgadam78
...........................
2075Maurice SteySystems developerLinke Margraf GmbH & Co. OHGLaila-Scheibe-Allee 2/0LuckenwaldeHamburggutknechtevelyn@niemeier.comdkreusel
2076Linda AlexanderCommrcil horiculuriWebb, Ballald and Vasquel5594 Persn CiffMooneyburyMarylandahleythoa@ail.cokennethrchn
2077Diane BaillyPharmacienVoisin527, rue DijouxDuval-les-BainsCHaruiz@reynaud.frdorothee41
2078Jorge Riba CerdánHotel managerAmador-DiegoRambla de Adriana Barceló 854 Puerta 3HuescaAsturiasmanuelamosquera@yahoo.comeugenia17
2079Ryan ThompsonBrewing technologistSmith-Sullivan136 Rodriguez PointBradfordboroughNorth Dakotalcruz@gmail.comcnewton
\n", "

2080 rows × 8 columns

\n", "
" ], "text/plain": [ " name job \\\n", "0 Patricia Schaefer Programmer, systems \n", "1 Olivie Dubois Ingénieur recherche et développement en agroal... \n", "2 Mary Davies-Kirk Public affairs consultant \n", "3 Miroslawa Eckbauer Dispensing optician \n", "4 Richard Bauer Accountant, chartered certified \n", "... ... ... \n", "2075 Maurice Stey Systems developer \n", "2076 Linda Alexander Commrcil horiculuri \n", "2077 Diane Bailly Pharmacien \n", "2078 Jorge Riba Cerdán Hotel manager \n", "2079 Ryan Thompson Brewing technologist \n", "\n", " company street_address \\\n", "0 Estrada-Best 398 Paul Drive \n", "1 Moreno rue Lucas Benard \n", "2 Baker Ltd Flat 3\\nPugh mews \n", "3 Ladeck GmbH Mijo-Lübs-Straße 12 \n", "4 Hoffman-Rocha 6541 Rodriguez Wall \n", "... ... ... \n", "2075 Linke Margraf GmbH & Co. OHG Laila-Scheibe-Allee 2/0 \n", "2076 Webb, Ballald and Vasquel 5594 Persn Ciff \n", "2077 Voisin 527, rue Dijoux \n", "2078 Amador-Diego Rambla de Adriana Barceló 854 Puerta 3 \n", "2079 Smith-Sullivan 136 Rodriguez Point \n", "\n", " city state email \\\n", "0 Christianview Delaware lambdavid@gmail.com \n", "1 Saint Anastasie-les-Bains AR berthelotjacqueline@mahe.fr \n", "2 Stanleyfurt ZA middletonconor@hotmail.com \n", "3 Neubrandenburg Berlin sophia01@yahoo.de \n", "4 Carlosmouth Texas tross@jensen-ware.org \n", "... ... ... ... \n", "2075 Luckenwalde Hamburg gutknechtevelyn@niemeier.com \n", "2076 Mooneybury Maryland ahleythoa@ail.co \n", "2077 Duval-les-Bains CH aruiz@reynaud.fr \n", "2078 Huesca Asturias manuelamosquera@yahoo.com \n", "2079 Bradfordborough North Dakota lcruz@gmail.com \n", "\n", " user_name \n", "0 ndavidson \n", "1 manonallain \n", "2 colemanmichael \n", "3 romanjunitz \n", "4 adam78 \n", "... ... \n", "2075 dkreusel \n", "2076 kennethrchn \n", "2077 dorothee41 \n", "2078 eugenia17 \n", "2079 cnewton \n", "\n", "[2080 rows x 8 columns]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers.drop_duplicates()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we want to display those data records for which `user_name` is identical:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:40.292799Z", "iopub.status.busy": "2026-05-20T13:54:40.292189Z", "iopub.status.idle": "2026-05-20T13:54:40.309357Z", "shell.execute_reply": "2026-05-20T13:54:40.308890Z", "shell.execute_reply.started": "2026-05-20T13:54:40.292756Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namejobcompanystreet_addresscitystateemailuser_name
337Aysel BinnerReccig officerKuhl Kalleww Swifwunw & Co. KGaABatix-Kanz-Staß 5/4FuldaBerlifrncoise@wgnercochristinefinke
377Jolanta RoggeAccommodation managrScholl e.V.Lrchplz 4/6MettmnnThüringeninrharff@yah.dwalentinabeier
506Mrs. Frances PetersFuiue desieRsgers, Lawrence and RichardsStudio \\nCarpntr kysWes SimnBOhalenewilliams@wilson-sandes.ogamy17
545Gerhart Krebs MBA.SurgeonRoskothKühnertweg 863StadeBayernolav44@bolander.debettyhahn
592Folkert GnatzMeteorologistBolnbachHeinfried-Austermühle-Ring 05EilenburgThüringenjaentschbirgitt@boerner.orgfrancesco44
633Manon JacquotIngénieur en aéronautiqueJacob8, chemin Éléonore EvrardMarechal-les-BainsARilemaitre@voila.frastrid58
658Austin WallerInsurance risk surveyorSexton Group11097 Hansen FieldDavidmouthTexaschristina74@doyle-baker.bizolynn
723Wanda MoranSolicitor, ScotlandEstes PLC08011 Hernandez Streets Apt. 149NatalieshireOregonhowardreginald@gmail.comdana91
762Charles RussellScientist, research (physical sciences)Preston-Wilson6709 Ashley Circle Apt. 309DanielbergSouth Dakotanancyescobar@brown.netruben71
772Waltrud WohlgemutDesigner, fashion/clothingNerger AGElmar-Ullmann-Allee 6SchlüchternRheinland-Pfalzauch-schlauchindietlind@gmx.dezitakuhl
783Caroline MataEngineer, elecricalGrimes Grrur80157 Whte Alley Sute 79Soh MarkIwjared52@aoo.comthomasthompson
889Ricardo Ripoll LucenaTeevisi camera peratrLuzq Estraqa anq GalinqqCaejón Rosario Viapana 16PalenciaLgoev0@oo.comcolomerenrique
928Sophie Letellier du CarpentierCnucteu e étValle7 SARL3, boulvard Jan AugrSaint DaviddanBSrdorm@dbmi.comanne28
979Irene Roda DávilaEitor, maazine featresDaza IncRoda Carla Miró 5ViyLa Rioasldrpére@ps.cmipeñalver
995Abigail HernandezMechanical engineerSmith Ltd766 Adrian RanchEllismouthColoradojordan60@gmail.commendozajody
1015Mr. Paul NewtonGovernment soa researh offerLemnardmWatsmnStudi 86\\nKaty illWest JueVEem@mil.cmbbennett
1043Anna AdamsProgrammer alcatonsJones Gjoup22 Kateen ovaNoth JoaKZasleig65@aisay.colloydann
1052Aurélie VidalMagistratMartins88, rue Stéphanie LetellierRouxnecSEboutineric@blin.friwagner
1062Regina Schacht-KuschHerbalistHartung GmbH & Co. KGaAWenke-Hörle-Ring 36EggenfeldenSachsen-Anhaltoluebs@troest.dexklotz
1120Jeffrey BenjaminPubl house managerChcn Inc27 Rodgrs Rdgs Apt. 269Suth JefferergIinoisstepanie90@rogers.colori67
1170Julio Agustín AmayaTax aviserPiñolk Belmonke and CodinaCalleón de Gregorio Bustamante 28 Piso 7La PalaSalamancausolana@jáuregui-pedraza.omgloriaolmo
1339Ing. Andrew Schleich B.A.LnHolt Putz GnRHugasse 8/8HainichnNeersachsenjun@putz.comjesselmaja
1360Frédérique Lejeune-DanielTecce cseSctmittchemin Denise FerrandSaint ChalotteVilleIEjchretien@costacomjoseph60
1384Kenneth MooreMagazine journalistCross, Bfll anf Diaz753 Lindsey PineThompsonsheColoraoashey28@rice.cotodd72
1423Thomas CoulonCollecteur de fondsLevy91, rue Laetitia ColletDias-sur-NormandSCdeschampsgabriel@guyot.frmichelepetit
1433Jerry BarnesTour mnerCol-Wllllams30 Mpy OvepassJeiferviewUtahinsnashl@gas-hais.cmchristopher62
1452Karen WeeksPsychotherapist, childRodriguez, Brady and Jackson233 Kevin StreetLarrysideIndianagregg39@hernandez-gomez.comknapprobert
1489Herr Johann EigenwilligImmigration officerSüßebier Hänel GmbHLangernplatz 0StadtsteinachThüringenhaasemarieluise@noack.comistoll
1544Pasquale SchwitalTrade mark attorneyFinkeDetlef-Binner-Platz 0/1BurgNiedersachsenhanne-lore98@gmx.dethomas14
1557Stephanie YoungHerpetologistBryant and Sons5163 Rebecca Creek Suite 421North TheresabergAlaskastephenwilliams@summers.comahawkins
1567Carolina Reguera SanzFam manaeCami77, C7aparr7 a7d N7gu7raVil e Imel Oorio 25MaddVicayamordóñ@cámara.infoeva16
1616Sonia AmoresSenir tax prfessina/tax inspectrJ5an-NúñezAvnida d Grgorio Manón 344 Prta 8PonevedrLugoicent4@montenero-brroso.infosanmartínguillermo
1647Juan Carlos Iker Boix RosPre phtgrapherPont, P44om4r4s 4nd Arjon4Pasadzo de Josep Bentez PsoLas PalmasMiasrgio24@gail.coluis-miguel23
1652Jörg HenschelChaity officeSchicke AGHennyLorchRng 484Hohensein-EnshBadenWürtteberghuerhes@hmal.deanne-katrin51
1703Marc TateShip brokerWagner, Mitchell and Grimes721 Christopher View Suite 840WatsonmouthConnecticutchenjessica@hotmail.compatricia34
1707Joseph HinesPyhiatri nreCr4ig, G4rci4 4nd Rich4rds85663 Savage GlesMcgeeonAlsbcaldern@htmail.cmemilytorres
1722Julie BaldwinSet deignerW5ll55mson-G5rz558513 Paricia Res Suie 45So MeAlaskadiuez@uess.cmoss
1759Sarah HoffmanExhibitin designeHensont Wiley and Ryan9490 Curts Spur Sute 82JseptwnArizonancole@yahoo.comcsmith
1796Valentine Devaux-RogerDireceur d'ôialLeiris57, enue de GrosBenadBouALrogrlro@munoz.omxherve
1809Slavica SeidelPsychotherapist, childWulff Hande KGPreißgasse 0/4SoestRheinland-Pfalztloos@krause.netabien
1820Wenke SchweitzerEnginr, automotiWesa4k KGEies. 7Ba LnwraThürigersthveriue@mies.rgkwernecke
1829Dr. Thomas HeinCopyGeiselLadeckgasse 11RockenhausenNordrhein-Westfalengrein-grotharnim@kallert.desiegmar08
1837Andrew HartEngineer, civil (contracting)Barnett LLC258 Day Hollow Suite 410KimberlyhavenColoradobrandy00@yahoo.comamy30
1914Shelby FowlerAir traffic controllerFields-Sanchez533 Fitzpatrick BypassFrancesbergMichiganterrystephen@anderson.orggcain
1938Susan AubryDirecteur d'agence bancairePayet Georges S.A.S.67, rue Inès ValentinNicolasFImilletedith@sfr.frtthierry
1948Richard Karge-KobeltJunalist maaineAbberb Keubeb AGMitschkeee 8SachsnAnhaltnrejwgner@gmx.emuehlehenni
1960Anna de LobatoMedcl techcl ocerMaciag PLCCalleón de Dolore Parea 21 At 7PalnciaCantariavázqzlornzo@al.omdaniel70
1968Zoltan Wähner B.A.Professor EmeritsTh8e8Stotr. 1SaulgauShlsg-Holstarlenpruschke@salz.orkklemm
1995Kenneth DunnProgrammer, systemsLeonard Inc5361 Patterson Mission Suite 504VillaburghRhode Islandkristen54@gmail.comjkent
2010Gertraude SchomberInsurance risk surveyorBruderChrista-Ullrich-Allee 0/1Schwäbisch HallHessengumprichalice@schmidt.defruppert
2075Maurice SteySystems developerLinke Margraf GmbH & Co. OHGLaila-Scheibe-Allee 2/0LuckenwaldeHamburggutknechtevelyn@niemeier.comdkreusel
\n", "
" ], "text/plain": [ " name job \\\n", "337 Aysel Binner Reccig officer \n", "377 Jolanta Rogge Accommodation managr \n", "506 Mrs. Frances Peters Fuiue desie \n", "545 Gerhart Krebs MBA. Surgeon \n", "592 Folkert Gnatz Meteorologist \n", "633 Manon Jacquot Ingénieur en aéronautique \n", "658 Austin Waller Insurance risk surveyor \n", "723 Wanda Moran Solicitor, Scotland \n", "762 Charles Russell Scientist, research (physical sciences) \n", "772 Waltrud Wohlgemut Designer, fashion/clothing \n", "783 Caroline Mata Engineer, elecrical \n", "889 Ricardo Ripoll Lucena Teevisi camera peratr \n", "928 Sophie Letellier du Carpentier Cnucteu e ét \n", "979 Irene Roda Dávila Eitor, maazine featres \n", "995 Abigail Hernandez Mechanical engineer \n", "1015 Mr. Paul Newton Government soa researh offer \n", "1043 Anna Adams Programmer alcatons \n", "1052 Aurélie Vidal Magistrat \n", "1062 Regina Schacht-Kusch Herbalist \n", "1120 Jeffrey Benjamin Publ house manager \n", "1170 Julio Agustín Amaya Tax aviser \n", "1339 Ing. Andrew Schleich B.A. Ln \n", "1360 Frédérique Lejeune-Daniel Tecce cse \n", "1384 Kenneth Moore Magazine journalist \n", "1423 Thomas Coulon Collecteur de fonds \n", "1433 Jerry Barnes Tour mner \n", "1452 Karen Weeks Psychotherapist, child \n", "1489 Herr Johann Eigenwillig Immigration officer \n", "1544 Pasquale Schwital Trade mark attorney \n", "1557 Stephanie Young Herpetologist \n", "1567 Carolina Reguera Sanz Fam manae \n", "1616 Sonia Amores Senir tax prfessina/tax inspectr \n", "1647 Juan Carlos Iker Boix Ros Pre phtgrapher \n", "1652 Jörg Henschel Chaity office \n", "1703 Marc Tate Ship broker \n", "1707 Joseph Hines Pyhiatri nre \n", "1722 Julie Baldwin Set deigner \n", "1759 Sarah Hoffman Exhibitin designe \n", "1796 Valentine Devaux-Roger Direceur d'ôial \n", "1809 Slavica Seidel Psychotherapist, child \n", "1820 Wenke Schweitzer Enginr, automoti \n", "1829 Dr. Thomas Hein Copy \n", "1837 Andrew Hart Engineer, civil (contracting) \n", "1914 Shelby Fowler Air traffic controller \n", "1938 Susan Aubry Directeur d'agence bancaire \n", "1948 Richard Karge-Kobelt Junalist maaine \n", "1960 Anna de Lobato Medcl techcl ocer \n", "1968 Zoltan Wähner B.A. Professor Emerits \n", "1995 Kenneth Dunn Programmer, systems \n", "2010 Gertraude Schomber Insurance risk surveyor \n", "2075 Maurice Stey Systems developer \n", "\n", " company \\\n", "337 Kuhl Kalleww Swifwunw & Co. KGaA \n", "377 Scholl e.V. \n", "506 Rsgers, Lawrence and Richards \n", "545 Roskoth \n", "592 Bolnbach \n", "633 Jacob \n", "658 Sexton Group \n", "723 Estes PLC \n", "762 Preston-Wilson \n", "772 Nerger AG \n", "783 Grimes Grrur \n", "889 Luzq Estraqa anq Galinqq \n", "928 Valle7 SARL \n", "979 Daza Inc \n", "995 Smith Ltd \n", "1015 LemnardmWatsmn \n", "1043 Jones Gjoup \n", "1052 Martins \n", "1062 Hartung GmbH & Co. KGaA \n", "1120 Chcn Inc \n", "1170 Piñolk Belmonke and Codina \n", "1339 Holt Putz GnR \n", "1360 Sctmitt \n", "1384 Cross, Bfll anf Diaz \n", "1423 Levy \n", "1433 Col-Wllllams \n", "1452 Rodriguez, Brady and Jackson \n", "1489 Süßebier Hänel GmbH \n", "1544 Finke \n", "1557 Bryant and Sons \n", "1567 Cami77, C7aparr7 a7d N7gu7ra \n", "1616 J5an-Núñez \n", "1647 Pont, P44om4r4s 4nd Arjon4 \n", "1652 Schicke AG \n", "1703 Wagner, Mitchell and Grimes \n", "1707 Cr4ig, G4rci4 4nd Rich4rds \n", "1722 W5ll55mson-G5rz5 \n", "1759 Hensont Wiley and Ryan \n", "1796 Leiris \n", "1809 Wulff Hande KG \n", "1820 Wesa4k KG \n", "1829 Geisel \n", "1837 Barnett LLC \n", "1914 Fields-Sanchez \n", "1938 Payet Georges S.A.S. \n", "1948 Abberb Keubeb AG \n", "1960 Maciag PLC \n", "1968 Th8e8 \n", "1995 Leonard Inc \n", "2010 Bruder \n", "2075 Linke Margraf GmbH & Co. OHG \n", "\n", " street_address city \\\n", "337 Batix-Kanz-Staß 5/4 Fulda \n", "377 Lrchplz 4/6 Mettmnn \n", "506 Studio \\nCarpntr kys Wes Simn \n", "545 Kühnertweg 863 Stade \n", "592 Heinfried-Austermühle-Ring 05 Eilenburg \n", "633 8, chemin Éléonore Evrard Marechal-les-Bains \n", "658 11097 Hansen Field Davidmouth \n", "723 08011 Hernandez Streets Apt. 149 Natalieshire \n", "762 6709 Ashley Circle Apt. 309 Danielberg \n", "772 Elmar-Ullmann-Allee 6 Schlüchtern \n", "783 80157 Whte Alley Sute 79 Soh Mark \n", "889 Caejón Rosario Viapana 16 Palencia \n", "928 3, boulvard Jan Augr Saint Daviddan \n", "979 Roda Carla Miró 5 Viy \n", "995 766 Adrian Ranch Ellismouth \n", "1015 Studi 86\\nKaty ill West Jue \n", "1043 22 Kateen ova Noth Joa \n", "1052 88, rue Stéphanie Letellier Rouxnec \n", "1062 Wenke-Hörle-Ring 36 Eggenfelden \n", "1120 27 Rodgrs Rdgs Apt. 269 Suth Jeffererg \n", "1170 Calleón de Gregorio Bustamante 28 Piso 7 La Pala \n", "1339 Hugasse 8/8 Hainichn \n", "1360 chemin Denise Ferrand Saint ChalotteVille \n", "1384 753 Lindsey Pine Thompsonshe \n", "1423 91, rue Laetitia Collet Dias-sur-Normand \n", "1433 30 Mpy Ovepass Jeiferview \n", "1452 233 Kevin Street Larryside \n", "1489 Langernplatz 0 Stadtsteinach \n", "1544 Detlef-Binner-Platz 0/1 Burg \n", "1557 5163 Rebecca Creek Suite 421 North Theresaberg \n", "1567 Vil e Imel Oorio 25 Madd \n", "1616 Avnida d Grgorio Manón 344 Prta 8 Ponevedr \n", "1647 Pasadzo de Josep Bentez Pso Las Palmas \n", "1652 HennyLorchRng 484 Hohensein-Ensh \n", "1703 721 Christopher View Suite 840 Watsonmouth \n", "1707 85663 Savage Gles Mcgeeon \n", "1722 58513 Paricia Res Suie 45 So Me \n", "1759 9490 Curts Spur Sute 82 Jseptwn \n", "1796 57, enue de Gros BenadBou \n", "1809 Preißgasse 0/4 Soest \n", "1820 Eies. 7 Ba Lnwra \n", "1829 Ladeckgasse 11 Rockenhausen \n", "1837 258 Day Hollow Suite 410 Kimberlyhaven \n", "1914 533 Fitzpatrick Bypass Francesberg \n", "1938 67, rue Inès Valentin Nicolas \n", "1948 Mitschkeee 8 Mß \n", "1960 Calleón de Dolore Parea 21 At 7 Palncia \n", "1968 Stotr. 1 Saulgau \n", "1995 5361 Patterson Mission Suite 504 Villaburgh \n", "2010 Christa-Ullrich-Allee 0/1 Schwäbisch Hall \n", "2075 Laila-Scheibe-Allee 2/0 Luckenwalde \n", "\n", " state email user_name \n", "337 Berli frncoise@wgnerco christinefinke \n", "377 Thüringen inrharff@yah.d walentinabeier \n", "506 BO halenewilliams@wilson-sandes.og amy17 \n", "545 Bayern olav44@bolander.de bettyhahn \n", "592 Thüringen jaentschbirgitt@boerner.org francesco44 \n", "633 AR ilemaitre@voila.fr astrid58 \n", "658 Texas christina74@doyle-baker.biz olynn \n", "723 Oregon howardreginald@gmail.com dana91 \n", "762 South Dakota nancyescobar@brown.net ruben71 \n", "772 Rheinland-Pfalz auch-schlauchindietlind@gmx.de zitakuhl \n", "783 Iw jared52@aoo.com thomasthompson \n", "889 Lgo ev0@oo.com colomerenrique \n", "928 BS rdorm@dbmi.com anne28 \n", "979 La Rioa sldrpére@ps.cm ipeñalver \n", "995 Colorado jordan60@gmail.com mendozajody \n", "1015 VE em@mil.cm bbennett \n", "1043 KZ asleig65@aisay.co lloydann \n", "1052 SE boutineric@blin.fr iwagner \n", "1062 Sachsen-Anhalt oluebs@troest.de xklotz \n", "1120 Iinois stepanie90@rogers.co lori67 \n", "1170 Salamanca usolana@jáuregui-pedraza.om gloriaolmo \n", "1339 Neersachsen jun@putz.com jesselmaja \n", "1360 IE jchretien@costacom joseph60 \n", "1384 Colorao ashey28@rice.co todd72 \n", "1423 SC deschampsgabriel@guyot.fr michelepetit \n", "1433 Utah insnashl@gas-hais.cm christopher62 \n", "1452 Indiana gregg39@hernandez-gomez.com knapprobert \n", "1489 Thüringen haasemarieluise@noack.com istoll \n", "1544 Niedersachsen hanne-lore98@gmx.de thomas14 \n", "1557 Alaska stephenwilliams@summers.com ahawkins \n", "1567 Vicaya mordóñ@cámara.info eva16 \n", "1616 Lugo icent4@montenero-brroso.info sanmartínguillermo \n", "1647 Mia srgio24@gail.co luis-miguel23 \n", "1652 BadenWürtteberg huerhes@hmal.de anne-katrin51 \n", "1703 Connecticut chenjessica@hotmail.com patricia34 \n", "1707 Als bcaldern@htmail.cm emilytorres \n", "1722 Alaska diuez@uess. cmoss \n", "1759 Arizona ncole@yahoo.com csmith \n", "1796 AL rogrlro@munoz.om xherve \n", "1809 Rheinland-Pfalz tloos@krause.net abien \n", "1820 Thürige rsthveriue@mies.rg kwernecke \n", "1829 Nordrhein-Westfalen grein-grotharnim@kallert.de siegmar08 \n", "1837 Colorado brandy00@yahoo.com amy30 \n", "1914 Michigan terrystephen@anderson.org gcain \n", "1938 FI milletedith@sfr.fr tthierry \n", "1948 SachsnAnhalt nrejwgner@gmx.e muehlehenni \n", "1960 Cantaria vázqzlornzo@al.om daniel70 \n", "1968 Shlsg-Holst arlenpruschke@salz.or kklemm \n", "1995 Rhode Island kristen54@gmail.com jkent \n", "2010 Hessen gumprichalice@schmidt.de fruppert \n", "2075 Hamburg gutknechtevelyn@niemeier.com dkreusel " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers[customers.duplicated([\"user_name\"])]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can display the associated data records, for example with:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:40.977946Z", "iopub.status.busy": "2026-05-20T13:54:40.977662Z", "iopub.status.idle": "2026-05-20T13:54:40.989360Z", "shell.execute_reply": "2026-05-20T13:54:40.988825Z", "shell.execute_reply.started": "2026-05-20T13:54:40.977929Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namejobcompanystreet_addresscitystateemailuser_name
236Aysel BinnerRecycling officerKuhl Kallert Stiftung & Co. KGaABeatrix-Kranz-Straße 5/4FuldaBerlinfrancoise22@wagner.comchristinefinke
337Aysel BinnerReccig officerKuhl Kalleww Swifwunw & Co. KGaABatix-Kanz-Staß 5/4FuldaBerlifrncoise@wgnercochristinefinke
\n", "
" ], "text/plain": [ " name job company \\\n", "236 Aysel Binner Recycling officer Kuhl Kallert Stiftung & Co. KGaA \n", "337 Aysel Binner Reccig officer Kuhl Kalleww Swifwunw & Co. KGaA \n", "\n", " street_address city state email \\\n", "236 Beatrix-Kranz-Straße 5/4 Fulda Berlin francoise22@wagner.com \n", "337 Batix-Kanz-Staß 5/4 Fulda Berli frncoise@wgnerco \n", "\n", " user_name \n", "236 christinefinke \n", "337 christinefinke " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers[customers[\"user_name\"] == \"christinefinke\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we can delete those data records whose `user_name` is identical:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:41.570266Z", "iopub.status.busy": "2026-05-20T13:54:41.569990Z", "iopub.status.idle": "2026-05-20T13:54:41.579165Z", "shell.execute_reply": "2026-05-20T13:54:41.578680Z", "shell.execute_reply.started": "2026-05-20T13:54:41.570248Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namejobcompanystreet_addresscitystateemailuser_name
0Patricia SchaeferProgrammer, systemsEstrada-Best398 Paul DriveChristianviewDelawarelambdavid@gmail.comndavidson
1Olivie DuboisIngénieur recherche et développement en agroal...Morenorue Lucas BenardSaint Anastasie-les-BainsARberthelotjacqueline@mahe.frmanonallain
2Mary Davies-KirkPublic affairs consultantBaker LtdFlat 3\\nPugh mewsStanleyfurtZAmiddletonconor@hotmail.comcolemanmichael
3Miroslawa EckbauerDispensing opticianLadeck GmbHMijo-Lübs-Straße 12NeubrandenburgBerlinsophia01@yahoo.deromanjunitz
4Richard BauerAccountant, chartered certifiedHoffman-Rocha6541 Rodriguez WallCarlosmouthTexastross@jensen-ware.orgadam78
...........................
2074Rhonda JamesRecruitment consultantTurner, Bradley and Scott28382 Stokes ExpresswayPort GabrielaportNew Hampshirezroberts@hotmail.comheathscott
2076Linda AlexanderCommrcil horiculuriWebb, Ballald and Vasquel5594 Persn CiffMooneyburyMarylandahleythoa@ail.cokennethrchn
2077Diane BaillyPharmacienVoisin527, rue DijouxDuval-les-BainsCHaruiz@reynaud.frdorothee41
2078Jorge Riba CerdánHotel managerAmador-DiegoRambla de Adriana Barceló 854 Puerta 3HuescaAsturiasmanuelamosquera@yahoo.comeugenia17
2079Ryan ThompsonBrewing technologistSmith-Sullivan136 Rodriguez PointBradfordboroughNorth Dakotalcruz@gmail.comcnewton
\n", "

2029 rows × 8 columns

\n", "
" ], "text/plain": [ " name job \\\n", "0 Patricia Schaefer Programmer, systems \n", "1 Olivie Dubois Ingénieur recherche et développement en agroal... \n", "2 Mary Davies-Kirk Public affairs consultant \n", "3 Miroslawa Eckbauer Dispensing optician \n", "4 Richard Bauer Accountant, chartered certified \n", "... ... ... \n", "2074 Rhonda James Recruitment consultant \n", "2076 Linda Alexander Commrcil horiculuri \n", "2077 Diane Bailly Pharmacien \n", "2078 Jorge Riba Cerdán Hotel manager \n", "2079 Ryan Thompson Brewing technologist \n", "\n", " company street_address \\\n", "0 Estrada-Best 398 Paul Drive \n", "1 Moreno rue Lucas Benard \n", "2 Baker Ltd Flat 3\\nPugh mews \n", "3 Ladeck GmbH Mijo-Lübs-Straße 12 \n", "4 Hoffman-Rocha 6541 Rodriguez Wall \n", "... ... ... \n", "2074 Turner, Bradley and Scott 28382 Stokes Expressway \n", "2076 Webb, Ballald and Vasquel 5594 Persn Ciff \n", "2077 Voisin 527, rue Dijoux \n", "2078 Amador-Diego Rambla de Adriana Barceló 854 Puerta 3 \n", "2079 Smith-Sullivan 136 Rodriguez Point \n", "\n", " city state email \\\n", "0 Christianview Delaware lambdavid@gmail.com \n", "1 Saint Anastasie-les-Bains AR berthelotjacqueline@mahe.fr \n", "2 Stanleyfurt ZA middletonconor@hotmail.com \n", "3 Neubrandenburg Berlin sophia01@yahoo.de \n", "4 Carlosmouth Texas tross@jensen-ware.org \n", "... ... ... ... \n", "2074 Port Gabrielaport New Hampshire zroberts@hotmail.com \n", "2076 Mooneybury Maryland ahleythoa@ail.co \n", "2077 Duval-les-Bains CH aruiz@reynaud.fr \n", "2078 Huesca Asturias manuelamosquera@yahoo.com \n", "2079 Bradfordborough North Dakota lcruz@gmail.com \n", "\n", " user_name \n", "0 ndavidson \n", "1 manonallain \n", "2 colemanmichael \n", "3 romanjunitz \n", "4 adam78 \n", "... ... \n", "2074 heathscott \n", "2076 kennethrchn \n", "2077 dorothee41 \n", "2078 eugenia17 \n", "2079 cnewton \n", "\n", "[2029 rows x 8 columns]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers.drop_duplicates([\"user_name\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This deleted 51 data records." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Dedupe \n", "\n", "Alternatively, we can recognise the duplicated data with the [Dedupe](https://docs.dedupe.io/en/latest/) library, which uses a shallow neural network to learn from a small training.\n", "\n", "
\n", "\n", "**See also:**\n", "\n", "[csvdedupe](https://github.com/dedupeio/csvdedupe) offers a command line tool for dedupe.\n", "
\n", "\n", "In addition, the same developers have created [parserator](https://github.com/datamade/parserator), which you can use to extract text functions and train your own text extraction." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.1 Configuring Dedupe\n", "\n", "Now we define the fields to be taken into account during deduplication and create a new `deduper` object:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:42.908044Z", "iopub.status.busy": "2026-05-20T13:54:42.907744Z", "iopub.status.idle": "2026-05-20T13:54:43.920889Z", "shell.execute_reply": "2026-05-20T13:54:43.920314Z", "shell.execute_reply.started": "2026-05-20T13:54:42.908026Z" } }, "outputs": [], "source": [ "from pathlib import Path\n", "\n", "import dedupe\n", "\n", "\n", "customers = pd.read_csv(\n", " \"https://raw.githubusercontent.com/kjam/data-cleaning-101/master/data/customer_data_duped.csv\",\n", " encoding=\"utf-8\",\n", ")" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:43.922474Z", "iopub.status.busy": "2026-05-20T13:54:43.922217Z", "iopub.status.idle": "2026-05-20T13:54:43.926514Z", "shell.execute_reply": "2026-05-20T13:54:43.926031Z", "shell.execute_reply.started": "2026-05-20T13:54:43.922456Z" } }, "outputs": [], "source": [ "variables = [\n", " dedupe.variables.String(\"name\"),\n", " dedupe.variables.String(\"job\"),\n", " dedupe.variables.String(\"company\"),\n", " dedupe.variables.String(\"street_address\"),\n", " dedupe.variables.String(\"city\"),\n", " dedupe.variables.String(\"state\"),\n", " dedupe.variables.String(\"email\"),\n", " dedupe.variables.String(\"user_name\"),\n", "]\n", "\n", "deduper = dedupe.Dedupe(variables)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If the value of a field is missing, this missing value should be displayed as a `None` object. However, `'has_missing': True` creates a new, additional field that indicates whether the data was present or not, and the missing data is assigned zero.\n", "\n", "
\n", "\n", "**See also:**\n", "\n", "* [Missing Data](https://docs.dedupe.io/en/latest/Variable-definition.html#missing-data)\n", "
" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:44.117199Z", "iopub.status.busy": "2026-05-20T13:54:44.116866Z", "iopub.status.idle": "2026-05-20T13:54:44.120558Z", "shell.execute_reply": "2026-05-20T13:54:44.120105Z", "shell.execute_reply.started": "2026-05-20T13:54:44.117180Z" } }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "deduper" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:45.603691Z", "iopub.status.busy": "2026-05-20T13:54:45.603410Z", "iopub.status.idle": "2026-05-20T13:54:45.607842Z", "shell.execute_reply": "2026-05-20T13:54:45.606717Z", "shell.execute_reply.started": "2026-05-20T13:54:45.603672Z" } }, "outputs": [ { "data": { "text/plain": [ "(2080, 8)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers.shape" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4. Create training data" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:54:46.564905Z", "iopub.status.busy": "2026-05-20T13:54:46.564362Z", "iopub.status.idle": "2026-05-20T13:55:06.426623Z", "shell.execute_reply": "2026-05-20T13:55:06.426191Z", "shell.execute_reply.started": "2026-05-20T13:54:46.564865Z" } }, "outputs": [], "source": [ "deduper.prepare_training(customers.T.to_dict())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[prepare_training](https://docs.dedupe.io/en/latest/API-documentation.html#dedupe.Dedupe.prepare_training) initialises active learning with our data and, optionally, with existing training data.\n", "\n", "`T` mirrors the DataFrame via its diagonal by writing rows as columns and vice versa. For this, [pandas.DataFrame.transpose](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.transpose.html) is used." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5. Active learning\n", "\n", "You can train your dedupe instance with [dedupe.console_label](https://docs.dedupe.io/en/latest/API-documentation.html#dedupe.console_label). If Dedupe finds a pair of data sets, you will be asked to label it as a duplicate. You can use the `y`, `n` and `u` keys to label duplicates. Press `f` when you are finished." ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:55:06.427582Z", "iopub.status.busy": "2026-05-20T13:55:06.427431Z", "iopub.status.idle": "2026-05-20T13:55:57.943038Z", "shell.execute_reply": "2026-05-20T13:55:57.942617Z", "shell.execute_reply.started": "2026-05-20T13:55:06.427569Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "name : Lauren Green\n", "job : Market researcher\n", "company : Chen-Kelly\n", "street_address : 75836 Lopez Plain Suite 513\n", "city : South Matthew\n", "state : Indiana\n", "email : simskevin@gmail.com\n", "user_name : briggsjamie\n", "\n", "name : Lauren Green\n", "job : Maet eeache\n", "company : Chen-Kelly\n", "street_address : 75836 Lopez Plai Suite 53\n", "city : Soh Mahew\n", "state : Indiana\n", "email : smskevn@gmalcom\n", "user_name : risjamie\n", "\n", "0/10 positive, 0/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "name : Anthony Walker\n", "job : Solicitor, Scotland\n", "company : Barrera-Wilcox\n", "street_address : 649 Jacob Harbors\n", "city : Drewton\n", "state : Virginia\n", "email : fjackson@gmail.com\n", "user_name : bethburch\n", "\n", "name : Anthony Walker\n", "job : Solicior Scoland\n", "company : Barrera-Wildox\n", "street_address : 649 Jacb Harbrs\n", "city : Drewton\n", "state : Virginia\n", "email : fjaso@gmail.om\n", "user_name : betbr\n", "\n", "1/10 positive, 0/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished / (p)revious\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "name : Michael Miller\n", "job : Algcal scns\n", "company : Landry Grmmp\n", "street_address : 895 Randy Plains\n", "city : Braorogh\n", "state : Nebaska\n", "email : jul@hotmlcom\n", "user_name : tlas\n", "\n", "name : Michael Miller\n", "job : Audiological scientist\n", "company : Landry Group\n", "street_address : 895 Randy Plains\n", "city : Brayborough\n", "state : Nebraska\n", "email : juliabaird@hotmail.com\n", "user_name : tlucas\n", "\n", "2/10 positive, 0/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished / (p)revious\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "name : Sarah Hoffman\n", "job : Exhibition designer\n", "company : Henson, Wiley and Ryan\n", "street_address : 97490 Curtis Spur Suite 825\n", "city : Josephtown\n", "state : Arizona\n", "email : ncole@yahoo.com\n", "user_name : csmith\n", "\n", "name : Sarah Hoffman\n", "job : Exhibitin designe\n", "company : Hensont Wiley and Ryan\n", "street_address : 9490 Curts Spur Sute 82\n", "city : Jseptwn\n", "state : Arizona\n", "email : ncole@yahoo.com\n", "user_name : csmith\n", "\n", "3/10 positive, 0/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished / (p)revious\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "name : Jonathan Campos\n", "job : Edior, ommissioning\n", "company : Azvazez Inc\n", "street_address : 740 Willia Sals\n", "city : Lake Case\n", "state : Wahington\n", "email : james4@taorcom\n", "user_name : yduy\n", "\n", "name : Jonathan Campos\n", "job : Editor, commissioning\n", "company : Alvarez Inc\n", "street_address : 78840 William Shoals\n", "city : Lake Chase\n", "state : Washington\n", "email : james04@taylor.com\n", "user_name : yduffy\n", "\n", "4/10 positive, 0/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished / (p)revious\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "name : Joerg Hornich\n", "job : Rtal managr\n", "company : H\\.\\.n\n", "street_address : Astrd-Spß-All 09\n", "city : Shmön\n", "state : Meclebr-Vorpommer\n", "email : christine@gx.de\n", "user_name : rsbtte\n", "\n", "name : Joerg Hornich\n", "job : Retail manager\n", "company : Hein\n", "street_address : Astrid-Spieß-Allee 09\n", "city : Schmölln\n", "state : Mecklenburg-Vorpommern\n", "email : christine74@gmx.de\n", "user_name : ursbutte\n", "\n", "5/10 positive, 0/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished / (p)revious\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "name : Martin Butte\n", "job : Sale executve\n", "company : Junhk Stiftung & Chh KG\n", "street_address : Tadus-Tröst-Rin 1/\n", "city : Gen\n", "state : Niedersacsen\n", "email : beckercarlo@googlemail.com\n", "user_name : cmaeler\n", "\n", "name : Hans Eberhardt\n", "job : Research scientist (life sciences)\n", "company : Pruschke Stiftung & Co. KG\n", "street_address : Notburga-Reising-Weg 452\n", "city : Griesbach Rottal\n", "state : Niedersachsen\n", "email : twohlgemut@hotmail.de\n", "user_name : qmuehle\n", "\n", "6/10 positive, 0/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished / (p)revious\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " n\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "name : Andrea Jurado Bas\n", "job : Prnmakr\n", "company : Znrita, Madrid and Cnlladn\n", "street_address : Pasaje Lís Blazqez 29\n", "city : Huesc\n", "state : Ciu\n", "email : foso@rocmor-dgdocom\n", "user_name : jan-franiso\n", "\n", "name : Andrea Jurado Bas\n", "job : Printmaker\n", "company : Zurita, Madrid and Collado\n", "street_address : Pasaje Luís Blazquez 29\n", "city : Huesca\n", "state : Ciudad\n", "email : alfonso33@rocamora-delgado.com\n", "user_name : juan-francisco06\n", "\n", "6/10 positive, 1/10 negative\n", "Do these records refer to the same thing?\n", "(y)es / (n)o / (u)nsure / (f)inished / (p)revious\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " f\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Finished labeling\n" ] } ], "source": [ "dedupe.console_label(deduper)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The last two training datasets compared make it clear that we did not delete this duplicate with our `drop_duplicates` example above – `clittle` and `little` were recognised as different." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With [Dedupe.train](https://docs.dedupe.io/en/latest/API-documentation.html#dedupe.Dedupe.train), the data record pairs you have marked are added to the training data and the matching model is updated.\n", "\n", "With `index_predicates=True`, deduplication also takes into account predicates based on the indexing of the data.\n", "\n", "When you are finished, save your training data with [Dedupe.write_settings](https://docs.dedupe.io/en/latest/API-documentation.html#dedupe.Dedupe.write_settings)." ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:56:16.096488Z", "iopub.status.busy": "2026-05-20T13:56:16.096143Z", "iopub.status.idle": "2026-05-20T13:56:16.103402Z", "shell.execute_reply": "2026-05-20T13:56:16.102772Z", "shell.execute_reply.started": "2026-05-20T13:56:16.096463Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "reading from csv_example_learned_settings\n" ] } ], "source": [ "settings_file = \"csv_example_learned_settings\"\n", "\n", "if Path(settings_file).exists():\n", " print(\"reading from\", settings_file)\n", " with Path.open(settings_file, \"rb\") as f:\n", " deduper = dedupe.StaticDedupe(f)\n", "else:\n", " deduper.train(index_predicates=True)\n", " with Path.open(settings_file, \"wb\") as sf:\n", " deduper.write_settings(sf)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With [dedupe.Dedupe.partition](https://docs.dedupe.io/en/latest/API-documentation.html#dedupe.Dedupe.partition), data sets that all refer to the same entity are identified and returned as tuples that are a sequence of data set IDs and confidence values. Further details on the confidence value can be found at [dedupe.Dedupe.cluster](https://docs.dedupe.io/en/latest/API-documentation.html#dedupe.Dedupe.cluster)." ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:56:19.467411Z", "iopub.status.busy": "2026-05-20T13:56:19.467064Z", "iopub.status.idle": "2026-05-20T13:56:21.704278Z", "shell.execute_reply": "2026-05-20T13:56:21.703801Z", "shell.execute_reply.started": "2026-05-20T13:56:19.467390Z" } }, "outputs": [], "source": [ "dupes = deduper.partition(customers.T.to_dict())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also display only individual entries:" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:56:23.529695Z", "iopub.status.busy": "2026-05-20T13:56:23.529384Z", "iopub.status.idle": "2026-05-20T13:56:23.536929Z", "shell.execute_reply": "2026-05-20T13:56:23.535859Z", "shell.execute_reply.started": "2026-05-20T13:56:23.529674Z" } }, "outputs": [ { "data": { "text/plain": [ "((np.int64(0), np.int64(963)),\n", " (np.float32(0.95884323), np.float32(0.95884323)))" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dupes[0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can then display these with [pandas.DataFrame.iloc](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.iloc.html):" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "execution": { "iopub.execute_input": "2026-05-20T13:56:32.269630Z", "iopub.status.busy": "2026-05-20T13:56:32.269352Z", "iopub.status.idle": "2026-05-20T13:56:32.280610Z", "shell.execute_reply": "2026-05-20T13:56:32.280137Z", "shell.execute_reply.started": "2026-05-20T13:56:32.269611Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namejobcompanystreet_addresscitystateemailuser_name
0Patricia SchaeferProgrammer, systemsEstrada-Best398 Paul DriveChristianviewDelawarelambdavid@gmail.comndavidson
963Patricia SchaeferProrammer, ytemEs:rada-Bes:39 Pul DrveChistianviewDelwrembdvid@gmimndvdson
\n", "
" ], "text/plain": [ " name job company street_address \\\n", "0 Patricia Schaefer Programmer, systems Estrada-Best 398 Paul Drive \n", "963 Patricia Schaefer Prorammer, ytem Es:rada-Bes: 39 Pul Drve \n", "\n", " city state email user_name \n", "0 Christianview Delaware lambdavid@gmail.com ndavidson \n", "963 Chistianview Delwre mbdvid@gmim ndvdson " ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "customers.iloc[[0, 963]]" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.13 Kernel", "language": "python", "name": "python313" }, "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.13.0" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autoclose": false, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }