python script to preprocess data points