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 _highest_density_interval(self, pmf, p=.9, title=''): | |
# If we pass a DataFrame, just call this recursively on the columns | |
if(isinstance(pmf, pd.DataFrame)): | |
return pd.DataFrame([self._highest_density_interval(pmf[col], title=str(col)) for col in pmf], | |
index=pmf.columns) | |
# Broadcast the probability distribution to an artificial set of samples by | |
# repeating each index value N times where N = probability sample_precision | |
sample_precision = 1000000 | |
samples_repeats = np.array(pmf.values * sample_precision)#.astype(int) |
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
name: rspec | |
on: | |
pull_request: | |
branches: | |
- "master" | |
push: | |
branches: | |
- "master" |
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
Start Date,End Date,# Days,Location | |
12/30/2014,1/1/2015,2,"Quechee, VT" | |
1/1/2015,1/4/2015,3,"Newport, RI" | |
1/4/2015,1/13/2015,9,"Somerville, MA" | |
1/13/2015,1/17/2015,4,"San Francisco, CA" | |
1/18/2015,1/22/2015,4,"Somerville, MA" | |
1/22/2015,1/27/2015,5,"Newport, RI" | |
1/27/2015,2/7/2015,11,"Somerville, MA" | |
2/7/2015,2/8/2015,1,"Newport, RI" | |
2/8/2015,2/18/2015,10,"Somerville, MA" |
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
// | |
// LocalStore.swift | |
// FPAPI | |
// | |
// Created by Giles Van Gruisen on 3/23/15. | |
// Copyright (c) 2015 Remarkable.io. All rights reserved. | |
// | |
import Foundation | |
import AwesomeCache |
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
infix operator --> { associativity left precedence 160 } | |
func --><T, S>(argument: T?, body: (T) -> (S)) -> S? { | |
if let value = argument { | |
return body(value) as S | |
} else { | |
return nil | |
} | |
} |
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
// Binary search | |
func binarySearch<T: Comparable>(target: T, collection: [T]) -> Int { | |
var min = 0 | |
var max = countElements(collection) - 1 | |
return binaryMakeGuess(min, max, target, collection) | |
} |
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
@interface Publisher : NSObject | |
- (void)subscribe:(void(^)(id object))subscriptionBlock; | |
- (void)publish:(id)object; | |
@end |