Analysis of Code Violations in Fort Worth​​​​​​​
The code compliance data set lists code violations in the city of Fort Worth from the beginning of 2019 to 2020. The columns in this dataset include the type of violation, the date the violation was created, the officer who cited the violation, the address of the violation, as well as the latitude and longitude where the violation occurred. The types of violations include animal, health hazard, high grass/weeds, multi-family, property maintenance, recurring mow ticket, solid waste violation, substandard building, vehicle, and zoning.
Question 1: Which code violations are most common and least common?
I first sorted the data and grouped it by the type of complaint violation so I could see how many violations were in each category. I then sorted this into a strip plot from most common to least common, which you can see in Figure 7, to visualize the distribution.
Code violation definitions from City of Fort Worth:
Question 2: In which months are Health Hazard violations most common?
For my analysis, I wanted to dig deeper into the less common Health Hazards category. Health Hazards which include Water or Sewer Leaks, Stagnant Pool / Unwholesome Water, or No Water Service. I wanted to figure out which months of the year were the most common for Health Hazard violations.  I used the ‘to_datetime’ function to split ‘Violation Created Date’ column to generate a month/year column. I then sorted this data into a bar plot to visualize which months had the highest numbers of Health Hazard Violations.
Analysis: According to Figure 8, it seems that Health Hazard violations are the most common during the summer months, peaking in May 2019 and June and July of 2020. These violations seem to be the lowest during the months of November, January, and March. I think that the reason for this could be that people are more likely to use more water during and use their pools more often during Texas summers when temperatures rise to over 100 degrees. I’m not too familiar with the Fort Worth water service, but I assume that hotter temperatures could cause more problems with water service because of higher demand and other reasons. I think the reason this distribution fluctuates so much is because Texas weather is not consistent, sometimes reaching temperatures of 90 degrees in December. It seems as though there are always around 60 violations per month, but hotter temperatures tend to lead to more Health Hazard violations.
Question 3: Where are the Health Hazard violations located in Fort Worth? Are there any patterns present in this data? ​​​​​​​
In order to see how the Health Hazard code violations are spread across Fort Worth, I decided to use the custom design mapping studio, Mapbox, to create a heat map. I exported my Health Hazard data as a csv file to import into Mapbox and layered it onto a map of Fort Worth. Next, I converted the data into a heatmap so I could easily see where the violations were concentrated around Fort Worth. I changed the color of my heatmap to a colorblind safe color scheme, as the default heat map color scheme is not distinguishable for colorblind people. The link to my interactive map is here:
As you can see from Figure 9, the 1,896 Health Hazard violations are spread all across Fort Worth.
Analysis: When you zoom in more on the heat map, you can start to see where these clusters are concentrated. It seems that the Trinity River creates a buffer zone between two large clusters North and South of the river. This could be explained by less development in the floodplain of the river. The freeways tend to divide the clusters, which points to residential neighborhoods being the main source of clusters. Downtown Fort Worth has a lack of Health Hazard violations, which could also be explained by the hazards primarily being in neighborhoods.
 It is also notable that the biggest clusters are located in low-income neighborhoods, such as Como on the far-left cluster. If you zoom in on wealthy neighborhoods near country clubs, there are very few health hazard violations. I think this makes sense because poorer neighborhoods tend to be older and have more issues and the residents are less likely to pay to fix water problems. It is clear that Health Hazard violations are most commonly reported in low-income neighborhoods.
Back to Top