<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_data(self):
 """ Loads image and label data from specified csv file path. :return: Dataset object containing image and label data. """

        print('Extracting training data from csv...')
        images = list()
        labels = list()
        emotion_index_map = dict()
        with open(self.datapath) as csv_file:
            reader = csv.reader(csv_file, delimiter=',', quotechar='"')
            for row in reader:
                label_class = row[self.csv_label_col]
                if label_class not in self.target_emotion_map.keys():
                    continue
                label_class = self.target_emotion_map[label_class]
                if label_class not in emotion_index_map.keys():
                    emotion_index_map[label_class] = len(emotion_index_map.keys())
                labels.append(label_class)

                image = np.asarray([int(pixel) for pixel in row[self.csv_image_col].split(' ')], dtype=np.uint8).reshape(self.image_dimensions)
                image = self._reshape(image)
                images.append(image)

        vectorized_labels = self._vectorize_labels(emotion_index_map, labels)
        self._check_data_not_empty(images)

        return self._load_dataset(np.array(images), np.array(vectorized_labels), emotion_index_map)