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
Instructions for configuring PATH on windows: | |
1. Download the pathampl executable from ftp://ftp.cs.wisc.edu/math-prog/solvers/path/ampl/win/ | |
2. Add the location of the PATH executable to the windows environmental variable named "path" (case insensitive) | |
3. Configure the license to permit unlimited model sizes by following instructions at http://pages.cs.wisc.edu/~ferris/path/LICENSE | |
Some models will unfortunately solve with this version of PATH. The only alternatives are using 'mpec-nl' to convert your mcp to an nlp, | |
or run on a linux machine with PATH 4.7.04. See https://stackoverflow.com/questions/51853047/error-when-solving-mixed-complementarity-model |
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
from pymc3 import * | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import statsmodels.api as sm | |
size = 200 | |
true_intercept = 1 | |
true_slope = 2 | |
x = np.linspace(0, 1, size) |
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
from bokeh.io import output_file, show | |
from bokeh.models import ( | |
GMapPlot, GMapOptions, ColumnDataSource, Circle,Patches, LabelSet, HoverTool, | |
TapTool,Range1d, PanTool, WheelZoomTool, BoxSelectTool,OpenURL | |
) | |
map_options = GMapOptions(lat=30.29, lng=-97.73, map_type="roadmap", zoom=11) | |
plot = GMapPlot(x_range=Range1d(), y_range=Range1d(), map_options=map_options,tools=[HoverTool(),TapTool()]) | |
plot.title.text = "Austin" |
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
from hashlib import sha1 | |
import hmac | |
def getUrl(request): | |
devId = 1000000 | |
key = bytes('mykey','UTF-8') | |
request = request + ('&' if ('?' in request) else '?') | |
raw = bytes(request+'devid={0}'.format(devId),'UTF-8') | |
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 | |
from bokeh.plotting import figure, output_file, show, ColumnDataSource | |
from bokeh.models import HoverTool | |
output_file("toolbar.html") | |
npt = 700 | |
images = ['https://cdn.spacetelescope.org/archives/images/screen/heic1107a.jpg'] * npt **2 |
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 | |
from bokeh.plotting import figure, show, output_file | |
from bokeh.models import ColumnDataSource, LabelSet | |
num_vars = 9 | |
theta = np.linspace(0, 2*np.pi, num_vars, endpoint=False) | |
# rotate theta such that the first axis is at the top | |
theta += np.pi/2 |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
{{ bokeh_css }} | |
{{ bokeh_js }} | |
<link rel="stylesheet" href="stocktext/static/css/styles.css"/> | |
</head> | |
<body> | |
{{ plot_div|indent(8) }} |
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
from __future__ import division | |
import numpy as np | |
from bokeh.core.properties import Instance, String, List, Either | |
from bokeh.models import ColumnDataSource, LayoutDOM | |
from bokeh.models.widgets import Button | |
from bokeh.layouts import column | |
from bokeh.io import show |
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
from __future__ import division | |
import numpy as np | |
from bokeh.core.properties import Instance, String, List, Either | |
from bokeh.models import ColumnDataSource, LayoutDOM | |
from bokeh.models.widgets import Button | |
from bokeh.layouts import column, row | |
from bokeh.io import curdoc |