Exercise 556

By using the arange() method, giv a numpy python code to get the matrix: A = np.array([ 1 3 5 7 9 11 13])

Solution

import numpy as np

A = np.arange(1 , 16 , 2 , dtype = int)
print(A)
# The output is : [ 1 3 5 7 9 11 13]

Younes Derfoufi
my-courses.net

Leave a Reply