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/48a5e73ae43c668e2f2f725a503ca96c to your computer and use it in GitHub Desktop.
Save Ventsislav-Yordanov/48a5e73ae43c668e2f2f725a503ca96c to your computer and use it in GitHub Desktop.
numbers = np.array([
[10, 30, 100, 1000],
[30, 20, 10, 70]
])
# Repalce the "None" values with your solutions
# Divide each number by 2
numbers_divided_by_two = None
# Add 5 to each number
numbers_plus_five = None
# Add this array: [[10, 20, 44, 1], [10, 10, 15, 30]] to the "numbers" array
new_numbers = None
# Tests
nose.tools.assert_sequence_equal([[5.0, 15.0, 50.0, 500.0], [15.0, 10.0, 5.0, 35.0]], numbers_divided_by_two.tolist())
nose.tools.assert_sequence_equal([[15, 35, 105, 1005], [35, 25, 15, 75]], numbers_plus_five.tolist())
nose.tools.assert_sequence_equal([[20, 50, 144, 1001], [40, 30, 25, 100]], new_numbers.tolist())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment