Skip to content

Instantly share code, notes, and snippets.

"""
=====================================================
A demo of the K Means clustering algorithm
=====================================================
"""
print __doc__
import numpy as np
from scikits.learn.cluster import MiniBatchKMeans, KMeans
@NelleV
NelleV / plot_results.py
Created August 27, 2012 13:40
Bug report for matplotlib
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib import patches
"""
This code is meant to analyse where telomeres and centromers are most often
@NelleV
NelleV / pep.py
Created October 13, 2012 12:28
A not pep8 file
ENG_PREFIXES = {
-24: "y",
-21: "z",
-18: "a",
-15: "f",
-12: "p",
-9: "n",
-6: u"\u03bc", # Greek letter mu
-3: "m",
0: "",
@NelleV
NelleV / intro
Created April 20, 2013 07:28
AGramfort's Python introduction
{
"metadata": {
"name": "Lecture-0-Scientific-Computing-with-Python"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@NelleV
NelleV / intro-2
Created April 20, 2013 07:29
Agramfort-2
{
"metadata": {
"name": "Lecture-1-Introduction-to-Python-Programming"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
genes = structure(list(go_id = c("GO:0016787", "GO:0005634", "GO:0016798",
"GO:0008152", "GO:0005737", "GO:0004553", "GO:0005975", "GO:1903561",
"GO:0015929", "GO:0004563", "GO:0102148", "GO:0001934", "GO:0004672",
"GO:0005524", "GO:0006468", "GO:0016020", "GO:0016021", "GO:0016740",
"GO:0005886", "GO:0005634"), refseq_mrna = c("NM_001001333",
"NM_001001333", "NM_001001333", "NM_001001333", "NM_001001333",
"NM_001001333", "NM_001001333", "NM_001001333", "NM_001001333",
"NM_001001333", "NM_001001333", "NM_001003817", "NM_001003817",
"NM_001003817", "NM_001003817", "NM_001003817", "NM_001003817",
"NM_001003817", "NM_001003817", "NM_001003817")), row.names = c(NA,