Twitter and Tesla Employee Political Candidate Donations

Which political candidates received the most amount of money from Twitter and Tesla employees?

A look into Twitter and Tesla employee political candidate contributions. The data comes from Federal Election Commission and covers election cycles 2016, 2018, 2020, and 2022. Click on Tree Maps below for full size.
Box Size = Money
Color = Party (Democrat vs Republican)

Denver Cocaine 2017 – 2022

A look into city and county of Denver’s cocaine criminal offenses. The data is based on the National Incident Based Reporting System (NIBRS). The data is collected by The Denver Police Department, and spans from January 2017 through August 2022. The data source can be accessed at www.denvergov.org. Click on images below for full resolution.

Offense Category of drug-alcohol

Offense Type containing cocaine. (drug-cocaine-possess and drug-cocaine-sell)

Offense Type drug-cocaine-possess vs. drug-cocaine-sell

The Spread of ShotSpotter in Chicago 2017 – 2022

ShotSpotter is gunshot detection technology that uses sophisticated acoustic sensors to detect, locate and alert law enforcement agencies and security personnel about illegal gunfire incidents in real-time. ShotSpotter uses acoustic sensors that are strategically placed in an array of approximately 20 sensors per square mile. These sensors are connected wirelessly to ShotSpotter’s centralized, cloud-based application to reliably detect and accurately triangulate gunshots.

Data is from https://data.cityofchicago.org/Public-Safety/Violence-Reduction-Shotspotter-Alerts/3h7q-7mdb. CARTO was used to create animated map of ShotSpotter alerts.

   

Chicago ShotSpotter coverage as of 7/17/2022

Chicago Victims of Homicides and Non-Fatal Shootings 2010 – 2022

A look into Chicago’s individual-level homicide and non-fatal shooting victimizations. The dataset was published on the Chicago Data Portal and comes from the Chicago Police Department (CPD). Accessed 7/4/2022. Click on larger visualizations for full size. Carto and Google Charts were used.

12 years of shootings..

Victims by race..

Daily Counts

Aggregates by Month, Day of Week, and Hour of Day. 2010 – 2022..
Summer months accrue the most shootings. Suns out guns out.

Most shootings happen over the weekends.

Night time is the most popular time for a shooting.

Age Group..

Race..

Type..

Community..

Iowa’s Liquor Sale Maps and Visualizations 2020

A look into Iowa’s liquor sales for the last 2.5 years. Time spans from January 2018 through June 2020. The data can be found at data.iowa.gov. Click on images below to enlarge.

Distinct Coordinate by Volume Sold (Liters)

Pandemic Upswing

Top Bottle Sold by Distinct Location

Top Bottle

Top Category Per Distinct Location

C# Console Application was used to parse, aggregate, and output the data into desired structure for Google Charts and Carto. The script below can be used as a reference if you would like to investigate Iowa’s liquor sale data yourself. Note that this particular script will only output the data source of the last map in this post (Top Category Per Distinct Location sized by Bottles Sold).

using CsvHelper;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
 
namespace IowaSpirits2018plus
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Iowa Spirits..");
            Console.BufferHeight = 4000;
            Dictionary<string, Dictionary<string, int>> dictCoord_Item_Count = new Dictionary<string, Dictionary<string, int>>();
            string lastdate = "";
            using (var reader = new StreamReader("C:\\IOWASPIRITS\\iowaspirits2018plus.csv"))
            using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
            {
                csv.Read();
                csv.ReadHeader();
                while (csv.Read())
                {
                    string date = csv.GetField("Date").ToString();
                    if ( lastdate != date)
                        Console.WriteLine(date);
                    lastdate = date;
                    DateTime fDate = csv.GetField("Date");
                    string city = csv.GetField("City").ToString();
                    string categoryName = csv.GetField("Category Name").ToString();
                    string bottlesSold = csv.GetField("Bottles Sold").ToString();
                    int iBottlesSold = int.Parse(csv.GetField("Bottles Sold").ToString());
                    string litersSold = csv.GetField("Volume Sold (Liters)").ToString();
                    string itemDescription = csv.GetField("Item Description").ToString();
                    string storelocation = csv.GetField("Store Location").ToString();
                    storelocation = Regex.Replace(storelocation, "POINT \\(", "");
                    storelocation = Regex.Replace(storelocation, "\\)", "");
                    storelocation = Regex.Replace(storelocation, " ", ",");
 
                    if (dictCoord_Item_Count.ContainsKey(storelocation))
                    {
                        Dictionary&lt;string, int&gt; existingDict = new Dictionary&lt;string, int&gt;();
                        existingDict = dictCoord_Item_Count[storelocation];
                        if (existingDict.ContainsKey(categoryName))
                        {
                            int existingBottleSold = existingDict[categoryName];
                            existingBottleSold += iBottlesSold;
                            existingDict[categoryName] = existingBottleSold;
                        }
                        else
                        {
                            existingDict.Add(categoryName, iBottlesSold);
                        }
                        dictCoord_Item_Count[storelocation] = existingDict;
                    }
                    else
                    {
                        Dictionary&lt;string, int&gt; tempDictItemCount = new Dictionary&lt;string, int&gt;();
                        tempDictItemCount.Add(categoryName, iBottlesSold);
                        dictCoord_Item_Count.Add(storelocation, tempDictItemCount);
                    }
                }
            }
            foreach ( string parent_key in dictCoord_Item_Count.Keys)
            {
                Console.Write(parent_key + ",");
                foreach (var item in dictCoord_Item_Count[parent_key].OrderByDescending(r =&gt; r.Value))
                {
                    Console.Write("{0}, {1}", item.Key, item.Value);
                    break;
                }
                Console.WriteLine();
            }
        }
    }
}