add nan to d_prime for single unit case
@@ -88,6 +88,9 @@ def calculate_pc_metrics(pca, metric_names=None, max_spikes_for_nn=10000,
pc_metrics['l_ratio'][unit_id] = l_ratio
if 'd_prime' in metric_names:
+ if len(unit_ids) == 1:
+ d_prime = np.nan
+ else:
d_prime = lda_metrics(pcs_flat, labels, unit_id)
pc_metrics['d_prime'][unit_id] = d_prime
