What is the relation between the SC population and SC literacy?

TL;DR: Nothing (that I could find)

After I published a set of maps, one thing that people (including me) wondered is

What is the relationship between the population size of SC community and their literacy? Are those regions, doing better, do it because the SC are more in number and are able to assert themselves better in the society?

This post is aimed at answering that question based on the Census 2011 data available from Tamilnadu Government website: http://www.tn.gov.in/deptst/areaandpopulation.pdf

The following data points were used:
1. Total population
2. Overall Literacy
3. Total SC population
4. SC Literacy

  • The gap between Overall literacy rate and SC literacy was calculated
  • The percentage of SC population was calculated
  • Finally, the correlation coefficient between the SC percentage and Literacy Gap was calculated


There is a very week (0.13) or almost no correlation between the strength of the SC population of in society and their literacy gap. Here are the maps for comparison

You might be thinking, forget the gap, maybe there is a correlation between their literacy and population number.


Nope. Still nothing. Here are the maps to compare.

Literacy Gap of SC community in TN districts

I was going through the Census 2011 data once again and Erode district’s low Schedule Caste (SC) literacy rate caught my eyes. It is not a very lagging state when in overall literacy. But its SC literacy was less than the least literate district of Dharmapuri. So I added the data to the TN Districts shapefile and visualised it to see how lagging are the SC community across the districts.

Here are the maps



In an earlier map, the gap of Thoothukudi was mentioned as -14%, while the actual gap is around 6% due to a typo during the data processing. The map has been updated to reflect the change.

My observations

  1. Kongu Belt (Coimbatore, Tiruppur, Erode) is the worst. ~~The Gounder (land owning) community has ensured their position and the social ladder and ensured the peasantry remained uneducated and illiterate.~~

Update: While there might be an element of truth to it, the maps alone are not indicative of the inference. I have made the above observation based on the number of issue that have appeared on the media like the Mid-day meal staff harassment, two tumbler system etc.,

  1. Dharmapuri is a peculiar case, it has the lowest overall literacy in TN, but it is also the only district where SC community is more literate than the general population.
  2. Kanniyakumari which tops the overall literacy rates also tops the SC literacy. In fact the SC community of Kanniyakumari is more literate than the general population of almost all other districts. I think it would be an interesting place of humanities research in the area of literacy, education and caste.

Data Source:


QGIS – Creating new column from existing using Python

Yesterday, I was working on the ward level parks map of Chennai I had to join a CSV data layer with the boundary polygon layer, but there was one issue while my CSV file has the ward numbers as integers (1,2,3..etc), the polygon layer had them as strings (Ward 1, Ward 2, Ward 3 …etc.,) So I was thinking, wouldn’t it be nice just to strip the word Ward and put it in a new column, so that I can make a join by matching the ward numbers. Turns out Python integration in QGIS is so good that, I did it without even searching the internet. Here is how.

  1. Open the Attribute table
  2. Open Field Calculator.
  3. Enter the “Output field name”
  4. Switch to “Function Editor”
  5. Click the [+] button to create a new function file.
  6. Changed the function name, parameter and return the value after stripping “Ward ” from the string. Read the docs given below the function editor to understand what’s going on the file.
QGIS Field Calculator
QGIS Field Calculator
from qgis.core import *
from qgis.gui import *

@qgsfunction(args='auto', group='Custom')
def strip_ward(name, feature, parent ):
    return name.split(" ")[-1]

Now switch back to the Expression tab and call the function to calculate the new field


Click OK. Now the new field with the computed value would be created.

I had a simple use case, by one can use the power of Python to calculate anything from existing data and generate a new field based on it. I was really blown away by the level of Python integration in QGIS.

India Literacy Map with a How-To

I published the Tamilnadu district wise literacy map some days ago and @tshrinivasan asked if I can write a blog on how to do it, and here it is now.

What are we going to do?

We are going to create India’s State Wise Literacy Map. It will be a Choropleth map ℹ️ just like the Tamilnadu one.

Things we need

  1. QGIS – An Open Source software that will be used to process the geographic data and create the map. Download and install it from https://qgis.org/ for your operating system.
  2. Base map – The digital map of India with its state boundaries as a shapefile. ℹ️ You search the internet for “India states shapefile”, there are a number of sources where you can find this. I am going to use the one from the Hindustan Times public repository. [shapefiles/india/state_ut/india_2000-2014_state.zip] ⬇️Download, Unzip the file and keep it ready. I am choosing the pre-Telangana map because the literacy data is from 2011 which is pre-Telangana.
  3. Data on literacy levels of the Indian states. An internet search for “India states literacy csv” would give a number of results. I am going to use the one from the Census 2011 website. ⬇️Download

