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)
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Original Perl module: Regexp::Trie | |
| # Original Copyright (C) 2006 by Dan Kogai | |
| # | |
| # This Python translation is a derivative work based on Regexp::Trie | |
| # Copyright (c) 2010 by rex | |
| # Copyright (c) 2017 by fcicq, atiking and EricDuminil |
| #!/usr/bin/env python3 | |
| import os | |
| import os.path | |
| import subprocess | |
| import time | |
| from splinter import Browser | |
| def is_theme_dir(folder, item): |
| from selenium import webdriver | |
| driver = webdriver.Firefox() | |
| driver.get('https://www.facebook.com/') | |
| with open('jquery-1.9.1.min.js', 'r') as jquery_js: | |
| jquery = jquery_js.read() #read the jquery from a file | |
| driver.execute_script(jquery) #active the jquery lib | |
| driver.execute_script("$('#email').text('anhld')") |
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)
| #!/usr/bin/perl | |
| use Mysql; | |
| use strict; | |
| use vars qw($school_name); | |
| use vars qw($pass); | |
| require "./cgi-lib.pl"; |
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <title>Testing IE Compatibility Mode</title> | |
| <script src="ieUserAgent.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <div id="results">Results:</div> | |
| <script type="text/javascript"> | |
| var val = "IE" + ieUserAgent.version; |
| dict([[h.partition(':')[0], h.partition(':')[2]] for h in rawheaders.split('\n')]) |
| #!/bin/bash | |
| # store the current dir | |
| CUR_DIR=$(pwd) | |
| # Let the person running the script know what's going on. | |
| echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
| # Find all git repositories and update it to the master latest revision | |
| for i in $(find . -name ".git" | cut -c 3-); do |
| #!/usr/bin/env python | |
| import sys, paramiko | |
| if len(sys.argv) < 5: | |
| print "args missing" | |
| sys.exit(1) | |
| hostname = sys.argv[1] | |
| password = sys.argv[2] |