Skip to content

Instantly share code, notes, and snippets.

View iros's full-sized avatar

Irene Ros iros

View GitHub Profile
@iros
iros / plot.py
Created July 17, 2014 19:50
plotting 3d surface from 3 columns in data frame
from mpl_toolkits.mplot3d import Axes3D
import statsmodels.api as sm
dpu = pu[pu.Reputation < 5000]
X = dpu[['Age', 'TimeOnSite']]
y = dpu['Reputation']
X = sm.add_constant(X)
est = sm.OLS(y, X).fit()
@iros
iros / 01.approach-1.js
Last active August 29, 2015 14:04
d3 + canvas, approaches code snippets
var base = d3.select("#vis");
var chart = base.append("canvas")
.attr("width", 400)
.attr("height", 300);
var context = chart.node().getContext("2d");
var data = [1,2,13,20,23];
var scale = d3.scale.linear()
.range([10, 390])