Get the data ready

We have 2 sources of data:

  1. Geographic data which we downloaded from the Hindustan Times
  2. The Literacy data from the Census 2011 website

Both the datasets need to be joined to create the map. Let us do that:

  1. Open QGIS and create a new project. From menu select Project -> New Project
  2. Add the map using Layer -> Add Layer -> Add Vector Layer. Browse to the location of the downloaded shapefile, select the india_2000-2014_state.shp file and click Add. Add_layer
  3. You will be asked to select the coordinate system. Select WGS84 and click OK. Once the layer is added close the Add layer button. Select CRS
  4. Now you should have the map loaded to the main area, and should see the legend entry for the data layer like this. Base Map added
  5. Now right click on the layer and select Open Attribute TableOpen Attribute Table.png
  6. You will notice it has only two columns – the id and the state name. We are going to create a new column and add the literacy rates from the census data. In the Attribute Table, click the yellow pencil icon (first one in the icon bar) to start editing.
  7. Click the Add Column button and add the literacy column with type decimal. Add_columnliteracy column
  8. Now enter the literacy rates from the excel sheet into the newly added column. Sidenote: There is an automated way to combine the data without having to manually enter the data if you have the data in a delimited text file like CSV. It involves adding a something called a Data Layer. We will take the manual route to keep it simple.
  9. Once you have added the literacy values. Click Save Edits icon (Ctrl+s).  Now click the “Yellow Pencil” button again to stop editing. This is very important. Otherwise, you might unknowingly click at some place and change the geometry of the state boundaries.
  10. Now you should have the data in the attribute table like this. Attribute Table with Literacy.png
  11. Close the Attribute Table.

Styling the map

  1. In the Layers sidebar right click on the map layer and select Properties.
  2. In the Properties window, select Symbology from the side menu. Layer Properties.png
  3. In the Styling window make the following changes. Styling.png
    1. A – Change the style from “Single Symbol” to Graduated
    2. B – Select “literacy” as the column
    3. C – Set Precision to your liking (it denotes the decimal points of the values to be shown in the map legend). I prefer 0 or 1 usually.
    4. D – Choose a Color Ramp to your liking. I am choosing the one suitable for Wikipedia based on the Wikipedia Conventions.
    5. E – Set the mode to “Pretty Breaks”. Now as soon as you select this, the “Classes” tab right above it should be populated automatically. If not, use F.
    6. F – If your classes didn’t appear automatically, click the “Classify” button.
  4. Once you are satisfied with the Legend precision and the color ramp, click OK to see your styled Choropleth map. styled map.png

Note: The properties dialog provides a huge number of options to do a number of things including labels. Refer to a QGIS manual or tutorials on the web for related information.

Exporting the map

Now we have the styled map according to our liking ready. We need to export it to an image so that we can share it across.

  1. Click the “New Print Layout” button. Enter a name, I named mine “export” and click ok.new print layout
  2. You will get the Layout window with an empty page. empty print layout.png
  3. From the menu, select Add Item -> Add map. Click and drag the cursor to the required size. map inserted.png
  4. (Optional) There is a lot of white space around the map inside the box. We can make the map a little bigger by reducing the scale. On the right side switch to the Item Properties tab and reduce the value for Scale. (Mine was 17485874 and I changed it to 12500000). rescaled map.png
  5. Click Add Item -> Add Legend. Click and drag the cursor to create the Legend. India’s maps usually use the Bay of Bengal for that, I am going to do the same. Legend Added.png
  6. You will notice that the legend title says the layer name. But what we really want it to say is “Literacy Rate”. There are two ways to fix that. Choose the one that appeals to you.
    1. On the right in the Item Properties tab, under Main Properties, you can enter a title as “Literacy Rate”
    2. On the right in the Item Properties tab, under  Legend Items, double-click on the layer name and enter “Literacy Rate”
  7. Now there is some extra white space on the right. Let us clean that up. On the right side select Layout tab, scroll down to Resize Layout to content and click Resize Layout. Now the page should have been resized to only the map. cropped to content.png
  8. From menu click Layout -> Export as Image. Enter the filename in your desired location and save it. You could also export as PDF if you want to print.

Note: Apart from just the map and legend you can do a lot more complex things with the layout manager. Again, refer to a QGIS manual and other tutorials on the internet to fully learn about them.

Final Product


Updating the Wikipedia Tamilnadu Literacy Map

