Created function mypartition_data