Skip to content

Instantly share code, notes, and snippets.

View yoavram's full-sized avatar

Yoav Ram yoavram

View GitHub Profile
@yoavram
yoavram / betareg.py
Created January 30, 2018 22:11 — forked from brentp/betareg.py
beta regression in statsmodels
# -*- coding: utf-8 -*-
u"""
Beta regression for modeling rates and proportions.
References
----------
Grün, Bettina, Ioannis Kosmidis, and Achim Zeileis. Extended beta regression
in R: Shaken, stirred, mixed, and partitioned. No. 2011-22. Working Papers in
Economics and Statistics, 2011.
@yoavram
yoavram / Abbreviate Journal Names in Bibtex Database.py
Last active September 25, 2017 06:11 — forked from peci1/Abbreviate Journal Names in Bibtex Database.py
Using the translation table from the Jabref program, finds and replaces all scientific journal names to their standardized abbreviated form. First argument is the file to be processed; outputs safely to 'abbreviated.bib'
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys, os
import re
try:
bibtexdb = open(sys.argv[1]).read()
except IndexError:
print("Error: specify the file to be processed!")
@yoavram
yoavram / table2rst.py
Last active December 5, 2015 21:44 — forked from marianoguerra/table2rst.py
csv table 2 rst
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import csv
try:
import click
except ImportError as e:
print("Please install Click: http://click.pocoo.org")
sys.exit(1)
@yoavram
yoavram / lowess.py
Created August 26, 2015 06:03 — forked from agramfort/lowess.py
LOWESS : Locally weighted regression
"""
This module implements the Lowess function for nonparametric regression.
Functions:
lowess Fit a smooth nonparametric regression curve to a scatterplot.
For more information, see
William S. Cleveland: "Robust locally weighted regression and smoothing
scatterplots", Journal of the American Statistical Association, December 1979,
"""
This script produces a video analysis proving for the first time in history
that bacterial populations grow exponentially. See the result here:
http://i.imgur.com/uoITKiA.gif
We proceed as follows:
- Download a video of bacteria growing under a microscope.
- Cut the video to keep only the first 7 seconds.
- Threshold each frame to find where the bacteria are, and compute the
(function (ko, handlers, unwrap, extend) {
"use strict";
extend(handlers, {
href: {
update: function (element, valueAccessor) {
handlers.attr.update(element, function () {
return { href: valueAccessor() };
});
}
},