Crossfilter Javascript to Python conversion