Did I find the right examples for you? yes no

# segmentation.find_all_nconnected

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

```from .lineshapes1d import gauss, ls_str2class
from .segmentation import find_all_downward, find_all_upward
from .segmentation import find_all_connected, find_all_nconnected
from ..fileio import table

```
```            nloc, nseg = find_all_upward(data, nthres, True, diag)
elif algorithm == 'connected':
nloc, nseg = find_all_nconnected(data, nthres, True, diag)
else:
raise ValueError('Invalid algorithm %s' % (algorithm))
```
```            nloc = find_all_upward(data, nthres, False, diag)
elif algorithm == 'connected':
nloc = find_all_nconnected(data, nthres, False, diag)
else:
raise ValueError('Invalid algorithm %s' % (algorithm))
```

```from .lineshapes1d import gauss, ls_str2class
from .segmentation import find_all_downward, find_all_upward
from .segmentation import find_all_connected, find_all_nconnected
from ..fileio import table

```
```            nloc, nseg = find_all_upward(data, nthres, True, diag)
elif algorithm == 'connected':
nloc, nseg = find_all_nconnected(data, nthres, True, diag)
else:
raise ValueError('Invalid algorithm %s' % (algorithm))
```
```            nloc = find_all_upward(data, nthres, False, diag)
elif algorithm == 'connected':
nloc = find_all_nconnected(data, nthres, False, diag)
else:
raise ValueError('Invalid algorithm %s' % (algorithm))
```