# Time Interval Operation

![](https://894783789-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LPHXQ1I3gb93zpLrLZf%2Fuploads%2Fgit-blob-12d64099e3c341fb6e902e1d3d8e26bf1f9f9f6b%2FTime_Interval_Operation.png?alt=media)

![](https://894783789-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LPHXQ1I3gb93zpLrLZf%2Fuploads%2Fgit-blob-43a675f112f357ffcbc402bf481aa55ce0e8e726%2FTime_Interval_Operation.png?alt=media) - [\[source code\]](https://github.com/ladybug-tools/ladybug-grasshopper/blob/master/ladybug_grasshopper/src/LB%20Time%20Interval%20Operation.py)

Perform time interval operations on an hourly data collection.

This includes operations like: - Average - Total - Percentile

These actions can be performed over the following time intervals: - Daily - Monthly - Monthly per Hour

### Inputs

* **data \[Required]**

A Ladybug data collection object.

* **operation**

Text indicating the operation that should be performed on the input hourly data. Such text must be one of the following:

```
- average

- total

- [a number between 0 and 100]
```

In the case of the last option, the number will be interpreted as a percentile of the data over the time period. For example, inputting 75 will return the 75th percentile value of each day/month/hour, inputting 0 will give the minimum value of each day/month/hour and inputting 100 will give the max value of each day/month/hour. Default is 'average' if the input data type is not cumulative and 'total' if the data type is cumulative.

### Outputs

* **daily**

Daily data collection derived from the input \_data and *operation*.

* **monthly**

Monthly data collection derived from the input \_data and *operation*.

* **mon\_per\_hr**

Monthly Per Hour data collection derived from the input \_data and *operation*.


---

# Agent Instructions: 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:

```
GET https://docs.ladybug.tools/ladybug-primer/components/1_analyzedata/time_interval_operation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
