# Get number of connected components using Connectivity filter

**URL:** https://discourse.paraview.org/t/get-number-of-connected-components-using-connectivity-filter/4609
**Category:** ParaView Support
**Tags:** python
**Created:** [June 17, 2020, 8:10pm UTC](https://discourse.paraview.org/t/get-number-of-connected-components-using-connectivity-filter/4609 "2020-06-17T20:10:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![R.B](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/a9adbd/32.png) [@R.B](https://discourse.paraview.org/u/R.B)
#### Post date: [June 17, 2020, 8:10pm UTC](https://discourse.paraview.org/t/get-number-of-connected-components-using-connectivity-filter/4609/1 "2020-06-17T20:10:37Z")

</div>

Hi

I’m using the Connectivity filter to get the connected components in a mesh. Is there a way to get the number of connected components using python?

This is the code I have so far:

```
from paraview.simple import *

headbinaryzlibvti = XMLImageDataReader(FileName=['head-binary-zlib.vti'])
headbinaryzlibvti.PointArrayStatus = ['Scalars_']
renderView1 = GetActiveViewOrCreate('RenderView')
headbinaryzlibvtiDisplay = Show(headbinaryzlibvti, renderView1)

connectivity1 = Connectivity(Input=headbinaryzlibvti)
connectivity1Display = Show(connectivity1, renderView1)
```