On 16th October 2011, I have uploaded a map of Tamilnadu District wise Literacy levels to Wikipedia. It was used in the article about Tamilnadu for a long time, then moved to the Education in Tamilnadu article when a separate article was created. But the map was not in line with the Wikipedia Map Conventions. So, took some time this week and updated the map.

Updated Version


Older version


A Map of the Chetpet Lake and Eco Park

Chetpet Lake has been developed into a nice waterfront park for walking a few years back. It is maintained diligently with water level balanced between the two parts of the lake depending on the availability, grass moved, plants cared for and the walkways washed off the bird droppings everyday morning. It opens for walkers as early as 4.30 in the morning every day. It is one of the places in Chennai, that I have walked into and really felt peaceful.

It has boating, children’s play area, angling points, 3D theatre, multilevel car park, and a food court. It is well connected by public transport. It has a bus stop, a railway station, and a metro station right outside its walls. But, it didn’t have a map. So, I downloaded a PDF from OpenStreetMap and created one which is now used in Chetput Lake Wikipedia article.


Gaja Relief & Disaster Management Numbers

Cyclone Gaja – this year’s natural disaster which has landed like a stab in the gut for Tamil Nadu.

… Cyclone Gaja is a major disaster, and its economic impact in Tamil Nadu is comparable to that of the tsunami of 2004.
The Hindu

After the disaster, the Tamil Nadu’s Chief Minister announced a relief package of 1000 Crores for the affected regions. Anyone who hasn’t worked on the Tamil Nadu’s budget for the current financial year wouldn’t be wrong to assume that Tamil Nadu’s disaster relief budget allocation would be greater than the said 1000 Crore. Logically it makes sense, to assume that the government is allocating a part of money kept aside for the purpose. But not in this case, Tamil Nadu has a total allocation of 786 Crores for disaster relief. [Reference: Tamil Nadu Budget 2018-19 Couldn’t find the English version]


Then the CM requested additional 15,000 crores from the Union Government. Now a little bit about the disaster relief funds from the central government. There are two types of funds SDRF (State Disaster Relief Fund) that the union government transfers to the state governments to build the state corpus and NDRF (National Disaster Relief Fund) that the central government uses to provide immediate and temporary relief in case of a national emergency. Here is the relevant page from the union budget.

SDRF = 9382.8 Crores + NDRF = 3660.0 Crores

  • SDRF = 9382.8 Crores
  • NDRF = 3660.0 Crores
  • Total allocation in the budget for the entire country = 13,042.8 Crores

The reality that the numbers tell us is that, with the NDRF size of 3,660 crores and 30 states in the union, it is foolish to expect anything more than 120 to 150 Crores from the central government as disaster relief. Remember, this is the year multiple states like Kerala and Mizoram have already experienced disasters like floods. Put together the NDRF allocation TN will probably get and the entire allocation of TN disaster fund gives us a sum of 150+786 = 936 crores.

The number begs the question – Are the leaders in Tamil Nadu really numerate? Do they even fathom the numbers they are spouting to us in the public? Why would a CM ask for an amount that is bigger than the total union budget (for disaster relief) if he understands fiscal management? Is there no one on the bureaucracy who understands it too?

As a defense one could say, the difference between the available funds in the budget and the relief expenditure would be borrowed now and settled later by the government. But it is hard to buy that defense. [Update 1]

When there is a genuine way to actually tell the public about the available funds (786 crores) and informing us that 100% of the year’s budget would go to the 11 affected districts and extra funds would be requested from the center, the people in power are quoting random imaginary numbers which they could later serve to serve their own purposes. I wish our media would do this research and ask the hard questions that need to be asked, rather than praising the volunteers.

Update 1:

I thought I would add the rationale to validate why the government won’t be borrowing more money for disaster relief.

  1. The biggest expenditure in the union budget is Interest payment. We have so much debt that 23.58% of the entire budget (or 1/4th) goes into just interest payments.
  2. India is already struggling to meet its fiscal deficit target. Borrowing more is only going to worsen the situation.

So, in practical terms, the argument that govt would somehow find money to finance the disaster relief is void.

Update 2:

The central government has announced a relief package of 353.7 crores for Tamilnadu from the SDRF. This is slightly higher than the amount the union govt should have given the TN govt anyway. SDRF fund 9382.8 shared between 29 states = 323.53 crores. To be clear, this is the amount which would have been given to Tamilnadu anyways. Here is the explanation from the budget document:allsbe_pdf__page_136_of_341_.png

Freelance Python Programmer