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 pandas as pd | |
| import numpy as np | |
| import multiprocessing | |
| from functools import partial | |
| def _df_split(tup_arg, **kwargs): | |
| split_ind, df_split, df_f_name = tup_arg | |
| return (split_ind, getattr(df_split, df_f_name)(**kwargs)) | |
| def df_multi_core(df, df_f_name, subset=None, njobs=-1, **kwargs): |
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
| // http://en.wikipedia.org/wiki/Decorator_pattern | |
| trait Coffee { | |
| def cost:Double | |
| def ingredients: String | |
| } | |
| class SimpleCoffee extends Coffee { | |
| override def cost = 1 | |
| override def ingredients = "Coffee" |
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
| function Gauge(placeholderName, configuration) | |
| { | |
| this.placeholderName = placeholderName; | |
| var self = this; // for internal d3 functions | |
| this.configure = function(configuration) | |
| { | |
| this.config = configuration; | |