Generation

generate functionTue, 10 Jan 2023

Create a numpy array with elements from number N to 0. For example, for N = 10 it would be array([9, 8, 7, 6, 5, 4, 3, 2, 1, 0])

import numpy as np def array_creation(n): return np.arange(n - 1, -1, -1)

Questions about programming?Chat with your personal AI assistant