define assortativity coefficient as NaN when the denominator is zero