changed data slicing method to pandas truncate function.