no_zeroes = [(r[:i] + r[i + 1:]) for i, r in enumerate(a)]
no_zeroes
sorted_no_zeroes = [sorted(r, reverse=True) for r in no_zeroes]
sorted_no_zeroes
sorted_with_zeroes = [(r[:i] + [0] + r[i:]) for i, r in enumerate(
    sorted_no_zeroes)]
sorted_with_zeroes
Sort array in Python without modifying specific element positions