Last active
January 14, 2021 09:48
-
-
Save Ventsislav-Yordanov/3ef4587b274643a161e4bea0952950ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbers = np.array([ | |
[40, 55, 66], | |
[30, 57, 23], | |
[72, 49, 20], | |
[20, 111, 203], | |
[999, 777, 202] | |
]) | |
# Repalce the "None" values with your solutions | |
rows_count, columns_count = None, None | |
# Get the first element of each row and save it into array with shape (5,). The result should be: [ 40 30 72 20 999] | |
first_sequence = None | |
# Get the first element of each row and save it as 2-dimensional array (with shape (5, 1)) | |
second_sequence = None | |
# Get the second and third elements from the forth and fifth rows | |
third_sequence = None | |
# Tests | |
nose.tools.assert_equal(5, rows_count) | |
nose.tools.assert_equal(3, columns_count) | |
nose.tools.assert_sequence_equal([40, 30, 72, 20, 999], first_sequence.tolist()) | |
nose.tools.assert_sequence_equal([[40], [30], [72], [20], [999]], second_sequence.tolist()) | |
nose.tools.assert_sequence_equal([[111, 203], [777, 202]], third_sequence.tolist()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where does the name nose come from sir