Skip to content

Instantly share code, notes, and snippets.

Avatar

Irene Ros iros

View GitHub Profile
@iros
iros / plot.py
Created Jul 17, 2014
plotting 3d surface from 3 columns in data frame
View plot.py
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 Aug 29, 2015
d3 + canvas, approaches code snippets
View 01.approach-1.js
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])