Calculating the Pair Correlation Function in Python