Use NumPy to recreate your answer to Question 1b. The input parameters will both be python lists, so you will need to convert the lists into arrays before performing your operations. The output should be a numpy array.

Respuesta :

Answer:

//To install the python’s numpy module on you system use following command

pip install numpy

//To use numpy module, need to import it i.e.

  • import numpy as np

/*Python’s Numpy module provides a function numpy.array() to create a Numpy Array from an another array like object in python like list or tuple etc or any nested sequence like list of list */

  • numpy.array (object, dtype =None, copy=True, order='K', subok=False, nadmin = 0 )

//To create a Numpy Array from list just pass the list object to numpy.array()

  • npArray = np.array([1,2,3,4,5,6,7,8,9])  
  • print('Contents of the ndArray : ')
  • print(npArray)