infer_notation function

Infer the notation(s) for a row or column label