Fill in section A to complete code that will cause the following output:
import numpy as np
j = np.random.random([2,2])
print (j)
print (_A_)
Output:
[[ 0.1624438 , 0.14157016],
[ 0.07818402, 0.85854546]]
[[ 1. , 1. ],
[ 0.48129886, 6.06445229]])
I tried using np.corrcoef, it gives me all values as 1. Can you please help me?
>Solution :
For your example I am taking exact same j to make you understand.
j=np.array([[ 0.1624438 , 0.14157016],
[ 0.07818402, 0.85854546]])
print(j)
array([[0.1624438 , 0.14157016],
[0.07818402, 0.85854546]])
A = j/j[0]
print(A)
array([[1. , 1. ],
[0.48129889, 6.06445214]])
So, A will be j/j[0]