Data analysis labNumPy problems

Problem 6 of 50 · Create arrays · Easy

A 4 by 4 identity

Print an identity matrix with ones on the diagonal.

Preparing NumPy, Pandas, and MatplotlibShift+Enter runs the cell you are in.

Print a 4 by 4 identity matrix. Ones sit on the diagonal. Everything else is 0.

1

Your solution

2

Scratch