> For the complete documentation index, see [llms.txt](https://water-strategy.gitbook.io/waterstrategy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://water-strategy.gitbook.io/waterstrategy/italiano/nozioni-di-base-sulla-modellazione/recorders/base-recorder/aggregator.md).

# Aggregatore

## Descrizione generale

Classe di utilità per il calcolo di valori aggregati.

È improbabile che gli utenti utilizzino direttamente questa classe. Invece *registratore* le sottoclassi utilizzeranno questa funzionalità per aggregare i loro risultati su diverse dimensioni (ad esempio tempo, scenari, ecc.). [API Riferimento](https://pywr.github.io/pywr-docs/master/api/generated/pywr.recorders.Aggregator.html)

## Attributi

funzioni numpy. \_kwargs

<table><thead><tr><th width="158">Nome</th><th width="473">Descrizione</th><th>Richiesto</th><th></th></tr></thead><tbody><tr><td>func</td><td><p>La funzione di aggregazione da utilizzare. Può essere una stringa o un dict che definisce le funzioni di aggregazione o una funzione personalizzata richiamabile che esegue l'aggregazione.</p><p>Quando è una stringa può essere una delle seguenti: «sum», «min», «max», «mean», «median», «product» o «count_diverso da zero».</p><p><em>Queste stringhe vengono mappate e fanno sì che l'aggregatore utilizzi le corrispondenti funzioni numpy.</em></p><p>È possibile fornire un dict contenente una chiave «func» e i tasti opzionali «args» e «kwargs». Il valore di «func» dovrebbe essere una stringa corrispondente ai suddetti nomi delle funzioni numpy con le opzioni aggiuntive di «percentile» e «percentileofscore». Queste ultime due funzioni richiedono argomenti aggiuntivi (il percentile e il punteggio) per funzionare e devono essere fornite come valori nelle chiavi «args» o «kwargs» del dizionario. Fai riferimento alle corrispondenti definizioni delle funzioni numpy (o scipy)</p><p>per la documentazione su questi argomenti.</p><p>Infine, può essere fornita una funzione richiamabile. Questa funzione deve accettare un array numpy 1D o 2D come primo argomento e supportare la parola chiave «axis» come valore intero che determina su quale asse la funzione deve applicare l'aggregazione. La parola chiave axis viene fornita solo quando viene fornito un array 2D. Pertanto, `la funzione richiamabile dovrebbe comportarsi in modo simile alle</p></td><td>Sì func</td><td></td></tr><tr><td>_args</td><td>func_</td><td></td><td></td></tr><tr><td>args: list</td><td>Sì func</td><td>func_kwargs: detto</td><td>sì</td></tr></tbody></table>

## Esempio

```json
{
Aggregatore («somma»)
Aggregatore ({"func»: «percentile», «args»: [95], "kwargs»: {}})
Aggregatore ({"func»: «percentileofscore», «kwargs»: {"score»: 0.5, «kind»: «rank"}})
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://water-strategy.gitbook.io/waterstrategy/italiano/nozioni-di-base-sulla-modellazione/recorders/base-recorder/aggregator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
