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)
def fuzzyfinder(p, l): | |
return map(lambda t: t[0], sorted(filter(lambda t: all(map(lambda x: x != -1, t[1])), map(lambda s: (s,map(s.find, p)), l)), key=lambda t: t[1])) |
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |
redis-cli KEYS 'icc*' | xargs -d '\n' redis-cli DEL |
#!/usr/bin/env ruby | |
require 'benchmark' | |
require File.expand_path('../config/environment', __FILE__) | |
begin | |
@list = (0..10_000).map{|i| {word: "word_#{i}", word_translation: "translation_#{i}"}} | |
@vocabulary_1 = Vocabulary.create(user_id: User.first.id, title: "Vocabulary #1") | |
@vocabulary_2 = Vocabulary.create(user_id: User.first.id, title: "Vocabulary #2") | |
@vocabulary_3 = Vocabulary.create(user_id: User.first.id, title: "Vocabulary #3") |
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)
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
celery flower --address=127.0.0.1 --url_prefix=flower --broker=<broker url> |
require "spec_helper" | |
describe ExampleController do | |
context "GET #index" do | |
let(:resources) { FactoryGirl.create_list(:resource) } | |
before do | |
get :index | |
end |
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
<!-- | |
For other language: Instead of `ace/mode/ruby`, Use | |
Markdown -> `ace/mode/markdown` | |
Python -> `ace/mode/python` | |
C/C++ -> `ace/mode/c_cpp` | |
Javscript -> `ace/mode/javascript` | |
Java -> `ace/mode/java` | |
Scala- -> `ace/mode/scala` |
#Nginx Basics for Ubuntu
Please see http://wiki.nginx.org/Main for more information. See http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/ for a tutorial on how to install Nginx.
##Installation To install, you can install the version which is in the standard Ubuntu repositories but it is normally quite old and will not have the latest security patches. The best way is to update the repositories first:
apt-get update
apt-get install python-software-properties
apt-get upgrade