A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
import time | |
def RateLimited(maxPerSecond): | |
minInterval = 1.0 / float(maxPerSecond) | |
def decorate(func): | |
lastTimeCalled = [0.0] | |
def rateLimitedFunction(*args,**kargs): | |
elapsed = time.clock() - lastTimeCalled[0] | |
leftToWait = minInterval - elapsed | |
if leftToWait>0: |
function has3d(){ | |
if (!window.getComputedStyle) { | |
return false; | |
} | |
var el = document.createElement('p'), | |
has3d, | |
transforms = { | |
'webkitTransform':'-webkit-transform', | |
'OTransform':'-o-transform', |
var http = require('http'); | |
var port = 8080; | |
var server = http.createServer(function(request, response) { | |
response.writeHead(200, {'Content-Type': 'text/html'}); | |
response.write('<h1>Hello World!</h1>'); | |
response.end(); | |
}); | |
server.listen(port, function() { |
// vanilla JS window width and height | |
var w=window, | |
d=document, | |
e=d.documentElement, | |
g=d.getElementsByTagName('body')[0], | |
x=w.innerWidth||e.clientWidth||g.clientWidth, | |
y=w.innerHeight||e.clientHeight||g.clientHeight; |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
A Pen by Dariel Noel Vila Plagado on CodePen.
kill -9 $(ps aux | grep harmony | grep -v grep | awk '{print $2}') |