preprocess_data function

Preprocesses time-series data for fitting