Question: I have four jquery sliders in a page with these scripts:

```
$(document).ready(function(){
  $("#information").click(function(){
    $("#information_show").slideToggle("medium");
  });
});

$(document).ready(function(){
  $("#menu").click(function(){
    $("#menu_slide").slideToggle("medium");
  });
});

$(document).ready(function(){
  $("#books").click(function(){
    $("#books_toggle").slideToggle("medium");
  });
});

$(document).ready(function(){
  $("#content").click(function(){
    $("#content_div").slideToggle("medium");
  });
});

```

So for example when I click on the div `#information` the `#information_toggle` is visible. I wounder if there is any way to make the sliders only show one at once.

Example: When click on `#books`, the `#books_toogle` show. Now when click on `#menu` the `#menu_slide` shows, at the same time the `#menu_slide` shows `#books_toggle` toogle/close automatic. So only one hidden div will show at once.

Answer: 
First of all, you probably don't want to put your code in that class definition...

```
import numpy as np

def main():
    m = np.random.random((3, 4))
    mask = (m[2] > 0.5) & (m[2] < 0.8)  # put your conditions here
                                        # instead of 0.5 and 0.8 you can use
                                        # an array if you like
    m[:, mask]

if __name__ == '__main__':
    main()

```

`mask` is a boolean array, `m[:, mask]` is the array you want

m[2] is the third row of m. If you type `m[2] + 2` you get a new array with the old values + 2. `m[2] > 0.5` creates an array with boolean values. It is best to try this stuff out with ipython (www.ipython.org)

In the expression `m[:, mask]` the `:` means "take all rows", mask describes which columns should be included.

**Update**

Next try :-)

```
for i in range(0, len(m), 2):
    two_rows = m[i:i+2]

```
If you can write your condition as a simple function

```
def condition(value):
    # return True or False depending on value

```

then you could select your subarrays like this:

```
cond = condition(a[2])
subarray0 = a[0,cond]
subarray1 = a[1,cond]

```