Question: I have Question for this matrix:

```
A=([[2, 3, 4, 2, 1, 3, 4, 1, 3, 2 ]])

```

And I want obtain another matrix from A as below:

```
B=([[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1],
[0, 1, 0, 0],
[1, 0, 0, 0],
[0, 0, 1, 0],
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 1, 0],
[0, 1, 0, 0]])

```

Iwritten for this:

```
import numpy as np
n=np.matrix('[2, 3, 4, 2, 1, 3, 4, 1, 3, 2]')
c=np.matrix('[0, 0, 0, 0]')
d=np.zeros((1,4))
for i in np.nditer(n):
    h=d.itemset((0,i-1),1)
    print d

```

But I obtain wrong matris as below

```
[[ 0.  1.  0.  0.]]
[[ 0.  1.  1.  0.]]
[[ 0.  1.  1.  1.]]
[[ 0.  1.  1.  1.]]
[[ 1.  1.  1.  1.]]
[[ 1.  1.  1.  1.]]
[[ 1.  1.  1.  1.]]
[[ 1.  1.  1.  1.]]
[[ 1.  1.  1.  1.]]
[[ 1.  1.  1.  1.]]

```

How can I obtained true(B) matrix????

Answer: 
According to our conversation in comments I am posting my comments in answer.

Check your controller and validation rules too. It's not a validation error but sometime validation might have `unique:users` or `exists:users,email`
There was a problem with validation rule, it was set to uniuqe:users. Replacing users with super\_admins ( table name in this case ) solved the problem.