CitySpire: Finding the Right City for You

What is CitySpire

Palmer Turley
3 min readMar 4, 2021

There are many people that want to move to a certain city, but first they want to know everything they can about that city. Others are just looking for a fresh start in any city but aren’t sure where to go. CitySpire seeks to help these people. The CitySpire website is designed to help people look at many fields of information about a city all in one place. This also makes it easy to compare and contrast multiple cities all at the same time.

This is not an easy task to accomplish because, as anyone who has done this themselves can attest, the data can be rather hard to dig through. It’s spread out over dozens of websites each with their own set of challenges.

I spent the last few weeks working with a team of developers at Lambda School creating this product. I worked on the Data Science end of the team; finding, cleaning, and modeling the data. More specifically, I was responsible for data regarding average rent per city and air quality. My team members and I built an API using Python’s FastAPI to feed data to our web and iOS developers. We deployed our data and API using AWS’s RDS and Elastic Beanstalk, respectively. The API has simple endpoints that query our data base and return data to the back end for web and iOS.

Data Cleaning

The biggest challenge on the Data Science side was finding viable data. As mentioned above, the data had to be found across many different websites and they didn’t always use the same nomenclature for the cities (i.e. New York vs New York City). Some data sources even grouped cities into larger metropolitan areas that had to be separated into individual cities such as Los Angeles, CA and Anaheim, CA or Dallas, TX and Fort Worth, TX.

It’s very important to have data that is uniform across the entire data base so it was imperative that we come up with a solution. One solution would be to use Pandas built in function for data frames: df.explode(). I could have separated the cities into a list and called that function, but that posed another problem as well. I needed to keep the state names too. In some instances the cities were grouped across multiple states which made the task all the more difficult.

The solution I went with was to separate them by hand. This was optimal for me because we were only collecting data from the top 100 most populated cities so it was easiest to compare that list of cities with the data and make adjustments as needed. This was a long, tedious process but having uniform city names was very important.

Looking Into the Future

CitySpire has lots of room for improvement and perfection. With what short time we had, we made great progress. Users are able to create an account to store their favorite cities and browse numerous city data with an interactive map. Currently, users can find data for average rent, air quality, walkability, population, and crime rates. These data points are also standardized into a score from 1–5 so users see how the city ranks comparatively to others.

Additionally, users can rate these features on a scale from 1–10 based on their opinion of each data point’s importance. The API will return a weighted “quality of life” score for each city that is totally unique to each user.

Looking to the future of CitySpire, the quality of life score has great potential. There are many data points that can be added to make CitySpire more in depth. Examples include data for schools in the area, population density, cost of living, rent given specific parameters, entertainment and many more. Using machine learning models to project what these factors could look like in the future would be an excellent addition as well. With all these features added CitySpire would make it so easy to compare personalized quality of life scores and find the city that’s right for you.

--

--