This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
#Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
#Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(value_list)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
import psycopg2 | |
import pandas as pd | |
import pandas.io.sql as sqlio | |
import ConfigParser | |
import argparse | |
import statistics | |
from pandas import pivot_table, crosstab | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Experiment Jira Id: WAT-195 | |
// Optimizely Experiment Id: 2767601388 | |
// Experiment Name: "(WAT-195) Bitbucket: homepage messaging + small signupform"; | |
// Experiment URL: https://bitbucket.org | |
// ------------ | |
// VARIATION:: HEADER 1 | |
// ------------ | |
// Author: Shreyas | |
// Email: shreyas@atlassian.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** Experiment Jira Id: WAT-122 | |
** Experiment Name: "Remove Solo-JIRA trial as an option on the try page"; | |
** Experiment URL: https://extranet.atlassian.com/jira/browse/WAT-122 | |
** ------------ | |
** Author: Shreyas | |
** Email: shreyas@atlassian.com | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** Experiment Jira Id: WAT-122 | |
** Experiment Name: "Remove Solo-JIRA trial as an option on the try page"; | |
** Experiment URL: https://extranet.atlassian.com/jira/browse/WAT-122 | |
** ------------ | |
** Author: Shreyas | |
** Email: shreyas@atlassian.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(** | |
* Pause and resume Growl. Use in a launcher like Quicksilver or Alfred to | |
* pause and resume Growl when the menu bar icon is disabled. | |
* | |
* Author: Andrew Berry, deviantintegral@gmail.com | |
*) | |
tell application "Growl" | |
register as application "Growl pause/resume" all notifications {"Growl paused", "Growl resumed"} default notifications {"Growl paused", "Growl resumed"} icon of application "Growl" | |
if is paused then | |
resume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$master_script = <<SCRIPT | |
#!/bin/bash | |
cat > /etc/hosts <<EOF | |
127.0.0.1 localhost | |
# The following lines are desirable for IPv6 capable hosts | |
::1 ip6-localhost ip6-loopback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var probability = function(a,b, num_games){ | |
if (a === num_games) return 1; | |
if (b === num_games) return 0; | |
return 0.5*probability(a+1, b, num_games) + 0.5*probability(a,b+1, num_games) | |
} |