> 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/portugues/tutoriais/pywr-scenarios-reading-external-dataframe-and-adding-custom-rules.md).

# Cenários PyWR lendo DataFrame externo e adicionando regras personalizadas

Neste tutorial, trabalharemos com o **Rede Thames**, da qual você recebe uma cópia automaticamente ao criar uma conta WaterStrategy.

As etapas abordadas incluem:

1. **Atualizando a demanda de Lee Valley**: Leremos e atualizaremos os dados da Lee Valley Demand a partir de um arquivo CSV externo contendo uma série temporal.
2. **Aplicando a incerteza das mudanças climáticas**: As incertezas das mudanças climáticas serão introduzidas ativando **cenários pywr**. Essas incertezas serão aplicadas a dois nós de captação (entradas), ajustando as condições de entrada com base em cenários específicos.
3. **Adicionando uma regra personalizada**: Você aprenderá a criar uma regra personalizada, uma ferramenta poderosa que permite a expansão e a integração da funcionalidade WaterStrategy. Neste exemplo, um novo parâmetro será criado para aumentar dinamicamente o volume máximo de um reservatório em uma data específica, conforme definido pelo usuário.

Ao final deste tutorial, você estará equipado para gerenciar e personalizar vários aspectos da rede Thames em WaterStrategy, utilizando dados de séries temporais, cenários de incerteza e regras personalizadas.

Você fará o upload manual dos arquivos necessários, portanto, certifique-se de salvá-los em seu computador para facilitar o acesso durante o tutorial

* [Tâmisa\ \_Lee\ \_Valley\ \_demand](https://nexsysanalytics-my.sharepoint.com/:x:/g/personal/jgonzalez_nexsys-analytics_com/ERY5QXJtGQtFpo7PKUUykJEBI9g6adLvCwxG90xhZqgySQ?e=b4brjW)
* [Tamisa\ \_entradas\ \_PywrScenarios.h5](https://nexsysanalytics-my.sharepoint.com/:u:/g/personal/jgonzalez_nexsys-analytics_com/EV7TBf9J_WZDpF3Oy6HyNmoBj3F4Ew216OE9ltOCC1P8pw?e=YV1A3q)

Para começar, em **Material de treinamento do projeto**, abrir **Tâmisa** rede

<figure><img src="/files/PN0WxwS1rwMfXkS3C93g" alt=""><figcaption></figcaption></figure>

Clonar **Cenário 1**

<figure><img src="/files/GdeDvALPlYD3yr6W3v6k" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="/files/mTdV2ZlBX5NzK7reIQYY" alt="" width="563"><figcaption></figcaption></figure>


---

# 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/portugues/tutoriais/pywr-scenarios-reading-external-dataframe-and-adding-custom-rules.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.
