This file contains hidden or 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
class llist(__builtin__.list): | |
"""Special list for Ordered Models. Element -1 is -Inf, Final element is Inf. | |
-------------------------------------------------------- | |
EXAMPLE: | |
x = llist([12.,14,2.2]) | |
x[1] | |
>>>14 | |
x[-1], x[3] | |
>>>(-inf, inf) |
This file contains hidden or 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
def se(self,params): | |
""" | |
Return standard errors at optimum point, NOT SE | |
""" | |
hess = self.hessian(params) | |
return np.sqrt(np.linalg.inv(-hess).diagonal()) | |
def hessian (self, x0, epsilon=1.e-8, *args ): | |
""" | |
A numerical approximation to the Hessian matrix of arbitrary function f at |
This file contains hidden or 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 urllib2 | |
import json | |
ll = urllib2.urlopen('http://worldfreightrates.com/en/calculator/ocean/rate?fromId=50eb29010f0880372c627af9&toId=50eb29010f0880372c627a38&fromName=Rotterdam%2C+Netherlands&toName=Los+Angeles%2C+United+States&oceanType=FCL&commodityName=Packaging+%26+Printing&commodityValue=25000&includeInsurance=false&includeReefer=false&includeHazardous=false&weight=&unit=lb&length=&width=&height=&containerSize=40&_=1439321618401') | |
result = json.load(ll) | |
print result['rate'] |
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 2 columns, instead of 1 in line 4.
This file contains hidden or 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
Район | |
округ | |
количество просмотров | |
нужно голосов | |
процент последних двух | |
Академический 1 1172 1055 111% | |
Академический 2 1308 1067 123% | |
Академический 3 1547 1048 148% |