Ionization energy is dependent on the electronic configuration of an element. For this reason there is some deviations in the gradual increase of ionization potential of elements as one goes from left to right in a period. For example the I.P. of oxygen is less than that of nitrogen.
The Electronic configuration of the two elements:
O (8) — 1s2 2s2 2px2 2py1 2pz1
When one electron is removed from it, O+ ion is formed, whose electronic configuration is; O+ (7) — 1s2 2s2 2px1 2py1 2pz1
Due to the exactly half filled 2p orbital, this configuration is relatively more stable and hence less energy than usual is needed to remove one electron from oxygen atom i.e; the first ionization potential of oxygen is relatively low.
On the other hand, the electronic configuration of nitrogen is:
N(7) — 1s2 2s2 2px1 2py1 2pz1; which is relatively stable due to exactly half tilled 2p orbital. Removal of one electron results to the breaking of this stable configuration. Hence relatively more energy is needed for the removal of one electron hum nitrogen atom.
So, the first ionization potential of nitrogen is higher than that of oxygen.