BUG: Use `np.where` in np.triu/np.tril, fixes #4859

Replaces the current method to zero items, from multiplication to
using `np.where`.
Merge pull request #4861 from jaimefrio/tri_with_inf

BUG: inf turned to nan when calling np.triu/np.tril, fixes #4859