Code:
Chemical.Row = int((i-i%cols)/cols+1) if i%cols > 0 else int((i-i%cols)/cols)
Is there a better way to get the row and column given the position? I have been using this method for years, but it has always felt like there should be a simpler way to do it.