Skip to content

Instantly share code, notes, and snippets.

View nipunbatra's full-sized avatar

Nipun Batra nipunbatra

View GitHub Profile
@joshwentz
joshwentz / energyplus.sh
Last active December 20, 2015 23:48
install energyplus onto an ubuntu 12.04 linux server
#Open Terminal & move to where you want to install
#Install git: sudo apt-get install git-core
#git clone https://gist.github.com/6214690.git
#cd 6214690/
#sh energyplus.sh
#Download EnergyPlus
sudo wget http://developer.nrel.gov/downloads/buildings/energyplus/builds/EnergyPlus-7.2.0.006-Linux-64.tar.gz
sudo tar xzf EnergyPlus-7.2.0.006-Linux-64.tar.gz
find EnergyPlus-7-2-0-006/bin/ -type f -perm -o+rx;
@damianavila
damianavila / remove_output.py
Created April 3, 2013 22:05
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write
@jiffyclub
jiffyclub / markdown_doc
Last active August 1, 2023 11:16
This script turns Markdown into HTML using the Python markdown library and wraps the result in a complete HTML document with default Bootstrap styling so that it's immediately printable. Requires the python libraries jinja2, markdown, and mdx_smartypants.
#!/usr/bin/env python
import argparse
import sys
import jinja2
import markdown
TEMPLATE = """<!DOCTYPE html>
<html>
@elsonidoq
elsonidoq / gist:4230222
Created December 7, 2012 02:21
Python implementation of mutual information for continuous variables
from math import log
log2= lambda x:log(x,2)
from scipy import histogram, digitize, stats, mean, std
from collections import defaultdict
def mutual_information(x,y):
return entropy(y) - conditional_entropy(x,y)
def conditional_entropy(x, y):
"""
@drewda
drewda / gist:1299198
Created October 19, 2011 18:23
Jenks natural breaks classification
# code from http://danieljlewis.org/files/2010/06/Jenks.pdf
# described at http://danieljlewis.org/2010/06/07/jenks-natural-breaks-algorithm-in-python/
def getJenksBreaks( dataList, numClass ):
dataList.sort()
mat1 = []
for i in range(0,len(dataList)+1):
temp = []
for j in range(0,numClass+1):
temp.append(0)
@fonnesbeck
fonnesbeck / hmm.py
Created March 25, 2010 00:01
Hidden Markov model in PyMC
import numpy as np
import pymc
import pdb
def unconditionalProbability(Ptrans):
"""Compute the unconditional probability for the states of a
Markov chain."""
m = Ptrans.shape[0]