Question: Write a function that takes two inputs: a numpy array and a scalar. The function outputs a numpy array in which the column indicated by


  1. Write a function that takes two inputs: a numpy array and a scalar. The function outputs a numpy array in which the column indicated by the scalar is transformed to Z-score while all other columns are maintained. If no scalar is provided, all columns are transformed. The purpose of this requirement is to demonstrate python and numpy proficiency, so do not use helper functions in other Python packages to calculate the Z-score.
  2. Demonstrate good practices in function construction such as testing for validity of inputs. Thecode must be clean and easy to understand.
  3. Run and produce results using these inputs: x1 = np.array([[4,3,12],[1,5,20],[1,2,3],[10,20,40],[7,2,44]]); x2 = 3; x3 = 6; x4 = 'two'
  4. Run the function as follows and generate results.
  • myz(x1)
  • myz(x1,x2)
  • myz(x1,x3)
  • myz(x2,x3)
  • myz(x1,x4)
  • Briefly, list concepts you learned from the project.
  • Create a report produced and formatted using a Jupyter notebook.

Your well-structured report should include a brief description of the project, your coding, results, and other required elementse.g., the list of things learned. Finally, note that you need to demonstrate effective usage of a Juptyter notebook.




Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!