Skip to content

Instantly share code, notes, and snippets.

@bkamapantula
bkamapantula / colorbrewer.css
Last active August 29, 2015 14:28
Women MPs - India 2015 | State-wise
.Blues .q0-3{fill:rgb(222,235,247)}
.Blues .q1-3{fill:rgb(158,202,225)}
.Blues .q2-3{fill:rgb(49,130,189)}
.Blues .q0-4{fill:rgb(239,243,255)}
.Blues .q1-4{fill:rgb(189,215,231)}
.Blues .q2-4{fill:rgb(107,174,214)}
.Blues .q3-4{fill:rgb(33,113,181)}
.Blues .q0-5{fill:rgb(239,243,255)}
.Blues .q1-5{fill:rgb(189,215,231)}
.Blues .q2-5{fill:rgb(107,174,214)}
@bkamapantula
bkamapantula / README.md
Last active August 29, 2015 14:28
State-wise Women MP and MLA % in 2015 - India

Women representation in Indian parliament and respective state legislative assemblies

  • Only 8 states have higher than average women MP %
  • 12 states have 0 women MPs
  • 3 states have 0 women MLAs
  • Only 3 out of 31 states/UTs have both higher women MP and MLA representation than the national average
@bkamapantula
bkamapantula / README.md
Last active April 26, 2019 14:34
Changing patterns in women MLAs (1955-2014)

Change in women MLAs in Indian states across the years

  • Chart depicts the % change in women MLAs in consecutive state assembly elections.
  • Lack of bars suggests that there is no change in number of MLAs.
  • Every Member of Legislative Assembly (MLA) is elected by people in respective constituency.
  • Election data for all the states for 1971 is not segregated by gender by ECI (Election Commission of India). Hence, missing from the analysis here.
@bkamapantula
bkamapantula / boxplot.py
Created October 19, 2014 18:24
Boxplot in python using pandas, matplotlib | Vary position of figure
import pandas as pd
import matplotlib.pyplot as plt
import sys
import os
import matplotlib as mpl
pd.options.display.mpl_style = 'default'
def box_plot():
f = open(sys.argv[1], "r")
@bkamapantula
bkamapantula / iframe-timeline.html
Created October 11, 2014 13:49
#NEFloodRelief iframe code
<iframe src='http://cdn.knightlab.com/libs/timeline/latest/embed/index.html?source=156VN0Il9WKGkw7b8gqtiD0J20M_E6EZLVmT4WLkNmcs&font=Bevan-PotanoSans&maptype=toner&lang=en&height=650' width='100%' height='650' frameborder='0'></iframe>
@bkamapantula
bkamapantula / plot_two_series.py
Created August 2, 2014 18:19
matplotlib plot - two data series
"""
Input
======
input text file considered here contains 3 columns.
"""
import matplotlib as mpl
import matplotlib.pyplot as plt
import sys
import os
@bkamapantula
bkamapantula / asps.py
Last active August 29, 2015 14:04
finding structural properties of a network
import networkx as nx
from operator import itemgetter
import sys
import os
import csv
import numpy as np
import math
def build_graph():
@bkamapantula
bkamapantula / input-mirnas.txt
Created June 19, 2014 18:15
list of miRNAs for miRNA-disease interaction network visualization tool
miRNAs can be comma separated or new-line separated or tab separated
1) hsa-mir-200a, hsa-mir-34a, hsa-mir-21
2) hsa-mir-9-1, hsa-mir-9-2, hsa-mir-200c
3) hsa-mir-9-1, hsa-mir-9-2, hsa-mir-34a, hsa-mir-200c
@bkamapantula
bkamapantula / script.tcl
Last active August 29, 2015 13:58
Example that shows flooding routing using CBR traffic and UDP agent
# doesn't work as expected
# Create a simulator
set ns [new Simulator]
set MESSAGE_PORT 42
# reads the first nine command line arguments
set loss_rate [lindex $argv 0]
set sink [lindex $argv 1]
@bkamapantula
bkamapantula / flooding.tcl
Last active August 29, 2015 13:58
Example flooding protocol in a wired network
# Create a simulator
set ns [new Simulator]
set MESSAGE_PORT 42
set loss_rate [lindex $argv 0]
set sink [lindex $argv 1]
set input_file [lindex $argv 2]
set num_nodes [lindex $argv 3]
set linktype [lindex $argv 4]