import%20marimo%0A%0A__generated_with%20%3D%20%220.25.2%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22%2C%20app_title%3D%22A%20new%20edition%3A%20Round%203%20arrives%22)%0A%0Awith%20app.setup%3A%0A%20%20%20%20%23%20The%20setup%20cell%20runs%20first.%20It%20holds%20the%20imports%20and%20settings%20every%20other%20cell%20(and%20run.py)%20uses.%0A%20%20%20%20import%20importlib%0A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20pandas%20as%20pd%0A%0A%20%20%20%20import%20course%20%20%23%20this%20course's%20helpers%3A%20file%20locations%20and%20exercise%20checks%0A%20%20%20%20import%20explain%20%20%23%20the%20explainers'%20drawings%2C%20shared%20with%20the%20primers%20(90_primers.py)%0A%20%20%20%20from%20course%20import%20NOT_YET%2C%20PATHS%2C%20attempt%2C%20check_cases%2C%20look%2C%20pick_first%2C%20waiting_for%0A%0A%20%20%20%20ROUND_ID%20%3D%20%222024Q2%22%20%20%23%20the%20round%20this%20module%20brings%20in%0A%20%20%20%20ROUNDS%20%3D%20%5B%222023Q4%22%2C%20%222024Q1%22%2C%20%222024Q2%22%5D%0A%20%20%20%20EDITIONS%20%3D%20%5B%222023Q4%22%2C%20%222024Q2%22%5D%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20A%20new%20edition%3A%20Round%203%20arrives%0A%0A%20%20%20%20**Where%20you%20are%3A**%20Get%20%E2%86%92%20Check%20%E2%86%92%20Store%20%E2%86%92%20**Share**.%20Your%20pipeline%20takes%20a%20round%20from%20its%20file%20to%20the%20database%20in%20one%20command.%20In%20this%20module%20it%20meets%20something%20new%3B%20then%2C%20in%20Share%2C%20you%20publish.%0A%0A%20%20%20%20In%20this%20module%3A%0A%0A%20%20%20%201.%20Round%203%20arrives%2C%20you%20run%20one%20command%2C%20and%20it%20**stops**%3B%0A%20%20%20%202.%20you%20find%20out%20why%2C%20in%20a%20fixed%20order%2C%20and%20fix%20the%20right%20thing%3B%0A%20%20%20%203.%20you%20make%20the%20three%20rounds%20**comparable**%2C%20area%20by%20area%2C%20although%20the%20code%20list%20changed%20between%20them.%0A%0A%20%20%20%20Then%2C%20in%20the%20Share%20module%2C%20%6031_share_round.py%60%20builds%20the%20release%20and%20%6032_datasette.py%60%20publishes%20it%2C%20and%20in%20the%20capstone%20you%20run%20your%20pipeline%20on%20a%20round%20nobody%20has%20seen.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20course.quizzes_at(%225.0%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.mermaid(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20flowchart%20LR%0A%20%20%20%20%20%20%20%20%20%20%20%20A%5B%22Get%22%5D%20--%3E%20B%5B%22Check%22%5D%20--%3E%20C%5B%22Store%22%5D%20--%3E%20D%5B%22Share%22%5D%3A%3A%3Anow%0A%20%20%20%20%20%20%20%20%20%20%20%20classDef%20now%20fill%3A%23ffa500%2Cstroke%3A%230c2340%2Ccolor%3A%230c2340%2Cfont-weight%3Abold%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%201%20%C2%B7%20Round%203%20lands%2C%20and%20the%20command%20stops%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.callout(mo.md(r%22%22%22%0A%20%20%20%20**In%20this%20section**%20(about%2015%20minutes)%0A%0A%20%20%20%20-%20**You%20learn%3A**%20that%20a%20stop%20is%20the%20pipeline%20doing%20its%20job%2C%20not%20failing%20at%20it.%0A%20%20%20%20-%20**You%20build%3A**%20Round%203's%20configuration.%0A%20%20%20%20%22%22%22)%2C%20kind%3D%22info%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Round%203%2C%20the%20second%20quarter%20of%202024%2C%20is%20%60rounds%2F2024Q2%2Fsurvey.csv%60.%20Its%20columns%20have%20the%20same%20names%20as%20Round%202's.%0A%0A%20%20%20%20**Do%20this%20now%3A**%0A%0A%20%20%20%201.%20In%20%6010_get_round.py%60%20(%5Bopen%20it%5D(%2F%3Ffile%3D10_get_round.py))%2C%20section%202%3A%20pick%20%60rounds%2F2024Q2%2Fsurvey.csv%60%2C%20choose%20the%20columns%20(the%20same%20as%20for%20Round%202)%2C%20type%20the%20round%20ID%20**%602024Q2%60**%2C%20and%20save.%20Leave%20the%20code%20list%20edition%20as%20it%20is.%0A%20%20%20%202.%20In%20a%20terminal%3A%20%60uv%20run%20python%20run.py%20--round%202024Q2%60.%0A%0A%20%20%20%20It%20stops%20at%20the%20**Get**%20stage%3A%20Round%203%20has%20area%20codes%20that%20are%20not%20in%20the%20code%20list%2C%20and%20the%20configuration%20says%20to%20stop.%20Before%20deciding%20anything%2C%20find%20out%20what%20these%20codes%20are.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%202%20%C2%B7%20Find%20out%20why%2C%20in%20a%20fixed%20order%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.callout(mo.md(r%22%22%22%0A%20%20%20%20**In%20this%20section**%20(about%2025%20minutes)%0A%0A%20%20%20%20-%20**You%20learn%3A**%20a%20fixed%20order%20for%20any%20stop%3A%20read%20the%20message%2C%20find%20the%20stage%2C%20look%20at%20the%20rows%2C%20then%20decide%20whether%20the%20**data**%2C%20the%20**code**%2C%20or%20the%20**configuration**%20is%20wrong.%0A%20%20%20%20-%20**You%20build%3A**%20%60editions_of%60%2C%20which%20says%20which%20edition%20of%20the%20code%20list%20each%20unknown%20code%20belongs%20to.%0A%20%20%20%20%22%22%22)%2C%20kind%3D%22info%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%7C%20step%20%7C%20here%20%7C%0A%20%20%20%20%7C%3A--%7C%3A--%7C%0A%20%20%20%20%7C%201.%20**Read%20the%20message**%20%7C%20*Round%202024Q2%20has%20area%20codes%20that%20are%20not%20in%20the%20code%20list%3A%20%E2%80%A6*%20%7C%0A%20%20%20%20%7C%202.%20**Find%20the%20stage**%20%7C%20%60%5Bget%5D%60%3A%20the%20codes%20were%20checked%20against%20the%20code%20list%20while%20staging%20%7C%0A%20%20%20%20%7C%203.%20**Look%20at%20the%20rows**%20%7C%20below%3A%20which%20codes%2C%20how%20many%20people%2C%20and%20where%20else%20they%20appear%20%7C%0A%20%20%20%20%7C%204.%20**Decide%20what%20is%20wrong**%20%7C%20the%20data%20(typing%20errors%20in%20the%20field%3A%20report%20them)%2C%20the%20code%20(a%20bug%3A%20fix%20it)%2C%20or%20the%20configuration%20(the%20round%20was%20described%20wrongly%3A%20fix%20the%20description)%20%7C%0A%0A%20%20%20%20Last%20time%20(Rounds%201%20and%202)%20unknown%20codes%20were%20keying%20errors%20in%20the%20field.%20Is%20it%20the%20same%20this%20time%3F%20The%20cell%20below%20reads%20Round%203%20with%20**your**%20functions%20from%20the%20Get%20module%20and%20lists%20its%20unknown%20codes.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20round_rows(round_id%3A%20str)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22A%20round%20read%20with%20its%20saved%20configuration%2C%20through%20your%20read_round%20from%20the%20Get%20module.%22%22%22%0A%20%20%20%20get%20%3D%20importlib.import_module(%2210_get_round%22)%0A%20%20%20%20return%20get.read_round(get.load_round_config(round_id))%0A%0A%0A%40app.function%0Adef%20edition_codes(edition%3A%20str)%20-%3E%20set%5Bstr%5D%3A%0A%20%20%20%20%22%22%22The%20area%20codes%20of%20one%20edition%20of%20the%20code%20list.%22%22%22%0A%20%20%20%20table%20%3D%20pd.read_excel(PATHS.reference%20%2F%20f%22psgc_%7Bedition%7D.xlsx%22%2C%20header%3D3%2C%20dtype%3Dstr)%0A%20%20%20%20codes%20%3D%20table%5B%22Code%22%5D.dropna()%0A%20%20%20%20return%20set(codes%5Bcodes.str.fullmatch(r%22%5Cd%2B%22)%5D.str.zfill(10))%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20look_button%20%3D%20mo.ui.run_button(label%3Df%22Read%20round%20%7BROUND_ID%7D%20and%20list%20its%20unknown%20codes%22)%0A%20%20%20%20look_button%0A%20%20%20%20return%20(look_button%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(look_button)%3A%0A%20%20%20%20look_button%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20round3%20%3D%20round_rows(ROUND_ID)%0A%20%20%20%20except%20Exception%20as%20_error%3A%0A%20%20%20%20%20%20%20%20round3%20%3D%20NOT_YET%0A%20%20%20%20%20%20%20%20_out%20%3D%20mo.callout(mo.md(f%22Round%20%7BROUND_ID%7D%20cannot%20be%20read%20yet%20(%7Btype(_error).__name__%7D%3A%20%7Bstr(_error).splitlines()%5B0%5D%5B%3A140%5D%7D).%20Save%20its%20configuration%20first%20(step%201%20above)%2C%20then%20press%20the%20button.%22)%2C%20kind%3D%22neutral%22)%0A%20%20%20%20if%20round3%20is%20not%20NOT_YET%3A%0A%20%20%20%20%20%20%20%20_unknown%20%3D%20round3.loc%5B~round3%5B%22area_code%22%5D.isin(edition_codes(%222023Q4%22))%2C%20%22area_code%22%5D.value_counts().rename_axis(%22area_code%22).reset_index(name%3D%22persons%22)%0A%20%20%20%20%20%20%20%20_out%20%3D%20mo.vstack(%5Bmo.md(f%22**Round%20%7BROUND_ID%7D%3A%20%7Blen(round3)%3A%2C%7D%20rows.**%20Area%20codes%20not%20in%20the%202023Q4%20code%20list%3A%22)%2C%20_unknown%5D)%0A%20%20%20%20_out%0A%20%20%20%20return%20(round3%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Exercise%202.1.%20Which%20edition%20is%20each%20code%20in%3F%0A%0A%20%20%20%20**Why%20it%20matters%3A**%20a%20typing%20error%20is%20in%20**no**%20edition%3B%20a%20code%20from%20a%20new%20edition%20is%20in%20**that**%20edition.%20That%20one%20fact%20decides%20what%20to%20fix.%0A%0A%20%20%20%20**Input%20%E2%86%92%20output%3A**%20a%20list%20of%20codes%2C%20and%20a%20dictionary%20of%20editions%20(%60%7B%222023Q4%22%3A%20%7B...codes...%7D%2C%20%222024Q2%22%3A%20%7B...%7D%7D%60)%20%E2%86%92%20a%20table%20with%20one%20row%20per%20code%3A%20%60code%60%2C%20and%20%60editions%60%2C%20the%20editions%20it%20is%20in%2C%20joined%20with%20%60%22%2C%20%22%60%2C%20or%20%60%22none%22%60.%0A%0A%20%20%20%20%7C%20code%20%7C%20editions%20%7C%0A%20%20%20%20%7C%3A--%7C%3A--%7C%0A%20%20%20%20%7C%20%600100105000%60%20%7C%20%602023Q4%2C%202024Q2%60%20%7C%0A%20%20%20%20%7C%20%600100306000%60%20%7C%20%602024Q2%60%20%7C%0A%20%20%20%20%7C%20%600600399000%60%20%7C%20%60none%60%20%7C%0A%0A%20%20%20%20For%20each%20code%2C%20keep%20the%20edition%20names%20whose%20set%20contains%20it%3A%20%60%5Bname%20for%20name%2C%20codes%20in%20editions.items()%20if%20code%20in%20codes%5D%60.%20Build%20one%20dictionary%20per%20row%20and%20return%20%60pd.DataFrame(rows)%60.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20editions_of(codes%3A%20list%5Bstr%5D%2C%20editions%3A%20dict%5Bstr%2C%20set%5Bstr%5D%5D)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22For%20each%20code%2C%20the%20editions%20of%20the%20code%20list%20it%20appears%20in%20(or%20'none').%22%22%22%0A%20%20%20%20%23%20Exercise%202.1%3A%20the%20task%20and%20examples%20are%20in%20the%20text%20above%20this%20cell.%0A%20%20%20%20%23%20For%20each%20code%3A%20the%20names%20of%20the%20editions%20whose%20set%20contains%20it%2C%20joined%20with%20%22%2C%20%22%2C%20or%20%22none%22.%0A%20%20%20%20%23%20Collect%20%7B%22code%22%3A%20...%2C%20%22editions%22%3A%20...%7D%20dictionaries%20in%20a%20list%2C%20and%20return%20pd.DataFrame(rows).%0A%20%20%20%20raise%20NotImplementedError(%22Exercise%202.1%22)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20_editions%20%3D%20%7B%222023Q4%22%3A%20%7B%220100105000%22%2C%20%220100102500%22%7D%2C%20%222024Q2%22%3A%20%7B%220100105000%22%2C%20%220100102000%22%2C%20%220100306000%22%7D%7D%0A%20%20%20%20check_cases(%0A%20%20%20%20%20%20%20%20%22Exercise%202.1%22%2C%20editions_of%2C%20%5B(%22four%20codes%2C%20two%20editions%22%2C%20(%5B%220100105000%22%2C%20%220100306000%22%2C%20%220100102500%22%2C%20%220600399000%22%5D%2C%20_editions))%5D%2C%0A%20%20%20%20%20%20%20%20what%3D%22lists%20of%20codes%22%2C%20summarize%3Dlambda%20t%3A%20t%5B%5B%22code%22%2C%20%22editions%22%5D%5D.values.tolist()%2C%0A%20%20%20%20%20%20%20%20hint%3D%22A%20code%20in%20both%20editions%20lists%20both%2C%20in%20the%20order%20of%20the%20dictionary.%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(round3)%3A%0A%20%20%20%20%23%20Try%20it%3A%20Round%203's%20unknown%20codes%2C%20against%20both%20editions%20of%20the%20code%20list.%0A%20%20%20%20_codes%20%3D%20sorted(set(round3%5B%22area_code%22%5D)%20-%20edition_codes(%222023Q4%22))%20if%20round3%20is%20not%20NOT_YET%20else%20NOT_YET%0A%20%20%20%20course.try_it(editions_of%2C%20_codes%2C%20%7Be%3A%20edition_codes(e)%20for%20e%20in%20EDITIONS%7D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.accordion(%7B%22If%20the%20check%20is%20red%3A%20common%20causes%20for%20Exercise%202.1%22%3A%20mo.md(r%22%22%22%0A%20%20%20%20%7C%20what%20you%20see%20%7C%20the%20usual%20cause%20%7C%20look%20at%20%7C%0A%20%20%20%20%7C%3A--%7C%3A--%7C%3A--%7C%0A%20%20%20%20%7C%20%60editions%60%20holds%20a%20list%2C%20like%20%60%5B'2024Q2'%5D%60%20%7C%20The%20names%20were%20not%20joined%20into%20one%20text.%20%7C%20%60%22%2C%20%22.join(found)%60%20%7C%0A%20%20%20%20%7C%20An%20empty%20text%20instead%20of%20%60none%60%20%7C%20No%20edition%20was%20found%2C%20and%20nothing%20replaced%20the%20empty%20result.%20%7C%20%60...%20if%20found%20else%20%22none%22%60%20%7C%0A%20%20%20%20%7C%20*KeyError*%20%7C%20The%20dictionary%20is%20looked%20up%20by%20code%20instead%20of%20looping%20over%20it.%20%7C%20%60for%20name%2C%20codes%20in%20editions.items()%60%20%7C%0A%0A%20%20%20%20Still%20stuck%20after%20ten%20minutes%3F%20Ask%20your%20table%2C%20then%20raise%20your%20hand.%0A%20%20%20%20%22%22%22)%7D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(round3)%3A%0A%20%20%20%20mo.stop(round3%20is%20NOT_YET)%0A%20%20%20%20_codes%20%3D%20sorted(set(round3%5B%22area_code%22%5D)%20-%20edition_codes(%222023Q4%22))%0A%20%20%20%20_table%20%3D%20attempt(editions_of%2C%20_codes%2C%20%7Be%3A%20edition_codes(e)%20for%20e%20in%20EDITIONS%7D)%0A%20%20%20%20mo.stop(_table%20is%20NOT_YET%2C%20waiting_for(%22Exercise%202.1%22))%0A%20%20%20%20_only_new%20%3D%20bool(len(_table))%20and%20set(_table%5B%22editions%22%5D)%20%3D%3D%20%7B%222024Q2%22%7D%0A%20%20%20%20mo.vstack(%5B%0A%20%20%20%20%20%20%20%20_table%2C%0A%20%20%20%20%20%20%20%20mo.callout(mo.md(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22**Every%20unknown%20code%20is%20in%20the%202024Q2%20edition.**%20These%20are%20not%20typing%20errors%3A%20Round%203%20was%20coded%20with%20the%20**new%20edition**%20of%20the%20code%20list.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%22The%20data%20is%20right%2C%20and%20so%20is%20your%20code.%20What%20is%20wrong%20is%20the%20**configuration**%3A%20it%20says%20Round%203%20uses%20the%202023Q4%20edition.%5Cn%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%22**Fix%20the%20description%2C%20not%20the%20data%3A**%20in%20%6010_get_round.py%60%2C%20section%202%2C%20set%20the%20code%20list%20edition%20to%20**2024Q2**%2C%20tick%20*Replace%20the%20saved%20configuration*%2C%20save%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%22and%20run%20%60uv%20run%20python%20run.py%20--round%202024Q2%60%20again.%20This%20time%20it%20goes%20all%20the%20way%20to%20the%20database.%22%0A%20%20%20%20%20%20%20%20)%20if%20_only_new%20else%20mo.md(%22Some%20codes%20are%20in%20no%20edition%3A%20those%20are%20typing%20errors%2C%20to%20report%20to%20the%20field%20office%2C%20as%20in%20the%20Get%20module.%22)%2C%20kind%3D%22success%22%20if%20_only_new%20else%20%22warn%22)%2C%0A%20%20%20%20%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.callout(mo.md(r%22%22%22%0A%20%20%20%20**Recap**%0A%0A%20%20%20%20-%20A%20stop%20is%20a%20question.%20Read%20the%20message%2C%20find%20the%20stage%2C%20look%20at%20the%20rows%2C%20then%20decide%20what%20is%20wrong.%0A%20%20%20%20-%20Codes%20in%20**no**%20edition%20are%20errors%20in%20the%20data%3B%20codes%20in%20a%20**newer**%20edition%20mean%20the%20round's%20description%20must%20change.%0A%0A%20%20%20%20Key%20terms%20(%5Bglossary%5D(%2F%3Ffile%3D91_glossary.py))%3A%20edition%2C%20diagnosis.%0A%20%20%20%20%22%22%22)%2C%20kind%3D%22success%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%203%20%C2%B7%20Making%20rounds%20comparable%20across%20editions%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.callout(mo.md(r%22%22%22%0A%20%20%20%20**In%20this%20section**%20(about%2040%20minutes)%0A%0A%20%20%20%20-%20**You%20learn%3A**%20what%20a%20crosswalk%20is%2C%20and%20why%20the%20direction%20you%20use%20it%20in%20decides%20whether%20people%20get%20copied.%0A%20%20%20%20-%20**You%20build%3A**%20%60load_crosswalk%60%20and%20%60to_edition_2023q4%60%2C%20which%20put%20Round%203%20on%20the%20same%20geography%20as%20Rounds%201%20and%202.%0A%20%20%20%20%22%22%22)%2C%20kind%3D%22info%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Round%203%20is%20now%20stored%2C%20with%202024Q2%20codes.%20Rounds%201%20and%202%20have%202023Q4%20codes.%20Count%20the%20people%20of%20a%20few%20municipalities%20in%20each%20round%2C%20by%20the%20codes%20each%20round%20uses%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20persons_by_code(codes%3A%20list%5Bstr%5D)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22People%20per%20area%20code%20and%20round%2C%20from%20the%20course%20database.%22%22%22%0A%20%20%20%20with%20course.database(read_only%3DTrue)%20as%20con%3A%0A%20%20%20%20%20%20%20%20placeholders%20%3D%20%22%2C%20%22.join(%22%3F%22%20for%20_%20in%20codes)%0A%20%20%20%20%20%20%20%20table%20%3D%20con.execute(f%22SELECT%20area_code_reported%20AS%20area_code%2C%20round%2C%20count(*)%20AS%20persons%20FROM%20persons%20WHERE%20area_code_reported%20IN%20(%7Bplaceholders%7D)%20GROUP%20BY%20ALL%22%2C%20codes).df()%0A%20%20%20%20return%20table.pivot_table(index%3D%22area_code%22%2C%20columns%3D%22round%22%2C%20values%3D%22persons%22%2C%20fill_value%3D0).reset_index()%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20series_button%20%3D%20mo.ui.run_button(label%3D%22Count%20the%20people%20of%20these%20municipalities%20in%20every%20stored%20round%22)%0A%20%20%20%20series_button%0A%20%20%20%20return%20(series_button%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(series_button)%3A%0A%20%20%20%20mo.stop(not%20series_button.value)%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20_table%20%3D%20persons_by_code(%5B%220100102500%22%2C%20%220100102000%22%2C%20%220100304000%22%2C%20%220100306000%22%5D)%0A%20%20%20%20%20%20%20%20_out%20%3D%20mo.vstack(%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20_table%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20Read%20the%20rows%3A%0A%0A%20%20%20%20-%20%600100102500%60%20has%20people%20in%202023Q4%20and%202024Q1%2C%20then%20**none**%3B%20%600100102000%60%20appears%20only%20in%202024Q2.%20It%20is%20**the%20same%20municipality**%3A%20its%20code%20was%20corrected%20in%20the%20new%20edition.%0A%20%20%20%20-%20%600100304000%60%20has%20**fewer**%20people%20in%202024Q2%2C%20and%20%600100306000%60%20appears%20from%20nowhere%3A%20part%20of%20the%20municipality%20became%20a%20**new%20municipality**%20in%202024Q2.%20It%20**split**.%0A%0A%20%20%20%20Compared%20code%20by%20code%2C%20it%20looks%20as%20if%20a%20town%20emptied%20and%20two%20others%20sprang%20up.%20To%20compare%20rounds%20you%20need%20a%20**crosswalk**%3A%20a%20table%20saying%20which%20code%20in%20one%20edition%20corresponds%20to%20which%20code%20in%20the%20other.%0A%20%20%20%20%22%22%22)%2C%0A%20%20%20%20%20%20%20%20%5D)%0A%20%20%20%20except%20Exception%20as%20_error%3A%0A%20%20%20%20%20%20%20%20_out%20%3D%20mo.callout(mo.md(f%22Store%20all%20three%20rounds%20first%3A%20%60uv%20run%20python%20run.py%20--rounds%202023Q4%2C2024Q1%2C2024Q2%60%20(%7Btype(_error).__name__%7D).%22)%2C%20kind%3D%22neutral%22)%0A%20%20%20%20_out%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%23%20Concept%3A%20a%20crosswalk%20has%20a%20direction%0A%0A%20%20%20%20The%202024Q2%20workbook%20says%2C%20for%20each%20of%20its%20codes%2C%20which%202023Q4%20code%20it%20came%20from%20(the%20column%20*Code%20(2023Q4%20edition)*).%20Every%20**new**%20code%20has%20exactly%20**one**%20old%20code.%20But%20an%20old%20code%20that%20split%20has%20**two**%20new%20codes.%20So%20a%20crosswalk%20is%20safe%20in%20one%20direction%20and%20not%20in%20the%20other.%20Try%20both%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20card_direction%20%3D%20mo.ui.radio(options%3D%5B%22new%20codes%20to%20old%22%2C%20%22old%20codes%20to%20new%22%5D%2C%20value%3D%22new%20codes%20to%20old%22%2C%20label%3D%22direction%3A%22%2C%20inline%3DTrue)%0A%20%20%20%20card_validate%20%3D%20mo.ui.checkbox(label%3D'validate%3D%22many_to_one%22'%2C%20value%3DFalse)%0A%20%20%20%20mo.hstack(%5Bcard_direction%2C%20card_validate%5D%2C%20justify%3D%22start%22%2C%20gap%3D2)%0A%20%20%20%20return%20card_direction%2C%20card_validate%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(card_direction%2C%20card_validate)%3A%0A%20%20%20%20explain.crosswalk_demo(card_direction.value%2C%20card_validate.value)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20So%20the%20comparable%20geography%20for%20all%20three%20rounds%20is%20**2023Q4's**%3A%20map%20Round%203's%20new%20codes%20back%20to%20the%20old%20ones.%20Each%20person%20keeps%20one%20row%2C%20and%20the%20municipality%20that%20split%20is%20counted%20as%20it%20was%20before%20the%20split.%20More%3A%20%5Bprimer%2014%2C%20Crosswalks%5D(%2F%3Ffile%3D90_primers.py).%0A%0A%20%20%20%20%23%23%23%20Exercise%203.1.%20Load%20the%20crosswalk%0A%0A%20%20%20%20**Why%20it%20matters%3A**%20the%20crosswalk%20comes%20from%20the%20code%20list's%20publisher%2C%20inside%20the%20new%20workbook.%20Reading%20it%20with%20the%20same%20care%20as%20the%20code%20list%20keeps%20every%20code%20intact.%0A%0A%20%20%20%20**Input%20%E2%86%92%20output%3A**%20the%20path%20of%20the%202024Q2%20workbook%20%E2%86%92%20a%20table%20with%20%60code_2024q2%60%20and%20%60code_2023q4%60%2C%20both%20as%2010-character%20text%2C%20one%20row%20per%202024Q2%20code.%0A%0A%20%20%20%20Read%20it%20as%20in%20the%20Get%20module's%20Exercise%203.1%20(%60header%3D3%60%2C%20%60dtype%3Dstr%60)%2C%20keep%20the%20rows%20whose%20%60Code%60%20is%20made%20of%20digits%2C%20keep%20the%20columns%20%60Code%60%20and%20%60Code%20(2023Q4%20edition)%60%2C%20rename%20them%20to%20%60code_2024q2%60%20and%20%60code_2023q4%60%2C%20pad%20both%20to%2010%20characters%20(%60.str.zfill(10)%60)%2C%20and%20drop%20duplicate%20rows.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20load_crosswalk(path)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22The%20crosswalk%20from%20the%202024Q2%20workbook%3A%20code_2024q2%20and%20code_2023q4%2C%20as%2010-character%20text.%22%22%22%0A%20%20%20%20%23%20Exercise%203.1%3A%20the%20task%20and%20examples%20are%20in%20the%20text%20above%20this%20cell.%0A%20%20%20%20%23%20Step%201%3A%20read%20the%20sheet%20as%20in%20the%20Get%20module%20(header%3D3%2C%20dtype%3Dstr)%20and%20keep%20the%20rows%20whose%20Code%20is%20made%20of%20digits%0A%20%20%20%20%23%20Step%202%3A%20keep%20and%20rename%20the%20two%20code%20columns%3B%20pad%20both%20to%2010%20characters%3B%20drop%20duplicate%20rows%3B%20return%0A%20%20%20%20raise%20NotImplementedError(%22Exercise%203.1%22)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20check_cases(%0A%20%20%20%20%20%20%20%20%22Exercise%203.1%22%2C%20load_crosswalk%2C%20%5B(%22the%202024Q2%20workbook%22%2C%20(PATHS.reference%20%2F%20%22psgc_2024Q2.xlsx%22%2C))%5D%2C%0A%20%20%20%20%20%20%20%20what%3D%22workbooks%22%2C%20summarize%3Dlambda%20t%3A%20sorted(map(tuple%2C%20t%5B%5B%22code_2024q2%22%2C%20%22code_2023q4%22%5D%5D.astype(str).values.tolist()))%2C%0A%20%20%20%20%20%20%20%20hint%3D%22One%20row%20per%202024Q2%20code%3B%20two%20of%20them%20point%20to%20the%20same%202023Q4%20code%20(the%20split).%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20%23%20Try%20it%3A%20the%20crosswalk%20rows%20where%20the%20two%20editions%20differ.%0A%20%20%20%20def%20_differ()%3A%0A%20%20%20%20%20%20%20%20crosswalk%20%3D%20load_crosswalk(PATHS.reference%20%2F%20%22psgc_2024Q2.xlsx%22)%0A%20%20%20%20%20%20%20%20return%20crosswalk%5Bcrosswalk%5B%22code_2024q2%22%5D%20!%3D%20crosswalk%5B%22code_2023q4%22%5D%5D%0A%0A%20%20%20%20course.try_it(_differ)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.accordion(%7B%22If%20the%20check%20is%20red%3A%20common%20causes%20for%20Exercise%203.1%22%3A%20mo.md(r%22%22%22%0A%20%20%20%20%7C%20what%20you%20see%20%7C%20the%20usual%20cause%20%7C%20look%20at%20%7C%0A%20%20%20%20%7C%3A--%7C%3A--%7C%3A--%7C%0A%20%20%20%20%7C%20*KeyError%3A%20'Code%20(2023Q4%20edition)'*%20%7C%20The%20column%20name%20is%20not%20exactly%20the%20workbook's.%20%7C%20copy%20it%20from%20the%20workbook's%20header%20row%20%7C%0A%20%20%20%20%7C%20Codes%20have%209%20characters%20%7C%20The%20workbook%20stores%20codes%20as%20numbers.%20%7C%20%60.str.zfill(10)%60%20on%20both%20columns%20%7C%0A%20%20%20%20%7C%20More%20rows%20than%20codes%20%7C%20Blank%20rows%20or%20the%20note%20under%20the%20table%20are%20still%20there.%20%7C%20keep%20the%20rows%20whose%20%60Code%60%20is%20digits%20%7C%0A%0A%20%20%20%20Still%20stuck%20after%20ten%20minutes%3F%20Ask%20your%20table%2C%20then%20raise%20your%20hand.%0A%20%20%20%20%22%22%22)%7D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20predict_rows%20%3D%20mo.ui.radio(%0A%20%20%20%20%20%20%20%20options%3D%5B%22The%20same%20number%20of%20rows%22%2C%20%22More%20rows%22%2C%20%22Fewer%20rows%22%5D%2C%0A%20%20%20%20%20%20%20%20label%3D%22**Predict.**%20Round%203%20is%20joined%20to%20the%20crosswalk%20on%20its%202024Q2%20codes%2C%20with%20%60how%3D%5C%22left%5C%22%60.%20How%20many%20rows%20come%20out%3F%22%2C%0A%20%20%20%20)%0A%20%20%20%20predict_rows%0A%20%20%20%20return%20(predict_rows%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(predict_rows)%3A%0A%20%20%20%20mo.stop(predict_rows.value%20is%20None%2C%20pick_first())%0A%20%20%20%20mo.md(f%22You%20predicted%20*%7Bpredict_rows.value%7D*.%20**The%20same%20number**%3A%20every%202024Q2%20code%20has%20one%20row%20in%20the%20crosswalk%2C%20so%20each%20person%20matches%20once%20(*many%20to%20one*).%20The%20other%20direction%2C%20old%20codes%20to%20new%2C%20would%20copy%20the%20people%20of%20the%20municipality%20that%20split%2C%20as%20the%20explainer%20showed.%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Exercise%203.2.%20Round%203%20in%202023Q4%20geography%0A%0A%20%20%20%20**Why%20it%20matters%3A**%20with%20every%20round%20on%20the%20same%20codes%2C%20a%20municipality's%20numbers%20can%20be%20followed%20from%20round%20to%20round.%0A%0A%20%20%20%20**Input%20%E2%86%92%20output%3A**%20a%20round's%20rows%20(with%20%60area_code%60%20in%202024Q2%20codes)%20and%20the%20crosswalk%20%E2%86%92%20the%20same%20rows%2C%20with%20a%20new%20column%20%60area_code_2023q4%60.%20A%20code%20that%20is%20not%20in%20the%20crosswalk%20(an%20unknown%20code%20you%20decided%20to%20keep)%20keeps%20its%20own%20value.%0A%0A%20%20%20%201.%20left-join%20the%20rows%20to%20the%20crosswalk%3A%20%60left_on%3D%22area_code%22%2C%20right_on%3D%22code_2024q2%22%60%2C%20with%20%60validate%3D%22many_to_one%22%60%3B%0A%20%20%20%202.%20%60area_code_2023q4%60%20is%20the%20crosswalk's%20%60code_2023q4%60%2C%20or%2C%20where%20that%20is%20missing%2C%20the%20row's%20own%20%60area_code%60%3A%20%60joined%5B%22code_2023q4%22%5D.fillna(joined%5B%22area_code%22%5D)%60%3B%0A%20%20%20%203.%20drop%20the%20crosswalk's%20two%20columns%20and%20return.%20The%20number%20of%20rows%20must%20not%20change.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20to_edition_2023q4(rows%3A%20pd.DataFrame%2C%20crosswalk%3A%20pd.DataFrame)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22The%20rows%2C%20with%20area_code_2023q4%3A%20each%202024Q2%20area%20code%20mapped%20to%20the%202023Q4%20code%20it%20came%20from.%22%22%22%0A%20%20%20%20%23%20Exercise%203.2%3A%20the%20task%20and%20examples%20are%20in%20the%20text%20above%20this%20cell.%0A%20%20%20%20%23%20Step%201%3A%20left-join%20rows%20to%20the%20crosswalk%20(left_on%3D%22area_code%22%2C%20right_on%3D%22code_2024q2%22%2C%20validate%3D%22many_to_one%22)%0A%20%20%20%20%23%20Step%202%3A%20area_code_2023q4%20%3D%20the%20crosswalk's%20code_2023q4%2C%20or%20the%20row's%20own%20area_code%20where%20it%20is%20missing%0A%20%20%20%20%23%20Step%203%3A%20drop%20code_2024q2%20and%20code_2023q4%2C%20and%20return%0A%20%20%20%20raise%20NotImplementedError(%22Exercise%203.2%22)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20_rows%20%3D%20pd.DataFrame(%7B%22person%22%3A%20%5B%22P1%22%2C%20%22P2%22%2C%20%22P3%22%2C%20%22P4%22%2C%20%22P5%22%5D%2C%20%22area_code%22%3A%20%5B%220100102000%22%2C%20%220100304000%22%2C%20%220100306000%22%2C%20%220100105000%22%2C%20%220600399000%22%5D%7D)%0A%20%20%20%20check_cases(%0A%20%20%20%20%20%20%20%20%22Exercise%203.2%22%2C%20to_edition_2023q4%2C%20%5B(%22five%20people%2C%20one%20of%20them%20with%20an%20unknown%20code%22%2C%20(_rows%2C%20explain.CROSSWALK%5B%5B%22code_2024q2%22%2C%20%22code_2023q4%22%5D%5D))%5D%2C%0A%20%20%20%20%20%20%20%20what%3D%22tables%22%2C%20summarize%3Dlambda%20t%3A%20t%5B%5B%22person%22%2C%20%22area_code%22%2C%20%22area_code_2023q4%22%5D%5D.values.tolist()%2C%0A%20%20%20%20%20%20%20%20hint%3D%22Five%20rows%20in%2C%20five%20rows%20out%3B%20the%20unknown%20code%20keeps%20its%20own%20value.%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20%23%20Try%20it%3A%20five%20people%2C%20one%20with%20a%20code%20that%20is%20in%20no%20crosswalk.%0A%20%20%20%20course.try_it(to_edition_2023q4%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pd.DataFrame(%7B%22person%22%3A%20%5B%22P1%22%2C%20%22P2%22%2C%20%22P3%22%2C%20%22P4%22%2C%20%22P5%22%5D%2C%20%22area_code%22%3A%20%5B%220100102000%22%2C%20%220100304000%22%2C%20%220100306000%22%2C%20%220100105000%22%2C%20%220600399000%22%5D%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20explain.CROSSWALK%5B%5B%22code_2024q2%22%2C%20%22code_2023q4%22%5D%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.accordion(%7B%22If%20the%20check%20is%20red%3A%20common%20causes%20for%20Exercise%203.2%22%3A%20mo.md(r%22%22%22%0A%20%20%20%20%7C%20what%20you%20see%20%7C%20the%20usual%20cause%20%7C%20look%20at%20%7C%0A%20%20%20%20%7C%3A--%7C%3A--%7C%3A--%7C%0A%20%20%20%20%7C%20The%20unknown%20code%20has%20an%20empty%20%60area_code_2023q4%60%20%7C%20Rows%20not%20in%20the%20crosswalk%20were%20not%20given%20their%20own%20code.%20%7C%20%60.fillna(joined%5B%22area_code%22%5D)%60%20%7C%0A%20%20%20%20%7C%20*MergeError*%20%7C%20The%20crosswalk%20lists%20a%202024Q2%20code%20twice.%20%7C%20%60drop_duplicates()%60%20in%20Exercise%203.1%20%7C%0A%20%20%20%20%7C%20Extra%20columns%20%7C%20The%20crosswalk's%20columns%20are%20still%20there.%20%7C%20drop%20%60code_2024q2%60%20and%20%60code_2023q4%60%20%7C%0A%0A%20%20%20%20Still%20stuck%20after%20ten%20minutes%3F%20Ask%20your%20table%2C%20then%20raise%20your%20hand.%0A%20%20%20%20%22%22%22)%7D)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20comparable_counts(codes_2023q4%3A%20list%5Bstr%5D)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22People%20per%202023Q4%20municipality%20and%20round%2C%20every%20round%20mapped%20to%202023Q4%20codes%20with%20your%20functions.%22%22%22%0A%20%20%20%20crosswalk%20%3D%20load_crosswalk(PATHS.reference%20%2F%20%22psgc_2024Q2.xlsx%22)%0A%20%20%20%20check_stage%20%3D%20importlib.import_module(%2220_check_round%22)%0A%20%20%20%20tables%20%3D%20%5B%5D%0A%20%20%20%20with%20course.database(read_only%3DTrue)%20as%20con%3A%0A%20%20%20%20%20%20%20%20for%20round_id%20in%20ROUNDS%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20rows%20%3D%20con.execute(%22SELECT%20round%2C%20area_code_reported%20AS%20area_code%20FROM%20persons%20WHERE%20round%20%3D%20%3F%22%2C%20%5Bround_id%5D).df()%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20check_stage.round_edition(round_id)%20%3D%3D%20%222024Q2%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20rows%20%3D%20to_edition_2023q4(rows%2C%20crosswalk)%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20rows%20%3D%20rows.assign(area_code_2023q4%3Drows%5B%22area_code%22%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20tables.append(rows)%0A%20%20%20%20every%20%3D%20pd.concat(tables%2C%20ignore_index%3DTrue)%0A%20%20%20%20every%20%3D%20every%5Bevery%5B%22area_code_2023q4%22%5D.isin(codes_2023q4)%5D%0A%20%20%20%20return%20every.pivot_table(index%3D%22area_code_2023q4%22%2C%20columns%3D%22round%22%2C%20values%3D%22area_code%22%2C%20aggfunc%3D%22size%22%2C%20fill_value%3D0).reset_index()%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20comparable_button%20%3D%20mo.ui.run_button(label%3D%22Count%20again%2C%20every%20round%20in%202023Q4%20codes%22)%0A%20%20%20%20comparable_button%0A%20%20%20%20return%20(comparable_button%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(comparable_button)%3A%0A%20%20%20%20mo.stop(not%20comparable_button.value)%0A%20%20%20%20_table%20%3D%20attempt(comparable_counts%2C%20%5B%220100102500%22%2C%20%220100304000%22%5D)%0A%20%20%20%20mo.stop(_table%20is%20NOT_YET%2C%20waiting_for(%22Exercises%203.1%20and%203.2%22))%0A%20%20%20%20mo.vstack(%5B%0A%20%20%20%20%20%20%20%20_table%2C%0A%20%20%20%20%20%20%20%20mo.md(%22Now%20each%20municipality%20has%20a%20number%20in%20every%20round%2C%20and%20the%20numbers%20are%20of%20the%20same%20size%3A%20the%20corrected%20code%20and%20the%20split%20are%20no%20longer%20breaks%20in%20the%20series.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Comparing%20**finer**%20areas%20than%20the%20old%20edition%20knew%20(the%20two%20municipalities%20the%20split%20created)%20is%20only%20possible%20from%202024Q2%20on%3B%20stretch%20exercise%20S3.3%20shows%20one%20way%20to%20estimate%20them%20for%20earlier%20rounds%2C%20and%20what%20that%20assumes.%22)%2C%0A%20%20%20%20%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.callout(mo.md(r%22%22%22%0A%20%20%20%20**Recap**%0A%0A%20%20%20%20-%20A%20new%20edition%20of%20a%20code%20list%20changes%20codes%2C%20splits%20areas%2C%20and%20renames%20them.%20A%20crosswalk%20connects%20the%20editions.%0A%20%20%20%20-%20New%20%E2%86%92%20old%20is%20many-to-one%3A%20safe%2C%20nobody%20is%20copied.%20Old%20%E2%86%92%20new%20copies%20the%20people%20of%20an%20area%20that%20split.%0A%20%20%20%20-%20To%20compare%20rounds%2C%20put%20them%20all%20on%20one%20edition's%20codes%2C%20and%20say%20which.%0A%0A%20%20%20%20Key%20terms%20(%5Bglossary%5D(%2F%3Ffile%3D91_glossary.py))%3A%20crosswalk%2C%20edition%2C%20split%2C%20many-to-one.%20**Next%3A**%20%5B31_share_round.py%5D(%2F%3Ffile%3D31_share_round.py).%0A%20%20%20%20%22%22%22)%2C%20kind%3D%22success%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20course.quizzes_at(%225.1%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
550299abec514cf67cd4115d43954b78