# Pipeline aggregation python

**URL:** <https://discuss.elastic.co/t/pipeline-aggregation-python/94955>\
**Category:** Elasticsearch\
**Created:** [July 28, 2017, 12:46pm UTC](https://discuss.elastic.co/t/pipeline-aggregation-python/94955 "2017-07-28T12:46:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlosvega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlosvega/32/28433_2.png) [@carlosvega](https://discuss.elastic.co/u/carlosvega)\
**Post date:** [July 28, 2017, 12:46pm UTC](https://discuss.elastic.co/t/pipeline-aggregation-python/94955/1 "2017-07-28T12:46:15Z")

</div>

I would like to know how can I use [this feature with the python API](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-aggregations-pipeline.html)

I would like to concatenate two aggregations. For example:

I want to **sum** a metric from my documents, which is a quantity, with a date\_histogram aggregation with an interval of 1 minute and afterwards, aggregate these buckets in 10 minute intervals but using the **average** as operation. The reason for doing this is that I don't want some values (small quantities) to _distort_ the final 10 min average.

Is there any way to to this through the API? otherwise I would have to get my 1 minute time series and then perform these operations on my own using pandas or similar.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 25, 2017, 12:46pm UTC](https://discuss.elastic.co/t/pipeline-aggregation-python/94955/2 "2017-08-25T12:46:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
