Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ventsislav-Yordanov/3ef4587b274643a161e4bea0952950ab to your computer and use it in GitHub Desktop.
Save Ventsislav-Yordanov/3ef4587b274643a161e4bea0952950ab to your computer and use it in GitHub Desktop.
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())
@Ml-gur
Copy link

Ml-gur commented Jan 14, 2021

where does the name nose come from sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment