Gender Analysis in Indian Elections: Unveiling Trends and Insights

Kshitij Kutumbe
4 min readJul 6, 2024

--

Photo by Marius Oprea on Unsplash

In the dynamic landscape of Indian elections, gender representation has increasingly become a focal point of discussion and analysis. With a nation as diverse and populous as India, understanding the nuances of gender dynamics among electoral candidates offers valuable insights into the evolving political arena. This blog delves into the intricate patterns of gender participation in Indian elections, shedding light on how male and female candidates fare across different regions, parties, and election cycles.

As we navigate through the data, we will uncover trends that highlight the progress made towards gender equality in political representation, as well as the challenges that persist. From historical data to recent election results, this comprehensive analysis aims to provide a deeper understanding of the gender dimensions in Indian electoral politics. Join us as we explore the stories behind the numbers and the implications of these trends for the future of India’s democratic process.

Data credit: Ashoka University Data

import matplotlib.pyplot as plt

# Aggregating data to count the number of male and female candidates per year#
gender_distribution_per_year = df_gender.groupby(['Year', 'Sex']).size().unstack(fill_value=0)
# Plotting the data
gender_distribution_per_year.plot(kind='bar', figsize=(14, 7), width=0.8)
#px.bar(gender_distribution_per_year,y='total', color='Sex', barmode='relative',)
plt.title('Gender Distribution of Political Candidates Over Years')
plt.xlabel('Year')
plt.ylabel('Number of Candidates')
plt.legend(title='Gender')
plt.xticks(rotation=45)
plt.tight_layout()

# Show the plot
plt.show()
import matplotlib.pyplot as plt

# Plotting
fig, ax1 = plt.subplots(figsize=(14, 8))

color = 'tab:red'
ax1.set_xlabel('Year')
ax1.set_ylabel('Number of Candidates', color=color)
ax1.plot(gender_distribution['Year'], gender_distribution['MALE'], label='Male', color='blue')
ax1.plot(gender_distribution['Year'], gender_distribution['FEMALE'], label='Female', color='red')
ax1.tick_params(axis='y', labelcolor=color)
ax1.legend(loc='upper left')

ax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis

color = 'tab:green'
ax2.set_ylabel('Percentage of Female Candidates', color=color) # we already handled the x-label with ax1
percentage_female = (gender_distribution['FEMALE'] / (gender_distribution['MALE'] + gender_distribution['FEMALE'])) * 100
ax2.plot(gender_distribution['Year'], percentage_female, label='Percentage of Female Candidates', color=color)
ax2.tick_params(axis='y', labelcolor=color)
ax2.legend(loc='upper right')

fig.tight_layout() # otherwise the right y-label is slightly clipped
plt.title('Gender Distribution of Candidates Over the Years')
plt.show()

POLITICAL PARTY BASED ANALYSIS:

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

# Load the data
data_path = 'ge_cleaned.csv'
ge_data = pd.read_csv(data_path)

# Filter data for the years 2009, 2014, and 2019
years_of_interest = [2009, 2014, 2019]
filtered_data = ge_data[ge_data['Year'].isin(years_of_interest)]

# Focus on the relevant columns for analysis
relevant_data = filtered_data[['Year', 'State_Name', 'Party', 'Sex']]

# Count the number of female candidates fielded by each party for the specified years
female_candidates_by_party = relevant_data[relevant_data['Sex'] == 'FEMALE'].groupby(['Year', 'Party']).size().unstack(fill_value=0)

# Calculate the total number of female candidates each party has fielded across the years
total_female_candidates_by_party = female_candidates_by_party.sum(axis=0).sort_values(ascending=False)

# Display the top 5 parties that have fielded the most female candidates
top_parties_for_female_candidates = total_female_candidates_by_party.head(5)

# Count the number of female candidates fielded in each state per year
female_candidates_by_state = relevant_data[relevant_data['Sex'] == 'FEMALE'].groupby(['Year', 'State_Name']).size().unstack(fill_value=0)

# Calculate the change in number of female candidates between each year to identify progress
progress_2009_to_2014 = female_candidates_by_state.loc[2014] - female_candidates_by_state.loc[2009]
progress_2014_to_2019 = female_candidates_by_state.loc[2019] - female_candidates_by_state.loc[2014]

# Sum the progress to identify overall progress from 2009 to 2019
total_progress_by_state = progress_2009_to_2014 + progress_2014_to_2019

# Sort the states by their overall progress in fielding more female candidates
states_with_most_progress = total_progress_by_state.sort_values(ascending=False).head(5)

# Set the aesthetics for the plots
sns.set(style="whitegrid")

# Bar plot for top 5 parties fielding women candidates
plt.figure(figsize=(10, 6))
top_parties_for_female_candidates.plot(kind='bar', color='skyblue')
plt.title('Top 5 Political Parties by Number of Women Candidates (2009, 2014, 2019)')
plt.xlabel('Political Party')
plt.ylabel('Number of Women Candidates')
plt.xticks(rotation=45)
plt.show()

STATE BASED ANALYSIS:

# Extract the number of female candidates fielded in the top 3 states for each year
female_candidates_top_states = female_candidates_by_state[states_with_most_progress.index]

# Line plot for the progress in top 3 states
plt.figure(figsize=(12, 7))
for state in female_candidates_top_states.columns:
plt.plot(female_candidates_top_states[state], label=state.replace('_', ' '), marker='o')

plt.title('Progress in Fielding Women Candidates in Top 3 States (2009, 2014, 2019)')
plt.xlabel('Year')
plt.ylabel('Number of Women Candidates')
plt.legend(title='State')
plt.xticks(female_candidates_top_states.index)
plt.grid(True)
plt.show()

Our exploration of gender dynamics in Indian elections reveals both strides forward and areas requiring continued effort. While the data shows an encouraging increase in the participation of female candidates over the years, it also highlights the persistent gender disparities that still exist.

The analysis underscores the importance of policy interventions and societal changes to promote gender equality in political representation. Initiatives aimed at empowering women, coupled with systemic reforms, can pave the way for a more inclusive and representative political landscape.

--

--

Kshitij Kutumbe
Kshitij Kutumbe

Written by Kshitij Kutumbe

Data Scientist | NLP | GenAI | RAG | AI agents | Knowledge Graph | Neo4j kshitijkutumbe@gmail.com www.linkedin.com/in/kshitijkutumbe/

No responses yet