(self)
| 2007 | |
| 2008 | class TestIndex: |
| 2009 | def test_boolean(self): |
| 2010 | a = rand(3, 5, 8) |
| 2011 | V = rand(5, 8) |
| 2012 | g1 = randint(0, 5, size=15) |
| 2013 | g2 = randint(0, 8, size=15) |
| 2014 | V[g1, g2] = -V[g1, g2] |
| 2015 | assert_( |
| 2016 | (np.array([a[0][V > 0], a[1][V > 0], a[2][V > 0]]) == a[:, V > 0]).all() |
| 2017 | ) |
| 2018 | |
| 2019 | def test_boolean_edgecase(self): |
| 2020 | a = np.array([], dtype='int32') |