def _zero_triband(a, lower=0):
 (nrow, ncol) = a.shape
 if lower:
  for i in range(nrow):
   a[i, (ncol - i):] = 0.0
 else:
  for i in range(nrow):
   a[i, 0:i] = 0.0
 return a

def _zero_triband ( a , lower = 0 ) : ( nrow , ncol ) = a . shape if lower : for i in range ( nrow ) : a [ i , ( ncol - i ) : ] = 0.0 else : for i in range ( nrow ) : a [ i , 0 : i ] = 0.0 return a
explicitly zero out unused elements of a real symmetric banded matrix .