prepare_data function

Prepare raw data by binning them in 1d or 2d