In my previous article I explained how young startups can easily utilize their data without the need to hire a Data Analyst. Data can help you in your decision making even when your database is of a modest size. In this article, I will guide through a simple geographical visualization of your customer base that you can code in a few minutes, and can be used for Sales and Marketing decision making.
Getting the Data
I have used a mock data for GROM’s customer base within the APAC region. Data extraction and storage depends on your database infrastructure. In this example, I extracted the location for each order in the prescription data and stored it in an Excel file. I used Pandas library on Python to read the data into a dataframe.
Sorting the Data
If your data is of modest size, it’s easier to manually clean it on the Excel file. Otherwise, use python for data cleaning. To obtain the number of orders in each city, I used the pivot table function to group the data by city and created a new dataframe.
Adding Longitude and Latitude for each City
This code uses Basemap which requires longitude and latitude values for each location. I used Geopy’s geolocator to create longitude and latitude values for each city and append them in the dataset under new columns.
Creating and Plotting Basemap Figure
To geographically visualize the data, I created a scatter plot of the longitude and latitude values of each city on a world map and changed the size of each scatter according to the number of orders.
This visualization gives a rough image of where our customers are based and to what extent they contribute in the total order volume. It can be used for decision making particularly for Sales and Marketing. Should we allocate more resources in emerging markets to increase the volume or in current markets to decrease churn? Is it worth putting in time and money in smaller, isolated markets like Mongolia? Is it the right time to enter completely new markets like Australia?
At GROM, we listen to our gut, and verify with data. Perhaps, that’s why we have observed up to 172% YoY growth over the past year. This approach does not prevent you from making mistakes, but it certainly makes the uncertain journey of any startup more certain.