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 matplotlib.pyplot as plt | |
import matplotlib.ticker as ticker | |
import pandas as pd | |
import numpy as np | |
import random | |
def build_userbase( n, payer_percentage ): | |
users = pd.DataFrame( columns=[ "user", "payer", "payment_probability", "payment" ] ) | |
for x in range( 1, n + 1 ): | |
payer = True if random.randint( 1, 100 ) <= ( payer_percentage * 100 ) else 0 |
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
# I had an annoying situation where I wanted a multi-chart matplotlib chart to look symmetrical given some number of max | |
# rows and columns | |
# eg. if I have 9 graphs I want to plot and the max number of (rows, columns) for the chart is (4, 4), | |
# I don't want 2 rows with 5 charts on the top and 4 on the bottom; | |
# I want 3 rows with 3 charts per row | |
# this algorithm returns a tuple of rows, columns given some parameters: | |
# this_length is the number of charts to plot | |
# max_cols is the maximum number of columns the chart can have (the matplotlib max is 4) | |
# max_rows is the maximum number of rows the chart can have (matplotlib max is 4) |
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 matplotlib.pyplot as plt | |
import matplotlib.ticker as ticker | |
import matplotlib.colors as pltcolors | |
import pandas as pd | |
import numpy as np | |
import random | |
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib import colors as mcolors | |
from matplotlib import cm | |
from beautifultable import BeautifulTable |
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 numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
from sklearn.linear_model import Ridge | |
from sklearn.preprocessing import PolynomialFeatures | |
from sklearn.pipeline import make_pipeline | |
from scipy.optimize import curve_fit | |
import statsmodels.stats.api as sms | |
import math | |
import operator |
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
<html> | |
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | |
<head> | |
<title>D3.js Dashboard Introduction</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script> | |
<script> | |
function getMaxObjectValue(this_array, element) { |
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
<html> | |
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | |
<head> | |
<title>Comparison -- Mobile Handset Manufacturers and Platforms, Q1 2013 and Q1 2013</title> | |
<link href="http://nvd3.org/src/nv.d3.css" rel="stylesheet"> | |
<link href="http://nvd3.org/css/common.css" rel="stylesheet"> | |
<link href="http://nvd3.org/css/syntax.css" rel="stylesheet"> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script> |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"> | |
<meta content="utf-8" http-equiv="encoding"> | |
<title> | |
Minimum Viable Metrics dashboard template - ufert.se | |
</title> | |
<link href="https://raw.github.com/ESeufert/MVM-Dashboard-Template/master/nvd3-master/src/nv.d3.css" rel="stylesheet" type="text/css"> |
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
<?php | |
class tweet_scroll { | |
/****************************************************************** | |
** database access constants ** | |
** edit these ** | |
******************************************************************/ | |
private $dbName = 'YOUR MYSQL DATABASE NAME'; | |
private $dbHost = 'YOUR MYSQL DATABASE HOST'; | |
private $dbUser = 'YOUR MYSQL DATABASE USERNAME'; |
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
<html> | |
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | |
<head> | |
<title>D3.js Dashboard Introduction</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script> | |
<script> | |
function getMaxObjectValue(metric, graph_metric) { |
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
<html> | |
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | |
<head> | |
<title>D3.js Dashboard Introduction</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script> | |
<script> | |
function getMaxObjectValue(metric, graph_metric) { |
NewerOlder