[{"data":1,"prerenderedAt":2547},["ShallowReactive",2],{"doc:\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas":3,"surround:\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas":2513,"ancestors:\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas":2522,"children:\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas":2527,"related:\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas":2528},{"id":4,"title":5,"body":6,"dateModified":2477,"datePublished":2477,"description":2478,"extension":2479,"faq":2480,"keyword":2489,"kind":2490,"meta":2491,"navigation":377,"path":2501,"seo":2502,"slug":2505,"stem":2506,"topics":2507,"type":2511,"__hash__":2512},"docs\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas\u002Findex.md","Split Full Names into First and Last Names with pandas",{"type":7,"value":8,"toc":2464},"minimark",[9,28,292,297,324,330,334,341,482,517,521,528,850,877,881,918,1617,1652,1865,1869,1872,1952,1955,2070,2074,2077,2182,2200,2322,2326,2370,2374,2381,2385,2396,2400,2409,2415,2421,2427,2431,2460],[10,11,12,13,17,18,21,22,27],"p",{},"A contact export with one ",[14,15,16],"code",{},"Name"," column is fine until someone needs \"Dear Ada\" in a mail merge, a sort by surname, or a match against a system that stores first and last names separately. Excel users reach for Text to Columns, pandas users for ",[14,19,20],{},"str.split",", and both get \"Ada Lovelace\" right and \"Ludwig van Beethoven\" wrong. Names are messy in predictable ways — reversed order with a comma, titles and suffixes, surname particles, extra spaces, all capitals — and in some ways no rule can predict. This page, part of ",[23,24,26],"a",{"href":25},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002F","Cleaning Excel Data With Pandas",", handles the predictable cases with explicit rules and flags the rest.",[29,30,38,39,38,43,38,47,38,55,38,64,38,68,38,75,38,79,38,84,38,86,38,90,38,93,38,97,38,99,38,103,38,106,38,110,38,112,38,115,38,118,38,122,38,124,38,127,38,130,38,134,38,136,38,139,38,142,38,146,38,148,38,151,38,154,38,158,38,161,38,165,38,169,38,171,38,174,38,176,38,179,38,181,38,184,38,186,38,188,38,190,38,193,38,195,38,198,38,200,38,202,38,204,38,206,38,208,38,210,38,212,38,214,38,216,38,219,38,221,38,224,38,226,38,228,38,230,38,233,38,238,38,242,38,244,38,246,38,248,38,251,38,253,38,256,38,261,38,265,38,273,38,278,38,286],"svg",{"viewBox":31,"role":32,"ariaLabelledBy":33,"xmlns":36,"style":37},"70 0 620 248","img",[34,35],"nm-split-t","nm-split-d","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;max-width:620px;height:auto;display:block;margin:1.5rem auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif","\n  ",[40,41,42],"title",{"id":34},"Full names split into first and last",[44,45,46],"desc",{"id":35},"Left: a name column with Ada Lovelace, Lovelace comma Ada, Dr. Grace Hopper, Ludwig van Beethoven and Smith Jr. comma John. Right: first and last columns with Ada Lovelace, Ada Lovelace, Grace Hopper, Ludwig and van Beethoven, and John and Smith, with titles and suffixes moved out of the name.",[48,49],"rect",{"x":50,"y":51,"width":52,"height":53,"fill":54},"70","0","620","248","#ffffff",[48,56],{"x":57,"y":58,"width":59,"height":60,"rx":51,"fill":61,"stroke":62,"style":63},"86.3","40.0","32.0","24.0","#e7ebef","var(--line,#cdd5e6)","stroke-width:1px",[48,65],{"x":66,"y":58,"width":67,"height":60,"rx":51,"fill":61,"stroke":62,"style":63},"118.3","164.2",[69,70,74],"text",{"x":71,"y":72,"style":73},"200.4","57.0","font-size:11px;font-weight:600;fill:var(--muted,#5b6780);text-anchor:middle","A",[48,76],{"x":57,"y":77,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},"64.0","28.0",[69,80,83],{"x":81,"y":82,"style":73},"102.3","83.0","1",[48,85],{"x":66,"y":77,"width":67,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,87,89],{"x":71,"y":82,"style":88},"font-size:12px;font-weight:700;fill:var(--text,#172033);text-anchor:middle","name",[48,91],{"x":57,"y":92,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},"92.0",[69,94,96],{"x":81,"y":95,"style":73},"111.0","2",[48,98],{"x":66,"y":92,"width":67,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,100,102],{"x":71,"y":95,"style":101},"font-size:12px;font-weight:400;fill:var(--text,#172033);text-anchor:middle","Ada Lovelace",[48,104],{"x":57,"y":105,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},"120.0",[69,107,109],{"x":81,"y":108,"style":73},"139.0","3",[48,111],{"x":66,"y":105,"width":67,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,113,114],{"x":71,"y":108,"style":101},"Lovelace, Ada",[48,116],{"x":57,"y":117,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},"148.0",[69,119,121],{"x":81,"y":120,"style":73},"167.0","4",[48,123],{"x":66,"y":117,"width":67,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,125,126],{"x":71,"y":120,"style":101},"Dr. Grace Hopper",[48,128],{"x":57,"y":129,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},"176.0",[69,131,133],{"x":81,"y":132,"style":73},"195.0","5",[48,135],{"x":66,"y":129,"width":67,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,137,138],{"x":71,"y":132,"style":101},"Ludwig van Beethoven",[48,140],{"x":57,"y":141,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},"204.0",[69,143,145],{"x":81,"y":144,"style":73},"223.0","6",[48,147],{"x":66,"y":141,"width":67,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,149,150],{"x":71,"y":144,"style":101},"Smith Jr., John",[48,152],{"x":153,"y":58,"width":59,"height":60,"rx":51,"fill":61,"stroke":62,"style":63},"456.5",[48,155],{"x":156,"y":58,"width":157,"height":60,"rx":51,"fill":61,"stroke":62,"style":63},"488.5","69.0",[69,159,74],{"x":160,"y":72,"style":73},"523.0",[48,162],{"x":163,"y":58,"width":164,"height":60,"rx":51,"fill":61,"stroke":62,"style":63},"557.5","116.2",[69,166,168],{"x":167,"y":72,"style":73},"615.6","B",[48,170],{"x":153,"y":77,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},[69,172,83],{"x":173,"y":82,"style":73},"472.5",[48,175],{"x":156,"y":77,"width":157,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,177,178],{"x":160,"y":82,"style":88},"first",[48,180],{"x":163,"y":77,"width":164,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,182,183],{"x":167,"y":82,"style":88},"last",[48,185],{"x":153,"y":92,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},[69,187,96],{"x":173,"y":95,"style":73},[48,189],{"x":156,"y":92,"width":157,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,191,192],{"x":160,"y":95,"style":101},"Ada",[48,194],{"x":163,"y":92,"width":164,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,196,197],{"x":167,"y":95,"style":101},"Lovelace",[48,199],{"x":153,"y":105,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},[69,201,109],{"x":173,"y":108,"style":73},[48,203],{"x":156,"y":105,"width":157,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,205,192],{"x":160,"y":108,"style":101},[48,207],{"x":163,"y":105,"width":164,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,209,197],{"x":167,"y":108,"style":101},[48,211],{"x":153,"y":117,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},[69,213,121],{"x":173,"y":120,"style":73},[48,215],{"x":156,"y":117,"width":157,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,217,218],{"x":160,"y":120,"style":101},"Grace",[48,220],{"x":163,"y":117,"width":164,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,222,223],{"x":167,"y":120,"style":101},"Hopper",[48,225],{"x":153,"y":129,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},[69,227,133],{"x":173,"y":132,"style":73},[48,229],{"x":156,"y":129,"width":157,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,231,232],{"x":160,"y":132,"style":101},"Ludwig",[48,234],{"x":163,"y":129,"width":164,"height":78,"rx":51,"fill":235,"stroke":236,"style":237},"#d9f4f1","var(--teal,#0f9488)","stroke-width:1.5px",[69,239,241],{"x":167,"y":132,"style":240},"font-size:12px;font-weight:700;fill:var(--teal-ink,#0b6157);text-anchor:middle","van Beethoven",[48,243],{"x":153,"y":141,"width":59,"height":78,"rx":51,"fill":61,"stroke":62,"style":63},[69,245,145],{"x":173,"y":144,"style":73},[48,247],{"x":156,"y":141,"width":157,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,249,250],{"x":160,"y":144,"style":101},"John",[48,252],{"x":163,"y":141,"width":164,"height":78,"rx":51,"fill":54,"stroke":62,"style":63},[69,254,255],{"x":167,"y":144,"style":101},"Smith",[69,257,89],{"x":258,"y":259,"style":260},"184.4","29.0","font-size:12.5px;font-weight:700;fill:var(--muted,#5b6780);text-anchor:middle",[69,262,264],{"x":263,"y":259,"style":260},"565.1","first \u002F last",[266,267],"line",{"x1":268,"y1":269,"x2":270,"y2":269,"stroke":271,"style":272},"292.5","136.0","442.5","var(--brand,#5b5cf0)","stroke-width:2px",[274,275],"polygon",{"points":276,"fill":277},"446.5,136.0 437.5,141.0 437.5,131.0","#5b5cf0",[48,279],{"x":280,"y":281,"width":282,"height":283,"rx":284,"fill":54,"stroke":62,"style":285},"315.9","103.0","107.2","22.0","11","stroke-width:1.2px",[69,287,291],{"x":288,"y":289,"style":290},"369.5","118.0","font-size:11.5px;font-weight:400;fill:var(--brand-strong,#4338ca);text-anchor:middle;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace","split_name()",[293,294,296],"h2",{"id":295},"prerequisites","Prerequisites",[298,299,304],"pre",{"className":300,"code":301,"language":302,"meta":303,"style":303},"language-bash shiki shiki-themes github-light github-dark-high-contrast","pip install pandas openpyxl\n","bash","",[14,305,306],{"__ignoreMap":303},[307,308,310,314,318,321],"span",{"class":266,"line":309},1,[307,311,313],{"class":312},"sMTad","pip",[307,315,317],{"class":316},"srMev"," install",[307,319,320],{"class":316}," pandas",[307,322,323],{"class":316}," openpyxl\n",[10,325,326,329],{},[14,327,328],{},"contacts.xlsx"," has ten names covering the common shapes: plain, reversed with a comma, extra spaces and all capitals, a title, a surname particle, a suffix in reversed order, two given names, two family names, a single name and an apostrophe.",[293,331,333],{"id":332},"step-1-try-the-one-liner-and-see-where-it-breaks","Step 1 — Try the one-liner and see where it breaks",[10,335,336,337,340],{},"The quickest split is on the ",[338,339,183],"em",{}," space, so that everything before it counts as the first part:",[298,342,346],{"className":343,"code":344,"language":345,"meta":303,"style":303},"language-python shiki shiki-themes github-light github-dark-high-contrast","import re\nimport pandas as pd\n\ncontacts = pd.read_excel(\"contacts.xlsx\")\nquick = contacts[\"name\"].str.strip().str.rsplit(\" \", n=1, expand=True)\nquick.columns = [\"first\", \"last\"]\nprint(pd.concat([contacts, quick], axis=1))\n","python",[14,347,348,358,372,379,397,441,463],{"__ignoreMap":303},[307,349,350,354],{"class":266,"line":309},[307,351,353],{"class":352},"s-kum","import",[307,355,357],{"class":356},"skGVy"," re\n",[307,359,361,363,366,369],{"class":266,"line":360},2,[307,362,353],{"class":352},[307,364,365],{"class":356}," pandas ",[307,367,368],{"class":352},"as",[307,370,371],{"class":356}," pd\n",[307,373,375],{"class":266,"line":374},3,[307,376,378],{"emptyLinePlaceholder":377},true,"\n",[307,380,382,385,388,391,394],{"class":266,"line":381},4,[307,383,384],{"class":356},"contacts ",[307,386,387],{"class":352},"=",[307,389,390],{"class":356}," pd.read_excel(",[307,392,393],{"class":316},"\"contacts.xlsx\"",[307,395,396],{"class":356},")\n",[307,398,400,403,405,408,411,414,417,420,424,426,429,431,434,436,439],{"class":266,"line":399},5,[307,401,402],{"class":356},"quick ",[307,404,387],{"class":352},[307,406,407],{"class":356}," contacts[",[307,409,410],{"class":316},"\"name\"",[307,412,413],{"class":356},"].str.strip().str.rsplit(",[307,415,416],{"class":316},"\" \"",[307,418,419],{"class":356},", ",[307,421,423],{"class":422},"sa561","n",[307,425,387],{"class":352},[307,427,83],{"class":428},"sP0c6",[307,430,419],{"class":356},[307,432,433],{"class":422},"expand",[307,435,387],{"class":352},[307,437,438],{"class":428},"True",[307,440,396],{"class":356},[307,442,444,447,449,452,455,457,460],{"class":266,"line":443},6,[307,445,446],{"class":356},"quick.columns ",[307,448,387],{"class":352},[307,450,451],{"class":356}," [",[307,453,454],{"class":316},"\"first\"",[307,456,419],{"class":356},[307,458,459],{"class":316},"\"last\"",[307,461,462],{"class":356},"]\n",[307,464,466,469,472,475,477,479],{"class":266,"line":465},7,[307,467,468],{"class":428},"print",[307,470,471],{"class":356},"(pd.concat([contacts, quick], ",[307,473,474],{"class":422},"axis",[307,476,387],{"class":352},[307,478,83],{"class":428},[307,480,481],{"class":356},"))\n",[10,483,484,485,488,489,492,493,496,497,500,501,504,505,508,509,512,513,516],{},"Plain names come out right. ",[14,486,487],{},"\"Lovelace, Ada\""," gives a first name of ",[14,490,491],{},"\"Lovelace,\"","; ",[14,494,495],{},"\"Dr. Grace Hopper\""," makes the title part of the first name; ",[14,498,499],{},"\"Ludwig van Beethoven\""," gets the surname ",[14,502,503],{},"\"Beethoven\""," and a first name of ",[14,506,507],{},"\"Ludwig van\"","; the run of spaces inside ",[14,510,511],{},"\"  grace   HOPPER \""," survives in the first name, and the capitals stay as typed; and ",[14,514,515],{},"\"Prince\""," has no last name at all. Each of those is a rule to add.",[293,518,520],{"id":519},"step-2-normalise-spaces-and-fix-all-capital-or-all-lower-names","Step 2 — Normalise spaces and fix all-capital or all-lower names",[10,522,523,524,527],{},"Collapse runs of whitespace first, then fix the case word by word — but only for words written entirely in capitals or entirely in lower case, and never for surname particles. A word in mixed case, such as ",[14,525,526],{},"McDonald",", carries information about how the person writes their name and is left alone:",[298,529,531],{"className":343,"code":530,"language":345,"meta":303,"style":303},"PARTICLES = {\"van\", \"von\", \"der\", \"den\", \"de\", \"da\", \"di\", \"du\", \"la\", \"le\", \"del\", \"dos\", \"bin\", \"al\"}\n\ndef fix_word(word):\n    if word.lower() in PARTICLES:\n        return word.lower()\n    if word.isupper() or word.islower():\n        return word.title()\n    return word\n\ndef normalise(name):\n    words = re.sub(r\"\\s+\", \" \", str(name)).strip().split(\" \")\n    return \" \".join(fix_word(w) for w in words)\n\nfor raw in [\"  grace   HOPPER \", \"Sean O'Brien\", \"LUDWIG VAN BEETHOVEN\", \"Ronald McDonald\", \"mcdonald\"]:\n    print(f\"{raw!r:24} -> {normalise(raw)!r}\")\n",[14,532,533,615,619,631,648,656,669,676,685,690,701,742,764,769,806],{"__ignoreMap":303},[307,534,535,538,541,544,547,549,552,554,557,559,562,564,567,569,572,574,577,579,582,584,587,589,592,594,597,599,602,604,607,609,612],{"class":266,"line":309},[307,536,537],{"class":428},"PARTICLES",[307,539,540],{"class":352}," =",[307,542,543],{"class":356}," {",[307,545,546],{"class":316},"\"van\"",[307,548,419],{"class":356},[307,550,551],{"class":316},"\"von\"",[307,553,419],{"class":356},[307,555,556],{"class":316},"\"der\"",[307,558,419],{"class":356},[307,560,561],{"class":316},"\"den\"",[307,563,419],{"class":356},[307,565,566],{"class":316},"\"de\"",[307,568,419],{"class":356},[307,570,571],{"class":316},"\"da\"",[307,573,419],{"class":356},[307,575,576],{"class":316},"\"di\"",[307,578,419],{"class":356},[307,580,581],{"class":316},"\"du\"",[307,583,419],{"class":356},[307,585,586],{"class":316},"\"la\"",[307,588,419],{"class":356},[307,590,591],{"class":316},"\"le\"",[307,593,419],{"class":356},[307,595,596],{"class":316},"\"del\"",[307,598,419],{"class":356},[307,600,601],{"class":316},"\"dos\"",[307,603,419],{"class":356},[307,605,606],{"class":316},"\"bin\"",[307,608,419],{"class":356},[307,610,611],{"class":316},"\"al\"",[307,613,614],{"class":356},"}\n",[307,616,617],{"class":266,"line":360},[307,618,378],{"emptyLinePlaceholder":377},[307,620,621,624,628],{"class":266,"line":374},[307,622,623],{"class":352},"def",[307,625,627],{"class":626},"s_Opv"," fix_word",[307,629,630],{"class":356},"(word):\n",[307,632,633,636,639,642,645],{"class":266,"line":381},[307,634,635],{"class":352},"    if",[307,637,638],{"class":356}," word.lower() ",[307,640,641],{"class":352},"in",[307,643,644],{"class":428}," PARTICLES",[307,646,647],{"class":356},":\n",[307,649,650,653],{"class":266,"line":399},[307,651,652],{"class":352},"        return",[307,654,655],{"class":356}," word.lower()\n",[307,657,658,660,663,666],{"class":266,"line":443},[307,659,635],{"class":352},[307,661,662],{"class":356}," word.isupper() ",[307,664,665],{"class":352},"or",[307,667,668],{"class":356}," word.islower():\n",[307,670,671,673],{"class":266,"line":465},[307,672,652],{"class":352},[307,674,675],{"class":356}," word.title()\n",[307,677,679,682],{"class":266,"line":678},8,[307,680,681],{"class":352},"    return",[307,683,684],{"class":356}," word\n",[307,686,688],{"class":266,"line":687},9,[307,689,378],{"emptyLinePlaceholder":377},[307,691,693,695,698],{"class":266,"line":692},10,[307,694,623],{"class":352},[307,696,697],{"class":626}," normalise",[307,699,700],{"class":356},"(name):\n",[307,702,704,707,709,712,715,718,721,724,726,728,730,732,735,738,740],{"class":266,"line":703},11,[307,705,706],{"class":356},"    words ",[307,708,387],{"class":352},[307,710,711],{"class":356}," re.sub(",[307,713,714],{"class":352},"r",[307,716,717],{"class":316},"\"",[307,719,720],{"class":428},"\\s",[307,722,723],{"class":352},"+",[307,725,717],{"class":316},[307,727,419],{"class":356},[307,729,416],{"class":316},[307,731,419],{"class":356},[307,733,734],{"class":428},"str",[307,736,737],{"class":356},"(name)).strip().split(",[307,739,416],{"class":316},[307,741,396],{"class":356},[307,743,745,747,750,753,756,759,761],{"class":266,"line":744},12,[307,746,681],{"class":352},[307,748,749],{"class":316}," \" \"",[307,751,752],{"class":356},".join(fix_word(w) ",[307,754,755],{"class":352},"for",[307,757,758],{"class":356}," w ",[307,760,641],{"class":352},[307,762,763],{"class":356}," words)\n",[307,765,767],{"class":266,"line":766},13,[307,768,378],{"emptyLinePlaceholder":377},[307,770,772,774,777,779,781,783,785,788,790,793,795,798,800,803],{"class":266,"line":771},14,[307,773,755],{"class":352},[307,775,776],{"class":356}," raw ",[307,778,641],{"class":352},[307,780,451],{"class":356},[307,782,511],{"class":316},[307,784,419],{"class":356},[307,786,787],{"class":316},"\"Sean O'Brien\"",[307,789,419],{"class":356},[307,791,792],{"class":316},"\"LUDWIG VAN BEETHOVEN\"",[307,794,419],{"class":356},[307,796,797],{"class":316},"\"Ronald McDonald\"",[307,799,419],{"class":356},[307,801,802],{"class":316},"\"mcdonald\"",[307,804,805],{"class":356},"]:\n",[307,807,809,812,815,818,820,824,827,830,833,836,838,841,844,846,848],{"class":266,"line":808},15,[307,810,811],{"class":428},"    print",[307,813,814],{"class":356},"(",[307,816,817],{"class":352},"f",[307,819,717],{"class":316},[307,821,823],{"class":822},"sSjpA","{",[307,825,826],{"class":356},"raw",[307,828,829],{"class":352},"!r:24",[307,831,832],{"class":822},"}",[307,834,835],{"class":316}," -> ",[307,837,823],{"class":822},[307,839,840],{"class":356},"normalise(raw)",[307,842,843],{"class":352},"!r",[307,845,832],{"class":822},[307,847,717],{"class":316},[307,849,396],{"class":356},[10,851,852,854,855,858,859,862,863,865,866,854,869,872,873,876],{},[14,853,511],{}," becomes ",[14,856,857],{},"\"Grace Hopper\"",", the all-capitals Beethoven keeps a lower-case ",[14,860,861],{},"van",", and ",[14,864,526],{}," is untouched. The last line shows the limit: a name typed entirely in lower case as ",[14,867,868],{},"mcdonald",[14,870,871],{},"Mcdonald",", because ",[14,874,875],{},"str.title()"," cannot know about the internal capital. That is the case for changing case only when the input carries no case information at all — and for keeping the original next to the result.",[293,878,880],{"id":879},"step-3-handle-commas-titles-suffixes-and-particles","Step 3 — Handle commas, titles, suffixes and particles",[10,882,883,884,886,887,890,891,419,894,897,898,419,901,904,905,419,907,419,910,913,914,917],{},"Now the splitting rules, applied in order, reusing the ",[14,885,537],{}," set from Step 2. A comma means ",[14,888,889],{},"Last, First"," order. Titles (",[14,892,893],{},"Dr",[14,895,896],{},"Mrs",") and suffixes (",[14,899,900],{},"Jr",[14,902,903],{},"III",") are moved into their own columns. Lower-case particles such as ",[14,906,861],{},[14,908,909],{},"von",[14,911,912],{},"de"," and ",[14,915,916],{},"da"," belong to the surname, so the surname starts at the first particle:",[298,919,921],{"className":343,"code":920,"language":345,"meta":303,"style":303},"TITLES = {\"mr\", \"mrs\", \"ms\", \"miss\", \"dr\", \"prof\", \"sir\"}\nSUFFIXES = {\"jr\", \"sr\", \"ii\", \"iii\", \"iv\", \"phd\", \"md\"}\n\ndef split_name(raw):\n    s = normalise(raw)\n    title = suffix = \"\"\n    if \",\" in s:\n        last_part, first_part = [p.strip() for p in s.split(\",\", 1)]\n        words = last_part.split()\n        if len(words) > 1 and words[-1].strip(\".\").lower() in SUFFIXES:\n            suffix, last_part = words[-1], \" \".join(words[:-1])\n        return {\"title\": title, \"first\": first_part, \"last\": last_part, \"suffix\": suffix, \"rule\": \"comma\"}\n    words = s.split()\n    if words and words[0].strip(\".\").lower() in TITLES:\n        title, words = words[0], words[1:]\n    if len(words) > 1 and words[-1].strip(\".\").lower() in SUFFIXES:\n        suffix, words = words[-1], words[:-1]\n    if len(words) == 1:\n        return {\"title\": title, \"first\": words[0], \"last\": \"\", \"suffix\": suffix, \"rule\": \"single\"}\n    for i, w in enumerate(words[1:], start=1):\n        if w.lower() in PARTICLES:\n            return {\"title\": title, \"first\": \" \".join(words[:i]), \"last\": \" \".join(words[i:]),\n                    \"suffix\": suffix, \"rule\": \"particle\"}\n    rule = \"two words\" if len(words) == 2 else \"check\"\n    return {\"title\": title, \"first\": \" \".join(words[:-1]), \"last\": words[-1], \"suffix\": suffix, \"rule\": rule}\n\nparts = pd.DataFrame([split_name(n) for n in contacts[\"name\"]])\nresult = pd.concat([contacts, parts], axis=1)\nprint(result.to_string(index=False))\n",[14,922,923,967,1011,1015,1025,1035,1050,1063,1093,1103,1147,1175,1214,1223,1250,1269,1302,1325,1341,1383,1415,1429,1459,1476,1505,1550,1555,1580,1599],{"__ignoreMap":303},[307,924,925,928,930,932,935,937,940,942,945,947,950,952,955,957,960,962,965],{"class":266,"line":309},[307,926,927],{"class":428},"TITLES",[307,929,540],{"class":352},[307,931,543],{"class":356},[307,933,934],{"class":316},"\"mr\"",[307,936,419],{"class":356},[307,938,939],{"class":316},"\"mrs\"",[307,941,419],{"class":356},[307,943,944],{"class":316},"\"ms\"",[307,946,419],{"class":356},[307,948,949],{"class":316},"\"miss\"",[307,951,419],{"class":356},[307,953,954],{"class":316},"\"dr\"",[307,956,419],{"class":356},[307,958,959],{"class":316},"\"prof\"",[307,961,419],{"class":356},[307,963,964],{"class":316},"\"sir\"",[307,966,614],{"class":356},[307,968,969,972,974,976,979,981,984,986,989,991,994,996,999,1001,1004,1006,1009],{"class":266,"line":360},[307,970,971],{"class":428},"SUFFIXES",[307,973,540],{"class":352},[307,975,543],{"class":356},[307,977,978],{"class":316},"\"jr\"",[307,980,419],{"class":356},[307,982,983],{"class":316},"\"sr\"",[307,985,419],{"class":356},[307,987,988],{"class":316},"\"ii\"",[307,990,419],{"class":356},[307,992,993],{"class":316},"\"iii\"",[307,995,419],{"class":356},[307,997,998],{"class":316},"\"iv\"",[307,1000,419],{"class":356},[307,1002,1003],{"class":316},"\"phd\"",[307,1005,419],{"class":356},[307,1007,1008],{"class":316},"\"md\"",[307,1010,614],{"class":356},[307,1012,1013],{"class":266,"line":374},[307,1014,378],{"emptyLinePlaceholder":377},[307,1016,1017,1019,1022],{"class":266,"line":381},[307,1018,623],{"class":352},[307,1020,1021],{"class":626}," split_name",[307,1023,1024],{"class":356},"(raw):\n",[307,1026,1027,1030,1032],{"class":266,"line":399},[307,1028,1029],{"class":356},"    s ",[307,1031,387],{"class":352},[307,1033,1034],{"class":356}," normalise(raw)\n",[307,1036,1037,1040,1042,1045,1047],{"class":266,"line":443},[307,1038,1039],{"class":356},"    title ",[307,1041,387],{"class":352},[307,1043,1044],{"class":356}," suffix ",[307,1046,387],{"class":352},[307,1048,1049],{"class":316}," \"\"\n",[307,1051,1052,1054,1057,1060],{"class":266,"line":465},[307,1053,635],{"class":352},[307,1055,1056],{"class":316}," \",\"",[307,1058,1059],{"class":352}," in",[307,1061,1062],{"class":356}," s:\n",[307,1064,1065,1068,1070,1073,1075,1078,1080,1083,1086,1088,1090],{"class":266,"line":678},[307,1066,1067],{"class":356},"        last_part, first_part ",[307,1069,387],{"class":352},[307,1071,1072],{"class":356}," [p.strip() ",[307,1074,755],{"class":352},[307,1076,1077],{"class":356}," p ",[307,1079,641],{"class":352},[307,1081,1082],{"class":356}," s.split(",[307,1084,1085],{"class":316},"\",\"",[307,1087,419],{"class":356},[307,1089,83],{"class":428},[307,1091,1092],{"class":356},")]\n",[307,1094,1095,1098,1100],{"class":266,"line":687},[307,1096,1097],{"class":356},"        words ",[307,1099,387],{"class":352},[307,1101,1102],{"class":356}," last_part.split()\n",[307,1104,1105,1108,1111,1114,1117,1120,1123,1126,1129,1131,1134,1137,1140,1142,1145],{"class":266,"line":692},[307,1106,1107],{"class":352},"        if",[307,1109,1110],{"class":428}," len",[307,1112,1113],{"class":356},"(words) ",[307,1115,1116],{"class":352},">",[307,1118,1119],{"class":428}," 1",[307,1121,1122],{"class":352}," and",[307,1124,1125],{"class":356}," words[",[307,1127,1128],{"class":352},"-",[307,1130,83],{"class":428},[307,1132,1133],{"class":356},"].strip(",[307,1135,1136],{"class":316},"\".\"",[307,1138,1139],{"class":356},").lower() ",[307,1141,641],{"class":352},[307,1143,1144],{"class":428}," SUFFIXES",[307,1146,647],{"class":356},[307,1148,1149,1152,1154,1156,1158,1160,1163,1165,1168,1170,1172],{"class":266,"line":703},[307,1150,1151],{"class":356},"            suffix, last_part ",[307,1153,387],{"class":352},[307,1155,1125],{"class":356},[307,1157,1128],{"class":352},[307,1159,83],{"class":428},[307,1161,1162],{"class":356},"], ",[307,1164,416],{"class":316},[307,1166,1167],{"class":356},".join(words[:",[307,1169,1128],{"class":352},[307,1171,83],{"class":428},[307,1173,1174],{"class":356},"])\n",[307,1176,1177,1179,1181,1184,1187,1189,1192,1194,1197,1200,1203,1206,1209,1212],{"class":266,"line":744},[307,1178,652],{"class":352},[307,1180,543],{"class":356},[307,1182,1183],{"class":316},"\"title\"",[307,1185,1186],{"class":356},": title, ",[307,1188,454],{"class":316},[307,1190,1191],{"class":356},": first_part, ",[307,1193,459],{"class":316},[307,1195,1196],{"class":356},": last_part, ",[307,1198,1199],{"class":316},"\"suffix\"",[307,1201,1202],{"class":356},": suffix, ",[307,1204,1205],{"class":316},"\"rule\"",[307,1207,1208],{"class":356},": ",[307,1210,1211],{"class":316},"\"comma\"",[307,1213,614],{"class":356},[307,1215,1216,1218,1220],{"class":266,"line":766},[307,1217,706],{"class":356},[307,1219,387],{"class":352},[307,1221,1222],{"class":356}," s.split()\n",[307,1224,1225,1227,1230,1233,1235,1237,1239,1241,1243,1245,1248],{"class":266,"line":771},[307,1226,635],{"class":352},[307,1228,1229],{"class":356}," words ",[307,1231,1232],{"class":352},"and",[307,1234,1125],{"class":356},[307,1236,51],{"class":428},[307,1238,1133],{"class":356},[307,1240,1136],{"class":316},[307,1242,1139],{"class":356},[307,1244,641],{"class":352},[307,1246,1247],{"class":428}," TITLES",[307,1249,647],{"class":356},[307,1251,1252,1255,1257,1259,1261,1264,1266],{"class":266,"line":808},[307,1253,1254],{"class":356},"        title, words ",[307,1256,387],{"class":352},[307,1258,1125],{"class":356},[307,1260,51],{"class":428},[307,1262,1263],{"class":356},"], words[",[307,1265,83],{"class":428},[307,1267,1268],{"class":356},":]\n",[307,1270,1272,1274,1276,1278,1280,1282,1284,1286,1288,1290,1292,1294,1296,1298,1300],{"class":266,"line":1271},16,[307,1273,635],{"class":352},[307,1275,1110],{"class":428},[307,1277,1113],{"class":356},[307,1279,1116],{"class":352},[307,1281,1119],{"class":428},[307,1283,1122],{"class":352},[307,1285,1125],{"class":356},[307,1287,1128],{"class":352},[307,1289,83],{"class":428},[307,1291,1133],{"class":356},[307,1293,1136],{"class":316},[307,1295,1139],{"class":356},[307,1297,641],{"class":352},[307,1299,1144],{"class":428},[307,1301,647],{"class":356},[307,1303,1305,1308,1310,1312,1314,1316,1319,1321,1323],{"class":266,"line":1304},17,[307,1306,1307],{"class":356},"        suffix, words ",[307,1309,387],{"class":352},[307,1311,1125],{"class":356},[307,1313,1128],{"class":352},[307,1315,83],{"class":428},[307,1317,1318],{"class":356},"], words[:",[307,1320,1128],{"class":352},[307,1322,83],{"class":428},[307,1324,462],{"class":356},[307,1326,1328,1330,1332,1334,1337,1339],{"class":266,"line":1327},18,[307,1329,635],{"class":352},[307,1331,1110],{"class":428},[307,1333,1113],{"class":356},[307,1335,1336],{"class":352},"==",[307,1338,1119],{"class":428},[307,1340,647],{"class":356},[307,1342,1344,1346,1348,1350,1352,1354,1357,1359,1361,1363,1365,1368,1370,1372,1374,1376,1378,1381],{"class":266,"line":1343},19,[307,1345,652],{"class":352},[307,1347,543],{"class":356},[307,1349,1183],{"class":316},[307,1351,1186],{"class":356},[307,1353,454],{"class":316},[307,1355,1356],{"class":356},": words[",[307,1358,51],{"class":428},[307,1360,1162],{"class":356},[307,1362,459],{"class":316},[307,1364,1208],{"class":356},[307,1366,1367],{"class":316},"\"\"",[307,1369,419],{"class":356},[307,1371,1199],{"class":316},[307,1373,1202],{"class":356},[307,1375,1205],{"class":316},[307,1377,1208],{"class":356},[307,1379,1380],{"class":316},"\"single\"",[307,1382,614],{"class":356},[307,1384,1386,1389,1392,1394,1397,1400,1402,1405,1408,1410,1412],{"class":266,"line":1385},20,[307,1387,1388],{"class":352},"    for",[307,1390,1391],{"class":356}," i, w ",[307,1393,641],{"class":352},[307,1395,1396],{"class":428}," enumerate",[307,1398,1399],{"class":356},"(words[",[307,1401,83],{"class":428},[307,1403,1404],{"class":356},":], ",[307,1406,1407],{"class":422},"start",[307,1409,387],{"class":352},[307,1411,83],{"class":428},[307,1413,1414],{"class":356},"):\n",[307,1416,1418,1420,1423,1425,1427],{"class":266,"line":1417},21,[307,1419,1107],{"class":352},[307,1421,1422],{"class":356}," w.lower() ",[307,1424,641],{"class":352},[307,1426,644],{"class":428},[307,1428,647],{"class":356},[307,1430,1432,1435,1437,1439,1441,1443,1445,1447,1450,1452,1454,1456],{"class":266,"line":1431},22,[307,1433,1434],{"class":352},"            return",[307,1436,543],{"class":356},[307,1438,1183],{"class":316},[307,1440,1186],{"class":356},[307,1442,454],{"class":316},[307,1444,1208],{"class":356},[307,1446,416],{"class":316},[307,1448,1449],{"class":356},".join(words[:i]), ",[307,1451,459],{"class":316},[307,1453,1208],{"class":356},[307,1455,416],{"class":316},[307,1457,1458],{"class":356},".join(words[i:]),\n",[307,1460,1462,1465,1467,1469,1471,1474],{"class":266,"line":1461},23,[307,1463,1464],{"class":316},"                    \"suffix\"",[307,1466,1202],{"class":356},[307,1468,1205],{"class":316},[307,1470,1208],{"class":356},[307,1472,1473],{"class":316},"\"particle\"",[307,1475,614],{"class":356},[307,1477,1479,1482,1484,1487,1490,1492,1494,1496,1499,1502],{"class":266,"line":1478},24,[307,1480,1481],{"class":356},"    rule ",[307,1483,387],{"class":352},[307,1485,1486],{"class":316}," \"two words\"",[307,1488,1489],{"class":352}," if",[307,1491,1110],{"class":428},[307,1493,1113],{"class":356},[307,1495,1336],{"class":352},[307,1497,1498],{"class":428}," 2",[307,1500,1501],{"class":352}," else",[307,1503,1504],{"class":316}," \"check\"\n",[307,1506,1508,1510,1512,1514,1516,1518,1520,1522,1524,1526,1528,1531,1533,1535,1537,1539,1541,1543,1545,1547],{"class":266,"line":1507},25,[307,1509,681],{"class":352},[307,1511,543],{"class":356},[307,1513,1183],{"class":316},[307,1515,1186],{"class":356},[307,1517,454],{"class":316},[307,1519,1208],{"class":356},[307,1521,416],{"class":316},[307,1523,1167],{"class":356},[307,1525,1128],{"class":352},[307,1527,83],{"class":428},[307,1529,1530],{"class":356},"]), ",[307,1532,459],{"class":316},[307,1534,1356],{"class":356},[307,1536,1128],{"class":352},[307,1538,83],{"class":428},[307,1540,1162],{"class":356},[307,1542,1199],{"class":316},[307,1544,1202],{"class":356},[307,1546,1205],{"class":316},[307,1548,1549],{"class":356},": rule}\n",[307,1551,1553],{"class":266,"line":1552},26,[307,1554,378],{"emptyLinePlaceholder":377},[307,1556,1558,1561,1563,1566,1568,1571,1573,1575,1577],{"class":266,"line":1557},27,[307,1559,1560],{"class":356},"parts ",[307,1562,387],{"class":352},[307,1564,1565],{"class":356}," pd.DataFrame([split_name(n) ",[307,1567,755],{"class":352},[307,1569,1570],{"class":356}," n ",[307,1572,641],{"class":352},[307,1574,407],{"class":356},[307,1576,410],{"class":316},[307,1578,1579],{"class":356},"]])\n",[307,1581,1583,1586,1588,1591,1593,1595,1597],{"class":266,"line":1582},28,[307,1584,1585],{"class":356},"result ",[307,1587,387],{"class":352},[307,1589,1590],{"class":356}," pd.concat([contacts, parts], ",[307,1592,474],{"class":422},[307,1594,387],{"class":352},[307,1596,83],{"class":428},[307,1598,396],{"class":356},[307,1600,1602,1604,1607,1610,1612,1615],{"class":266,"line":1601},29,[307,1603,468],{"class":428},[307,1605,1606],{"class":356},"(result.to_string(",[307,1608,1609],{"class":422},"index",[307,1611,387],{"class":352},[307,1613,1614],{"class":428},"False",[307,1616,481],{"class":356},[10,1618,1619,1620,1623,1624,419,1627,1630,1631,1634,1635,1637,1638,1641,1642,1208,1645,913,1648,1651],{},"Every name gets a ",[14,1621,1622],{},"rule"," column that records how it was split. Most rows say ",[14,1625,1626],{},"two words",[14,1628,1629],{},"comma"," or ",[14,1632,1633],{},"particle"," — cases where the rule is confident. ",[14,1636,515],{}," says ",[14,1639,1640],{},"single",". Two rows say ",[14,1643,1644],{},"check",[14,1646,1647],{},"\"Mary Ann Evans\"",[14,1649,1650],{},"\"José García López\"",". Both have three words and no particle, and they need opposite answers — Mary Ann is a two-part first name, while García López is a two-part Spanish surname. No rule based on the words alone can tell them apart.",[29,1653,38,1659,38,1662,38,1665,38,1669,38,1677,38,1688,38,1693,38,1697,38,1701,38,1704,38,1707,38,1714,38,1718,38,1724,38,1731,38,1735,38,1738,38,1743,38,1746,38,1749,38,1753,38,1756,38,1759,38,1766,38,1771,38,1775,38,1777,38,1780,38,1784,38,1787,38,1790,38,1795,38,1798,38,1801,38,1804,38,1807,38,1810,38,1814,38,1817,38,1820,38,1825,38,1828,38,1831,38,1833,38,1836,38,1840,38,1843,38,1848,38,1855,38,1859,38,1862],{"viewBox":1654,"role":32,"ariaLabelledBy":1655,"xmlns":36,"style":1658},"4 0 752 290",[1656,1657],"nm-rules-t","nm-rules-d","width:100%;max-width:752px;height:auto;display:block;margin:1.5rem auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif",[40,1660,1661],{"id":1656},"How split_name chooses a rule",[44,1663,1664],{"id":1657},"A decision chart. If the name contains a comma, the part before it is the last name. Otherwise titles and suffixes are removed first. A single remaining word is a single name. A lower-case particle such as van or de starts the last name. Exactly two words split into first and last. Three or more words without a particle are split on the last space and flagged for review.",[48,1666],{"x":121,"y":51,"width":1667,"height":1668,"fill":54},"752","290",[48,1670],{"x":1671,"y":1672,"width":1673,"height":1674,"rx":1675,"fill":1676,"stroke":271,"style":272},"207.0","16.0","346.1","75.5","12","#f0f4ff",[1678,1679,1681],"g",{"transform":1680},"translate(368.0,29.0) scale(1.000)",[1682,1683],"path",{"d":1684,"fill":1685,"stroke":1686,"style":1687},"M11 4a7 7 0 1 0 .01 0z M16 16l5 5","none","var(--brand-strong,#4338ca)","stroke-width:1.80px;stroke-linecap:round;stroke-linejoin:round",[69,1689,1692],{"x":1690,"y":1674,"style":1691},"380.0","font-size:13.5px;font-weight:700;fill:var(--brand-strong,#4338ca);text-anchor:middle","What does the normalised name contain?",[266,1694],{"x1":1690,"y1":1695,"x2":1690,"y2":1696,"stroke":271,"style":272},"91.5","111.5",[266,1698],{"x1":1699,"y1":1696,"x2":1700,"y2":1696,"stroke":271,"style":272},"85.6","674.4",[266,1702],{"x1":1699,"y1":1696,"x2":1699,"y2":1703,"stroke":271,"style":272},"157.5",[274,1705],{"points":1706,"fill":277},"85.6,161.5 80.6,152.5 90.6,152.5",[48,1708],{"x":1709,"y":1710,"width":1711,"height":1712,"rx":1713,"fill":54,"stroke":62,"style":285},"49.9","121.5","71.4","21.0","10",[69,1715,1717],{"x":1699,"y":269,"style":1716},"font-size:11.5px;font-weight:700;fill:var(--muted,#5b6780);text-anchor:middle","a comma",[48,1719],{"x":1720,"y":1721,"width":1722,"height":1723,"rx":1675,"fill":235,"stroke":236,"style":272},"20.0","163.5","131.2","110.5",[1678,1725,1727],{"transform":1726},"translate(73.6,176.5) scale(1.000)",[1682,1728],{"d":1729,"fill":1685,"stroke":1730,"style":1687},"M5 12.5l4.5 4.5L19 7","var(--teal-ink,#0b6157)",[69,1732,1734],{"x":1699,"y":144,"style":1733},"font-size:13.5px;font-weight:700;fill:var(--teal-ink,#0b6157);text-anchor:middle","Last before the",[69,1736,1629],{"x":1699,"y":1737,"style":1733},"240.5",[69,1739,1742],{"x":1699,"y":1740,"style":1741},"260.0","font-size:11.5px;font-weight:400;fill:var(--text,#172033);text-anchor:middle","rule = comma",[266,1744],{"x1":1745,"y1":1696,"x2":1745,"y2":1703,"stroke":271,"style":272},"232.8",[274,1747],{"points":1748,"fill":277},"232.8,161.5 227.8,152.5 237.8,152.5",[48,1750],{"x":1751,"y":1710,"width":1752,"height":1712,"rx":1713,"fill":54,"stroke":62,"style":285},"196.2","73.2",[69,1754,1755],{"x":1745,"y":269,"style":1716},"one word",[48,1757],{"x":1758,"y":1721,"width":1722,"height":1723,"rx":1675,"fill":61,"stroke":62,"style":272},"167.2",[1678,1760,1762],{"transform":1761},"translate(220.8,185.2) scale(1.000)",[1682,1763],{"d":1764,"fill":1685,"stroke":1765,"style":1687},"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8z M4 21c0-4 3.6-7 8-7s8 3 8 7","var(--text,#172033)",[69,1767,1770],{"x":1745,"y":1768,"style":1769},"231.8","font-size:13.5px;font-weight:700;fill:var(--text,#172033);text-anchor:middle","Single name",[69,1772,1774],{"x":1745,"y":1773,"style":1741},"251.2","rule = single",[266,1776],{"x1":1690,"y1":1696,"x2":1690,"y2":1703,"stroke":271,"style":272},[274,1778],{"points":1779,"fill":277},"380.0,161.5 375.0,152.5 385.0,152.5",[48,1781],{"x":1782,"y":1710,"width":1783,"height":1712,"rx":1713,"fill":54,"stroke":62,"style":285},"327.2","105.5",[69,1785,1786],{"x":1690,"y":269,"style":1716},"van, de, von …",[48,1788],{"x":1789,"y":1721,"width":1722,"height":1723,"rx":1675,"fill":235,"stroke":236,"style":272},"314.4",[1678,1791,1793],{"transform":1792},"translate(368.0,176.5) scale(1.000)",[1682,1794],{"d":1729,"fill":1685,"stroke":1730,"style":1687},[69,1796,1797],{"x":1690,"y":144,"style":1733},"Particle starts",[69,1799,1800],{"x":1690,"y":1737,"style":1733},"surname",[69,1802,1803],{"x":1690,"y":1740,"style":1741},"rule = particle",[266,1805],{"x1":1806,"y1":1696,"x2":1806,"y2":1703,"stroke":271,"style":272},"527.2",[274,1808],{"points":1809,"fill":277},"527.2,161.5 522.2,152.5 532.2,152.5",[48,1811],{"x":1812,"y":1710,"width":1813,"height":1712,"rx":1713,"fill":54,"stroke":62,"style":285},"494.5","65.4",[69,1815,1816],{"x":1806,"y":269,"style":1716},"2 words",[48,1818],{"x":1819,"y":1721,"width":1722,"height":1723,"rx":1675,"fill":235,"stroke":236,"style":272},"461.6",[1678,1821,1823],{"transform":1822},"translate(515.2,185.2) scale(1.000)",[1682,1824],{"d":1729,"fill":1685,"stroke":1730,"style":1687},[69,1826,1827],{"x":1806,"y":1768,"style":1733},"First and last",[69,1829,1830],{"x":1806,"y":1773,"style":1741},"rule = two words",[266,1832],{"x1":1700,"y1":1696,"x2":1700,"y2":1703,"stroke":271,"style":272},[274,1834],{"points":1835,"fill":277},"674.4,161.5 669.4,152.5 679.4,152.5",[48,1837],{"x":1838,"y":1710,"width":1839,"height":1712,"rx":1713,"fill":54,"stroke":62,"style":285},"637.5","73.8",[69,1841,1842],{"x":1700,"y":269,"style":1716},"3+ words",[48,1844],{"x":1845,"y":1721,"width":1722,"height":1723,"rx":1675,"fill":1846,"stroke":1847,"style":272},"608.8","#fdefd8","var(--gold,#b4740a)",[1678,1849,1851],{"transform":1850},"translate(662.4,176.5) scale(1.000)",[1682,1852],{"d":1853,"fill":1685,"stroke":1854,"style":1687},"M12 3.5l9.5 17h-19z M12 10v5 M12 17.8v.4","var(--gold-ink,#7a4e06)",[69,1856,1858],{"x":1700,"y":144,"style":1857},"font-size:13.5px;font-weight:700;fill:var(--gold-ink,#7a4e06);text-anchor:middle","Split on last",[69,1860,1861],{"x":1700,"y":1737,"style":1857},"space",[69,1863,1864],{"x":1700,"y":1740,"style":1741},"rule = check",[293,1866,1868],{"id":1867},"step-4-send-the-uncertain-names-for-review","Step 4 — Send the uncertain names for review",[10,1870,1871],{},"Split names are usually needed for something visible — a greeting, a badge, a letter — so a wrong guess is embarrassing rather than harmless. Export the rows the rules were not confident about, with the proposed split, for someone to confirm:",[298,1873,1875],{"className":343,"code":1874,"language":345,"meta":303,"style":303},"review = result[result[\"rule\"].isin([\"check\", \"single\"])]\nprint(review[[\"name\", \"first\", \"last\", \"rule\"]].to_string(index=False))\nreview.to_excel(\"names_to_review.xlsx\", index=False)\n",[14,1876,1877,1902,1934],{"__ignoreMap":303},[307,1878,1879,1882,1884,1887,1889,1892,1895,1897,1899],{"class":266,"line":309},[307,1880,1881],{"class":356},"review ",[307,1883,387],{"class":352},[307,1885,1886],{"class":356}," result[result[",[307,1888,1205],{"class":316},[307,1890,1891],{"class":356},"].isin([",[307,1893,1894],{"class":316},"\"check\"",[307,1896,419],{"class":356},[307,1898,1380],{"class":316},[307,1900,1901],{"class":356},"])]\n",[307,1903,1904,1906,1909,1911,1913,1915,1917,1919,1921,1923,1926,1928,1930,1932],{"class":266,"line":360},[307,1905,468],{"class":428},[307,1907,1908],{"class":356},"(review[[",[307,1910,410],{"class":316},[307,1912,419],{"class":356},[307,1914,454],{"class":316},[307,1916,419],{"class":356},[307,1918,459],{"class":316},[307,1920,419],{"class":356},[307,1922,1205],{"class":316},[307,1924,1925],{"class":356},"]].to_string(",[307,1927,1609],{"class":422},[307,1929,387],{"class":352},[307,1931,1614],{"class":428},[307,1933,481],{"class":356},[307,1935,1936,1939,1942,1944,1946,1948,1950],{"class":266,"line":374},[307,1937,1938],{"class":356},"review.to_excel(",[307,1940,1941],{"class":316},"\"names_to_review.xlsx\"",[307,1943,419],{"class":356},[307,1945,1609],{"class":422},[307,1947,387],{"class":352},[307,1949,1614],{"class":428},[307,1951,396],{"class":356},[10,1953,1954],{},"Once a reviewer has corrected them, keep the corrections in a lookup table keyed by the original name, and apply it before the rules on the next run — so each name is only ever reviewed once:",[298,1956,1958],{"className":343,"code":1957,"language":345,"meta":303,"style":303},"OVERRIDES = {\"José García López\": {\"first\": \"José\", \"last\": \"García López\"}}\n\ndef split_with_overrides(raw):\n    parts = split_name(raw)\n    if raw in OVERRIDES:\n        parts.update(OVERRIDES[raw], rule=\"reviewed\")\n    return parts\n\nprint(split_with_overrides(\"José García López\"))\n",[14,1959,1960,1993,1997,2006,2016,2029,2048,2055,2059],{"__ignoreMap":303},[307,1961,1962,1965,1967,1969,1971,1974,1976,1978,1981,1983,1985,1987,1990],{"class":266,"line":309},[307,1963,1964],{"class":428},"OVERRIDES",[307,1966,540],{"class":352},[307,1968,543],{"class":356},[307,1970,1650],{"class":316},[307,1972,1973],{"class":356},": {",[307,1975,454],{"class":316},[307,1977,1208],{"class":356},[307,1979,1980],{"class":316},"\"José\"",[307,1982,419],{"class":356},[307,1984,459],{"class":316},[307,1986,1208],{"class":356},[307,1988,1989],{"class":316},"\"García López\"",[307,1991,1992],{"class":356},"}}\n",[307,1994,1995],{"class":266,"line":360},[307,1996,378],{"emptyLinePlaceholder":377},[307,1998,1999,2001,2004],{"class":266,"line":374},[307,2000,623],{"class":352},[307,2002,2003],{"class":626}," split_with_overrides",[307,2005,1024],{"class":356},[307,2007,2008,2011,2013],{"class":266,"line":381},[307,2009,2010],{"class":356},"    parts ",[307,2012,387],{"class":352},[307,2014,2015],{"class":356}," split_name(raw)\n",[307,2017,2018,2020,2022,2024,2027],{"class":266,"line":399},[307,2019,635],{"class":352},[307,2021,776],{"class":356},[307,2023,641],{"class":352},[307,2025,2026],{"class":428}," OVERRIDES",[307,2028,647],{"class":356},[307,2030,2031,2034,2036,2039,2041,2043,2046],{"class":266,"line":443},[307,2032,2033],{"class":356},"        parts.update(",[307,2035,1964],{"class":428},[307,2037,2038],{"class":356},"[raw], ",[307,2040,1622],{"class":422},[307,2042,387],{"class":352},[307,2044,2045],{"class":316},"\"reviewed\"",[307,2047,396],{"class":356},[307,2049,2050,2052],{"class":266,"line":465},[307,2051,681],{"class":352},[307,2053,2054],{"class":356}," parts\n",[307,2056,2057],{"class":266,"line":678},[307,2058,378],{"emptyLinePlaceholder":377},[307,2060,2061,2063,2066,2068],{"class":266,"line":687},[307,2062,468],{"class":428},[307,2064,2065],{"class":356},"(split_with_overrides(",[307,2067,1650],{"class":316},[307,2069,481],{"class":356},[293,2071,2073],{"id":2072},"step-5-keep-the-original-and-write-the-result","Step 5 — Keep the original and write the result",[10,2075,2076],{},"Write the split columns next to the original, never instead of it. The full name is the data; the split is an interpretation of it:",[298,2078,2080],{"className":343,"code":2079,"language":345,"meta":303,"style":303},"out = result[[\"name\", \"title\", \"first\", \"last\", \"suffix\", \"rule\"]]\nout.to_excel(\"contacts_split.xlsx\", index=False)\nprint(pd.read_excel(\"contacts_split.xlsx\", keep_default_na=False)[[\"name\", \"first\", \"last\"]].head(5).to_string(index=False))\n",[14,2081,2082,2117,2135],{"__ignoreMap":303},[307,2083,2084,2087,2089,2092,2094,2096,2098,2100,2102,2104,2106,2108,2110,2112,2114],{"class":266,"line":309},[307,2085,2086],{"class":356},"out ",[307,2088,387],{"class":352},[307,2090,2091],{"class":356}," result[[",[307,2093,410],{"class":316},[307,2095,419],{"class":356},[307,2097,1183],{"class":316},[307,2099,419],{"class":356},[307,2101,454],{"class":316},[307,2103,419],{"class":356},[307,2105,459],{"class":316},[307,2107,419],{"class":356},[307,2109,1199],{"class":316},[307,2111,419],{"class":356},[307,2113,1205],{"class":316},[307,2115,2116],{"class":356},"]]\n",[307,2118,2119,2122,2125,2127,2129,2131,2133],{"class":266,"line":360},[307,2120,2121],{"class":356},"out.to_excel(",[307,2123,2124],{"class":316},"\"contacts_split.xlsx\"",[307,2126,419],{"class":356},[307,2128,1609],{"class":422},[307,2130,387],{"class":352},[307,2132,1614],{"class":428},[307,2134,396],{"class":356},[307,2136,2137,2139,2142,2144,2146,2149,2151,2153,2156,2158,2160,2162,2164,2166,2169,2171,2174,2176,2178,2180],{"class":266,"line":374},[307,2138,468],{"class":428},[307,2140,2141],{"class":356},"(pd.read_excel(",[307,2143,2124],{"class":316},[307,2145,419],{"class":356},[307,2147,2148],{"class":422},"keep_default_na",[307,2150,387],{"class":352},[307,2152,1614],{"class":428},[307,2154,2155],{"class":356},")[[",[307,2157,410],{"class":316},[307,2159,419],{"class":356},[307,2161,454],{"class":316},[307,2163,419],{"class":356},[307,2165,459],{"class":316},[307,2167,2168],{"class":356},"]].head(",[307,2170,133],{"class":428},[307,2172,2173],{"class":356},").to_string(",[307,2175,1609],{"class":422},[307,2177,387],{"class":352},[307,2179,1614],{"class":428},[307,2181,481],{"class":356},[10,2183,2184,2187,2188,2191,2192,2194,2195,2199],{},[14,2185,2186],{},"keep_default_na=False"," on the read-back keeps empty strings as empty strings rather than turning them into ",[14,2189,2190],{},"NaN",", which matters for single names whose ",[14,2193,183],{}," column is intentionally blank. ",[23,2196,2198],{"href":2197},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-a-column-into-multiple-columns-with-pandas\u002F","Split a Column into Multiple Columns with pandas"," covers splitting other kinds of combined column.",[29,2201,38,2206,38,2209,38,2212,38,2215,38,2220,38,2226,38,2232,38,2237,38,2241,38,2247,38,2250,38,2255,38,2258,38,2263,38,2267,38,2272,38,2275,38,2280,38,2285,38,2289,38,2293,38,2298,38,2301,38,2306,38,2309,38,2314,38,2317],{"viewBox":2202,"role":32,"ariaLabelledBy":2203,"xmlns":36,"style":1658},"4 0 752 233",[2204,2205],"nm-confidence-t","nm-confidence-d",[40,2207,2208],{"id":2204},"Names a rule can split and names it should not",[44,2210,2211],{"id":2205},"Two panels. Names the rules split confidently: two words, Last comma First, particles such as van, titles and suffixes. Names that need a person: three words with no particle such as Mary Ann Evans or José García López, single names, and conventions that write the family name first.",[48,2213],{"x":121,"y":51,"width":1667,"height":2214,"fill":54},"233",[48,2216],{"x":1720,"y":1672,"width":2217,"height":2218,"rx":2219,"fill":235,"stroke":236,"style":272},"351.0","201.0","14",[1678,2221,2223],{"transform":2222},"translate(182.5,29.0) scale(1.083)",[1682,2224],{"d":1729,"fill":1685,"stroke":1730,"style":2225},"stroke-width:1.66px;stroke-linecap:round;stroke-linejoin:round",[69,2227,2231],{"x":2228,"y":2229,"style":2230},"195.5","78.0","font-size:14px;font-weight:700;fill:var(--teal-ink,#0b6157);text-anchor:middle","Split by rule",[266,2233],{"x1":2234,"y1":2235,"x2":2236,"y2":2235,"stroke":236,"style":63},"36.0","91.0","355.0",[69,2238,102],{"x":2239,"y":95,"style":2240},"60.0","font-size:12px;font-weight:400;fill:var(--text,#172033);text-anchor:start",[1678,2242,2244],{"transform":2243},"translate(38.5,99.5) scale(0.625)",[1682,2245],{"d":1729,"fill":1685,"stroke":236,"style":2246},"stroke-width:2.88px;stroke-linecap:round;stroke-linejoin:round",[69,2248,114],{"x":2239,"y":2249,"style":2240},"137.0",[1678,2251,2253],{"transform":2252},"translate(38.5,125.5) scale(0.625)",[1682,2254],{"d":1729,"fill":1685,"stroke":236,"style":2246},[69,2256,138],{"x":2239,"y":2257,"style":2240},"163.0",[1678,2259,2261],{"transform":2260},"translate(38.5,151.5) scale(0.625)",[1682,2262],{"d":1729,"fill":1685,"stroke":236,"style":2246},[69,2264,2266],{"x":2239,"y":2265,"style":2240},"189.0","Dr. Grace Hopper \u002F Smith Jr.",[1678,2268,2270],{"transform":2269},"translate(38.5,177.5) scale(0.625)",[1682,2271],{"d":1729,"fill":1685,"stroke":236,"style":2246},[48,2273],{"x":2274,"y":1672,"width":2217,"height":2218,"rx":2219,"fill":1846,"stroke":1847,"style":272},"389.0",[1678,2276,2278],{"transform":2277},"translate(551.5,29.0) scale(1.083)",[1682,2279],{"d":1764,"fill":1685,"stroke":1854,"style":2225},[69,2281,2284],{"x":2282,"y":2229,"style":2283},"564.5","font-size:14px;font-weight:700;fill:var(--gold-ink,#7a4e06);text-anchor:middle","Flag for a person",[266,2286],{"x1":2287,"y1":2235,"x2":2288,"y2":2235,"stroke":1847,"style":63},"405.0","724.0",[69,2290,2292],{"x":2291,"y":95,"style":2240},"429.0","Mary Ann Evans",[1678,2294,2296],{"transform":2295},"translate(407.5,99.5) scale(0.625)",[1682,2297],{"d":1853,"fill":1685,"stroke":1847,"style":2246},[69,2299,2300],{"x":2291,"y":2249,"style":2240},"José García López",[1678,2302,2304],{"transform":2303},"translate(407.5,125.5) scale(0.625)",[1682,2305],{"d":1853,"fill":1685,"stroke":1847,"style":2246},[69,2307,2308],{"x":2291,"y":2257,"style":2240},"Prince (one name)",[1678,2310,2312],{"transform":2311},"translate(407.5,151.5) scale(0.625)",[1682,2313],{"d":1853,"fill":1685,"stroke":1847,"style":2246},[69,2315,2316],{"x":2291,"y":2265,"style":2240},"family-name-first orders",[1678,2318,2320],{"transform":2319},"translate(407.5,177.5) scale(0.625)",[1682,2321],{"d":1853,"fill":1685,"stroke":1847,"style":2246},[293,2323,2325],{"id":2324},"common-pitfalls","Common pitfalls",[2327,2328,2329,2341,2349,2355,2361],"ul",{},[2330,2331,2332,2336,2337,2340],"li",{},[2333,2334,2335],"strong",{},"Splitting on the first space."," ",[14,2338,2339],{},"str.split(\" \", n=1)"," gives \"Mary\" and \"Ann Evans\"; the last space is usually the better default.",[2330,2342,2343,2348],{},[2333,2344,2345,2347],{},[14,2346,875],{}," on every name."," It breaks McDonald, DeVries and many others; only fix single-case input.",[2330,2350,2351,2354],{},[2333,2352,2353],{},"Dropping the original column."," You cannot undo a wrong split without it.",[2330,2356,2357,2360],{},[2333,2358,2359],{},"Assuming everyone has a first and last name."," Leave the last name blank for single names rather than inventing one.",[2330,2362,2363,2336,2366,2369],{},[2333,2364,2365],{},"Unicode.",[14,2367,2368],{},"normalise"," works on accented names as they are; do not strip accents to make matching easier unless a separate matching key needs it.",[293,2371,2373],{"id":2372},"performance-notes","Performance notes",[10,2375,2376,2377,2380],{},"A per-row Python function handles hundreds of thousands of names in seconds. For very large contact lists, where a per-row function becomes the slow part of the job, run the vectorised one-liner first, then apply ",[14,2378,2379],{},"split_name"," only to rows that contain a comma, a particle, a known title or more than two words — usually a small fraction.",[293,2382,2384],{"id":2383},"conclusion","Conclusion",[10,2386,2387,2388,2390,2391,1630,2393,2395],{},"Split names with explicit, ordered rules: normalise whitespace and fix only single-case input, treat a comma as ",[14,2389,889],{},", move titles and suffixes into their own columns, start the surname at a particle such as ",[14,2392,861],{},[14,2394,912],{},", split two-word names on the space, and flag single names and three-word names without a particle for a person to confirm. Record which rule applied, keep the original name, and store reviewers' corrections so each ambiguous name is decided once.",[293,2397,2399],{"id":2398},"frequently-asked-questions","Frequently asked questions",[10,2401,2402,2405,2406,2408],{},[2333,2403,2404],{},"What is the simplest way to split a name column in pandas?","\ndf",[307,2407,410],{},".str.rsplit(\" \", n=1, expand=True) splits on the last space, giving everything before it as the first part and the final word as the last name. It is right for simple two-word names and wrong for surnames with particles or two parts.",[10,2410,2411,2414],{},[2333,2412,2413],{},"How do I handle \"Last, First\" order?","\nCheck for a comma first. When a name contains one, the part before it is the last name and the part after it the first name; split on the comma instead of on spaces.",[10,2416,2417,2420],{},[2333,2418,2419],{},"Why not just use str.title() to fix capitals?","\nBecause it lowers every letter after the first in a word, turning McDonald into Mcdonald and DeVries into Devries. Only change the case of names that are entirely upper or lower case, and leave mixed-case names as the person wrote them.",[10,2422,2423,2426],{},[2333,2424,2425],{},"Can a rule split every name correctly?","\nNo. Many naming conventions do not fit a first-and-last model at all — family names first, two family names, single names. Keep the original full name, split where the rule is confident, and flag the rest for review.",[293,2428,2430],{"id":2429},"related","Related",[2327,2432,2433,2439,2446,2453],{},[2330,2434,2435,2436,2438],{},"Up one level: ",[23,2437,26],{"href":25}," — the cleaning workflow.",[2330,2440,2441,2445],{},[23,2442,2444],{"href":2443},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fexcel-text-functions-left-right-mid-and-concat-in-pandas\u002F","Excel Text Functions LEFT, RIGHT, MID and CONCAT in pandas"," — the building blocks.",[2330,2447,2448,2452],{},[23,2449,2451],{"href":2450},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fstrip-whitespace-and-normalise-text-columns-with-pandas\u002F","Strip Whitespace and Normalise Text Columns with pandas"," — normalisation in depth.",[2330,2454,2455,2459],{},[23,2456,2458],{"href":2457},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmerging-and-joining-excel-dataframes\u002Ffuzzy-match-names-between-two-excel-files-with-python\u002F","Fuzzy Match Names Between Two Excel Files with Python"," — matching names that are spelled differently.",[2461,2462,2463],"style",{},"html pre.shiki code .sMTad, html code.shiki .sMTad{--shiki-default:#6F42C1;--shiki-dark:#FFB757}html pre.shiki code .srMev, html code.shiki .srMev{--shiki-default:#032F62;--shiki-dark:#ADDCFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s-kum, html code.shiki .s-kum{--shiki-default:#D73A49;--shiki-dark:#FF9492}html pre.shiki code .skGVy, html code.shiki .skGVy{--shiki-default:#24292E;--shiki-dark:#F0F3F6}html pre.shiki code .sa561, html code.shiki .sa561{--shiki-default:#E36209;--shiki-dark:#FFB757}html pre.shiki code .sP0c6, html code.shiki .sP0c6{--shiki-default:#005CC5;--shiki-dark:#91CBFF}html pre.shiki code .s_Opv, html code.shiki .s_Opv{--shiki-default:#6F42C1;--shiki-dark:#DBB7FF}html pre.shiki code .sSjpA, html code.shiki .sSjpA{--shiki-default:#005CC5;--shiki-dark:#FF9492}",{"title":303,"searchDepth":360,"depth":360,"links":2465},[2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476],{"id":295,"depth":360,"text":296},{"id":332,"depth":360,"text":333},{"id":519,"depth":360,"text":520},{"id":879,"depth":360,"text":880},{"id":1867,"depth":360,"text":1868},{"id":2072,"depth":360,"text":2073},{"id":2324,"depth":360,"text":2325},{"id":2372,"depth":360,"text":2373},{"id":2383,"depth":360,"text":2384},{"id":2398,"depth":360,"text":2399},{"id":2429,"depth":360,"text":2430},"2026-09-25","A single \"Name\" column holds \"Ada Lovelace\", \"Lovelace, Ada\", \"Dr. Grace Hopper\", \"Ludwig van Beethoven\" and \"Smith Jr., John\". Split it into first and last names with rules for commas, titles, suffixes and surname particles, keep the original, and flag the names no rule should guess about.","md",[2481,2483,2485,2487],{"q":2404,"a":2482},"df[\"name\"].str.rsplit(\" \", n=1, expand=True) splits on the last space, giving everything before it as the first part and the final word as the last name. It is right for simple two-word names and wrong for surnames with particles or two parts.",{"q":2413,"a":2484},"Check for a comma first. When a name contains one, the part before it is the last name and the part after it the first name; split on the comma instead of on spaces.",{"q":2419,"a":2486},"Because it lowers every letter after the first in a word, turning McDonald into Mcdonald and DeVries into Devries. Only change the case of names that are entirely upper or lower case, and leave mixed-case names as the person wrote them.",{"q":2425,"a":2488},"No. Many naming conventions do not fit a first-and-last model at all — family names first, two family names, single names. Keep the original full name, split where the rule is confident, and flag the rest for review.","split full names into first and last names with pandas",null,{"breadcrumb":2492},[2493,2496,2499],{"name":2494,"item":2495},"Home","\u002F",{"name":2497,"item":2498},"Advanced Data Transformation and Cleaning for Excel Automation","\u002Fadvanced-data-transformation-and-cleaning\u002F",{"name":2500,"item":25},"Cleaning Excel Data With Pandas: A Production Workflow","\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas",{"title":2503,"description":2504},"Split a Full Name Column into First and Last Name in pandas","Split full names into first and last names in pandas: str.split versus rsplit, \"Last, First\" order, titles and suffixes, particles such as van and de, single names, safe capitalisation and flagging ambiguous names.","split-full-names-into-first-and-last-names-with-pandas","advanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas\u002Findex",[2508,2509,2510],"data-cleaning","pandas","formula-equivalents","how-to","L9RNSiqgry7XoDO8sRiYPeO4OygLWl9IaeNtu7g__e4",[2514,2518],{"title":2515,"path":2516,"stem":2517,"children":-1},"Split Delimited Cell Values into Rows with pandas","\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-delimited-cell-values-into-rows-with-pandas","advanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-delimited-cell-values-into-rows-with-pandas\u002Findex",{"title":2519,"path":2520,"stem":2521,"children":-1},"Standardise Category Values with a Mapping Table in pandas","\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fstandardise-category-values-with-a-mapping-table","advanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fstandardise-category-values-with-a-mapping-table\u002Findex",[2523,2525],{"path":2524,"title":2500},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas",{"path":2526,"title":2497},"\u002Fadvanced-data-transformation-and-cleaning",[],[2529,2532,2535,2538,2541,2544],{"path":2530,"title":2531,"kind":2511},"\u002Fadvanced-data-transformation-and-cleaning\u002Fvalidating-excel-data-with-python\u002Ffind-duplicate-rows-in-excel-with-python","Find Duplicate Rows in Excel with Python",{"path":2533,"title":2534,"kind":2511},"\u002Fadvanced-data-transformation-and-cleaning\u002Fapplying-conditional-formatting-with-openpyxl\u002Fhighlight-duplicate-values-in-excel-with-openpyxl","Highlight Duplicate Values in Excel with openpyxl",{"path":2536,"title":2537,"kind":2511},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fclean-mixed-currency-amounts-into-amount-and-currency-columns","Clean Mixed-Currency Amounts into Amount and Currency Columns",{"path":2539,"title":2540,"kind":2511},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fcoalesce-several-excel-columns-into-one-with-pandas","Coalesce Several Excel Columns into One with pandas",{"path":2542,"title":2543,"kind":2511},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fconvert-currency-strings-to-numbers-with-pandas","Convert Currency Strings Like \"$1,234.56\" and \"(500)\" to Numbers with pandas",{"path":2545,"title":2546,"kind":2511},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fconvert-excel-text-columns-to-numbers-with-pandas","Convert Excel Text Columns to Numbers with pandas",1790972085960]