extract_observations function

Extract observations from data