Crunch-io / crunch-cube

Python tools for Cubes in the Crunch API
MIT License
3 stars 1 forks source link

How to get the median? #158

Open alextanski opened 5 years ago

alextanski commented 5 years ago

I am able to query the following stats: cube_mean, cube_stddev, cube_min, cube_max but cube_median does not work so I guess it is indicated by a different cube_-suffix. Any chance you guys know how to get it? Cannot find anything in here https://docs.crunch.io/feature-guide/feature-analyzing.html?highlight=cube_count#multidimensional-analysis.

malecki commented 5 years ago

cube_quantile(probability=0.5) (or a list of probs) should do it. Thanks for the nudge on the docs!

alextanski commented 5 years ago

Thanks! Just had a look at that. How do I need to structure my query for this?

Literally as:

{'function': 'cube_quantile(probability=0.5)'} (that fails for me)

or in form of

{"function": "cube_quantile", "args": [{'probability': 0.5}]} (that is probably not correctly composed...)?

jamesrkg commented 5 years ago

@malecki are you able to help clarify the correct way to send a request for cube_quantile(probability=0.5)?

alextanski commented 5 years ago

Reopened for visibility.

alextanski commented 5 years ago

bumping this.