diff options
author | Frederic <nouiz@nouiz.org> | 2012-06-11 16:37:27 -0400 |
---|---|---|
committer | Frederic <nouiz@nouiz.org> | 2012-06-11 16:37:27 -0400 |
commit | e909e4eafba23b6dd6391c8ea6aeb003c6192ef4 (patch) | |
tree | 89e9bb5baa376334544735cd48242451424ba6a2 /numpy/lib/tests/test_index_tricks.py | |
parent | 69c33bf74bcdc1d9781bd5db27f942f6d676c032 (diff) | |
download | numpy-e909e4eafba23b6dd6391c8ea6aeb003c6192ef4.tar.gz |
add the warp parameter to fill_diagonal for people that could want the old behavior.
Diffstat (limited to 'numpy/lib/tests/test_index_tricks.py')
-rw-r--r-- | numpy/lib/tests/test_index_tricks.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py index aaedd83ea..beda2d146 100644 --- a/numpy/lib/tests/test_index_tricks.py +++ b/numpy/lib/tests/test_index_tricks.py @@ -158,6 +158,7 @@ def test_fill_diagonal(): array([[5, 0, 0], [0, 5, 0], [0, 0, 5]])) + #Test tall matrix a = zeros((10, 3),int) fill_diagonal(a, 5) @@ -173,6 +174,21 @@ def test_fill_diagonal(): [0, 0, 0], [0, 0, 0]])) + #Test tall matrix wrap + a = zeros((10, 3),int) + fill_diagonal(a, 5, True) + yield (assert_array_equal, a, + array([[5, 0, 0], + [0, 5, 0], + [0, 0, 5], + [0, 0, 0], + [5, 0, 0], + [0, 5, 0], + [0, 0, 5], + [0, 0, 0], + [5, 0, 0], + [0, 5, 0]])) + #Test wide matrix a = zeros((3, 10),int) fill_diagonal(a, 5) |