> For the complete documentation index, see [llms.txt](https://docs.ladybug.tools/ladybug-primer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ladybug.tools/ladybug-primer/components/1_analyzedata/apply_pattern.md).

# Apply Pattern

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

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

Filter a data collection or list of data collections by a pattern of True/False values. True values will be kept while False values will be filtered out.

### Inputs

* **data \[Required]**

A Data Collection or list of aligned Data Collections to be filtered by a pattern.

* **pattern \[Required]**

A list of True/False values. Typically, list has a length matching the length of the Data Collection(s)'s values. However, it can also be a pattern to be repeated over the Data Collection(s)'s values.

### Outputs

* **data**

A list of Data Collections that have been filtered by the \_pattern.
