Alabama 2022 Block to Precinct Assignment Estimates Using April 2023 Voterfile ## RDH Date Retrieval Voterfile from 04/03/2023 Processed June 2023 ## Sources L2 (https://l2-data.com/datamapping/) ## Fields: Field Name Description geoid20 Census Block Identifier best_prec Best precinct assignment (most common precinct assignment among voters geocoded to this block) unq_precs Number of unique precincts for which voters geocoded to the block have listed matched_precs Count of voters for each precinct for which voters geocoded to this block have as an assignment ## Processing Steps Load in a geocoded voterfile. Remove voters without a precinct assignment and those for which the county of the geocoded block does not match the county tied to their record (2,443 individuals). Append the 3-digit County FIPs to the precinct name. Group the voterfile by block geoid20, recording all the different precinct names, and the number of times they occur, for every individual geocoded to a particular block. For every block, iterate over the precinct names and counts values and assign the "best_prec" to the precinct that occurs most frequently. Ties are broken by using the first occurring precinct. For example, if there are three voters geocoded to block 1001 and two of these voters have "Precinct A" as an assignment and one voter has "Precinct B" as an assignment, "Precinct A" would be the best assignment, "unq_precs" would be 2, and "matched_precs" would be {"Precinct A":2, "Precinct B":1}. Add in remaining block geoid20s for the state, fill other fields for these blocks as "NO VOTERS IN VOTERFILE". Clean column names and export to csv. Visit the RDH GitHub and the processing script for this code [here](https://github.com/nonpartisan-redistricting-datahub/Processing-Requests) ## Additional Notes Blocks which contain no geocoded individuals from the voter file are marked "NO VOTERS IN VOTERFILE" for the "best_prec", "unq_precs", and "prec_count" fields. Please direct questions related to processing this dataset to info@redistrictingdatahub.org.