Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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):
"""
@elsonidoq
elsonidoq / grupos.ipynb
Last active November 9, 2020 14:28
Un algoritmo para armar grupos de estudio parejos
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@elsonidoq
elsonidoq / random_tateti_2.ipynb
Created September 14, 2020 18:01
Random tateti
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@elsonidoq
elsonidoq / random_tateti.ipynb
Created September 14, 2020 17:23
Random ta te ti
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
@elsonidoq
elsonidoq / find_dependencies.py
Last active November 28, 2016 03:56
Find dependencies of .so files on linux machines, and copies them on a specified directory. It is very simple, and does not have a nice heuristic for picking upon different versions of the same file. However, you can use the option --skip-patterns to add a comma sepparated list of strings that should not appear on the path of the file (you can f…
import shutil
from optparse import OptionParser
import sys
import functools
import re
import subprocess
import os
READELF = '/usr/bin/readelf'
def get_dependencies(fname, skip_patterns):
from time import time
import scipy
from scipy import stats
from math import sqrt
from multiprocessing import current_process
class Progress(object):
def __init__(self, tot=None, prefix=None,
template='sp: %(speed).02fi/s, pr: %(progress).02f%%, rt: %(remaining)s, it: %(iteration_time)s, %(cnt)s of %(tot)s, pt: %(process_time)s',
threaded_cnt= None, print_time=0.25, print_pid=False):
class mydefaultdict(dict):
def __init__(self, default, **kwargs):
super(mydefaultdict, self).__init__(**kwargs)
self.default = default
def __getitem__(self, item):
try:
return super(mydefaultdict, self).__getitem__(item)
except KeyError:
val = self.default(item)