Image Credit: “Via Design Pickle” — More on attributions.

Member-only story

State Name To State Abbreviation Crosswalks

For the millionth time I’ve had to crosswalk state names to state abbreviations.

Adam Ross Nelson
2 min readJan 29, 2020

--

Overview

As a data scientist, researcher, or data practitioner of any sort you have or will eventually have a dataset that lists state names. But, you’re going to need the state abbreviation. Or maybe it is the other way around.

For beginners, or even for intermediate data wonks, this can be a tricky and cumbersome task. I’m taking a moment to share a quick (and easily applied in many use cases) hack that solves this problem.

Output from the above code. Image Credit: “Author’s Screen Capture” — More on attributions.

Cautions

  • This code will only work as long as the good clerk of courts in charge of clerk.org keeps the html table in place. Also that this table remains the first table available from the specified location.
  • This code will only work if the table at…

--

--

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

Adam Ross Nelson
Adam Ross Nelson

Written by Adam Ross Nelson

Ask about my free career course. I mentor new (💫) and aspiring data scientists enter (🚪) and level up (📈) in the field.

Responses (1)