Skip to content

Commit

Permalink
Update CEN_SKILLNETslice_overview.ipynb
Browse files Browse the repository at this point in the history
Updated notebook: added variable "person of interest" to avoid confusion having to enter it two times (for sender/receiver), now only once.
  • Loading branch information
lilimelgar committed Jan 6, 2023
1 parent a01710f commit eb7e3ef
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/CEN_SKILLNETslice_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
" cen_letters_imp[column] = cen_letters_imp[column].astype(str)\n",
" \n",
"# # Handle exceptions\n",
"cen_letters_imp['emloLetterId_inferredSK'] = cen_letters_imp['emloLetterId_inferredSK'].astype(str)\n",
"# cen_letters_imp['emloLetterId_inferredSK'] = cen_letters_imp['emloLetterId_inferredSK'].astype(str)\n",
"\n",
"# make a copy\n",
"cen_letters = cen_letters_imp.copy()"
Expand Down Expand Up @@ -971,7 +971,7 @@
"outputs": [],
"source": [
"# date-related columns\n",
"letters_dates_df = cen_letters[['SKletterId','ISBD_OriginalCEN', 'titleOriginal', 'YEAR_Original', 'yearItem_start','yearItem_end', 'isYearRange', 'yearRangeType', 'isYearRangeInferredSk', 'isYearItemInferredSk', 'isYearItemInferredSk', 'isYearItemUncertain', 'DATERING_OriginalCEN','dayDatingSk', 'monthDatingSk', 'isDateringUncertain']]\n",
"letters_dates_df = cen_letters[['SKletterId','ISBD_OriginalCEN', 'TITLE_Original', 'YEAR_Original', 'yearItem_start','yearItem_end', 'isYearRange', 'yearRangeType', 'isYearRangeInferredSk', 'isYearItemInferredSk', 'isYearItemInferredSk', 'isYearItemUncertain', 'DATERING_OriginalCEN','dayDatingSk', 'monthDatingSk', 'isDateringUncertain']]\n",
"# date-related columns to display with original data\n",
"letters_dates_original_df = letters_dates_df[['SKletterId','YEAR_Original', 'DATERING_OriginalCEN']]\n",
"letters_dates_original_df.head(500)"
Expand Down Expand Up @@ -1283,9 +1283,9 @@
"outputs": [],
"source": [
"# person-related columns from letters file\n",
"letters_persons_df = cen_letters[['SKletterId','ISBD_OriginalCEN', 'titleOriginal', 'AFZENDER_OriginalCEN','isUncertainAfzender', 'ONTVANGER_OriginalCEN', 'isUncertainOntvanger']]\n",
"letters_persons_df = cen_letters[['SKletterId','ISBD_OriginalCEN', 'TITLE_Original', 'AFZENDER_OriginalCEN','isUncertainAfzender', 'ONTVANGER_OriginalCEN', 'isUncertainOntvanger']]\n",
"# person-related columns to display with original data\n",
"letters_persons_original_df = letters_persons_df[['SKletterId','ISBD_OriginalCEN', 'titleOriginal', 'AFZENDER_OriginalCEN','ONTVANGER_OriginalCEN']]\n",
"letters_persons_original_df = letters_persons_df[['SKletterId','ISBD_OriginalCEN', 'TITLE_Original', 'AFZENDER_OriginalCEN','ONTVANGER_OriginalCEN']]\n",
"letters_persons_original_df.head(50)"
]
},
Expand Down Expand Up @@ -1919,6 +1919,17 @@
"person_of_interest.reset_index(drop=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "34934b34",
"metadata": {},
"outputs": [],
"source": [
"# Second step: paste the person Id below (inside the quotation marks)\n",
"person_of_interest = 'skp008594'"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -1928,8 +1939,8 @@
},
"outputs": [],
"source": [
"# Second step: paste the person Id below (don't forget to paste it two times!):\n",
"firstDegree_df = cen_letters[(cen_letters.SKpersonId_sender.str.contains('skp002285')) | (cen_letters.SKpersonId_receiver.str.contains('skp002285'))]"
"\n",
"firstDegree_df = cen_letters[(cen_letters.SKpersonId_sender.str.contains(person_of_interest)) | (cen_letters.SKpersonId_receiver.str.contains(person_of_interest))]"
]
},
{
Expand Down

0 comments on commit eb7e3ef

Please sign in to comment.