df = pd.DataFrame({'A': [2, None, 1, -4, None, None, 3], 'B': [None, 1,
    None, None, 1, 3, None], 'C': [2, 1, None, 2, 2.1, 1, 0], 'D': [-2, 1.1,
    3.2, 2, None, 1, None]})
df
python - how to compute correlation-matrix with nans in data-matrix