Write a NumPy program to create a 1-D array going from 0 to 50 and an array from 10 to 50.
import numpy as np x = np.arange(50) print("Array from 0 to 50:") print(x) x = np.arange(10, 50) print("Array from 10 to 50:") print(x)
Sample Output:
Array from 0 to 50: [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 3 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 4 8 49] Array from 10 to 50: [10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3 3 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer