Implement weighted mode in csr_mode