Skip to content

Instantly share code, notes, and snippets.

@sujeetpillai
sujeetpillai / shuffle_list.py
Created March 18, 2015 17:04
Shuffling a list
lis = [k for k in "abcdefghijklmnopqrstuvwxyz"]
shuffled_temp_lis = sorted(enumerate(lis),key=lambda x:(x[0] % (len(lis)/2))*2+(x[0]/(len(lis)/2)))
shuffled_lis = [k[1] for k in shuffled_temp_lis]
@sujeetpillai
sujeetpillai / free_water.py
Created December 30, 2013 21:13
A simple randomized python model on the Free Water Scheme announced by the AAP in Delhi. Back calculated the mean usage as 16 units and Standard deviation as 4 units to reach a cost impact of 166 Cr between the schemes.
import numpy
import matplotlib.pylab as plt
__author__ = 'sujeet'
# Define Constants
METERED_CONNECTIONS = 900000
TOTAL_CONNECTIONS = 1800000
TOTAL_HOUSEHOLDS = 5000000