I am really not sure about my terminology here so please feel free to correct my title.
supose I have a pandas dataframe D with columns X and Y both discrete values <