Skip to content

Instantly share code, notes, and snippets.

View yoavram's full-sized avatar

Yoav Ram yoavram

View GitHub Profile
@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 is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2013.9.2) 30 JAN 2014 13:00
entering extended mode
**recitation4.tex
(D:\university\CS1001.py\recitation4.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
@yoavram
yoavram / list-map-pool.py
Created February 3, 2014 21:19
Test the performance of pool.map from the multiprocessing module in comparison with standard map and list comprehension
# -*- coding: utf-8 -*-
import time
from multiprocessing import Pool
from scipy.integrate import quad
import numpy as np
from matplotlib.pyplot import *
from mpltools import style
style.use('ggplot')
def f(x):
@yoavram
yoavram / list-map-pool.py
Created February 3, 2014 21:19
Test the performance of pool.map from the multiprocessing module in comparison with standard map and list comprehension. See the result here: http://imgur.com/Fdm3URH.png - pool.map has some overhead , but as long as you pre-initialize it and perform over ~100 operations it is faster - here it is ~2-fold faster one 3 processors.
# -*- coding: utf-8 -*-
import time
from multiprocessing import Pool
from scipy.integrate import quad
import numpy as np
from matplotlib.pyplot import *
from mpltools import style
style.use('ggplot')
def f(x):

Keybase proof

I hereby claim:

  • I am yoavram on github.
  • I am yoavram (https://keybase.io/yoavram) on keybase.
  • I have a public key whose fingerprint is 0CBA E727 85C5 522B D07B 6BF4 1DB7 E474 FEA5 DD29

To claim this, I am signing this object:

(function (ko, handlers, unwrap, extend) {
"use strict";
extend(handlers, {
href: {
update: function (element, valueAccessor) {
handlers.attr.update(element, function () {
return { href: valueAccessor() };
});
}
},
"""
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
@yoavram
yoavram / anaconda_walkthourgh.md
Created February 5, 2015 05:57
A quick walkthrough on how to install Python using the Anaconda distribution

This is a quick walkthrough on how to install Python using the Anaconda distribution which is a very quick and easy way to install python together with the most common packages, including some that can be hard to install such as numpy and IPython.

  • Optional: uninstall current Python installation. Start from Control Panel\All Control Panel Items\Programs and Features, work your way through Python itself and any installer you used (probably from Gohlke's site).
  • Download the Anaconda Python installer (I got Anaconda-2.1.0-Windows-x86_64.exe)
  • Run the Anaconda installer
  • Go prepare a cup of coffee or clean up your mail inbox, install will take 10-20 minutes
  • Anaconda installed a default environment called root, if you know what this mean you can play around with new environments, if you don't forget about it (to play around with it look for the Anaconda launcher in the Start menu).
  • Update packages - open the Anaconda la
@yoavram
yoavram / pyzo_walkthrough.md
Last active August 29, 2015 14:15
A quick walkthough on how to install Python 3.4 with IPython and Numpy using PyZo

See also a video.

  • download pyzo http://www.pyzo.org/downloads.html
  • if you don't know any better and use Windows, choose the windows 32bit installer: pyzo_distro-2014a.win32.exe
    Make sure you download pyzo 2014a, not 2015a (scroll down and look for it).
    If you get a warning message "The site ahead contains harmful programs", don't worry, just click 'details' and then 'visit this site'
  • when the download has finished, open the downloads folder
  • rename the pyzo installer (F2) to add extension .exe if it's missing
  • run the pyzo installer
  • yes, yes, next, next.
@yoavram
yoavram / bug.ipynb
Created March 31, 2015 09:24
A reproducible bug in lmfit with ipython - see https://github.com/lmfit/lmfit-py/issues/221
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.