Some updates to data affinity doc

- Example code updated.

it was fine on html but did not test as pdf. It is better to make it small, I will update.