Hi,

While dividing element from first matrix by second matrix value 0 I need result to be 0 instead of inf.

example:

1 1

2 6

divided by

1 0

4 3

should be

1 0(now got inf)

0,5 2

While dividing element from first matrix by second matrix value 0 I need result to be 0 instead of inf.

example:

1 1

2 6

divided by

1 0

4 3

should be

1 0(now got inf)

0,5 2

import numpy as np np.savetxt("result.txt", np.divide(np.loadtxt("1.txt"), np.loadtxt("2.txt"))) m1, m2 = np.loadtxt("1.txt"), np.loadtxt("2.txt") result = np.divide(m1, m2)