def spdiags(data, diags, m, n, format=None):
 return dia_matrix((data, diags), shape=(m, n)).asformat(format)

def spdiags ( data , diags , m , n , format = None ) : return dia_matrix ( ( data , diags ) , shape = ( m , n ) ) . asformat ( format )
return a sparse matrix from diagonals .