Write distances and frequencies with Z-score of None if no d in z