def split(self, n_data: int) -> Tuple[TargetsLoader, TargetsLoader]:
        """
        Split a targets loader into two targets loaders.

        Parameters
        ----------
        n_data: int
            Number of data point after which the targets loader should be split. The first returned targets loader will
            contain exactly `n_data` targets. The second one will contain the remaining ones.

        Returns
        -------
        Tuple[TargetsLoader, TargetsLoader]
            The two targets loaders made out of the original one.
        """

        def targets_loader1():
            count = 0
            for targets in self:
                if count == n_data:
                    break
                if count + targets.shape[0] <= n_data:
                    count += targets.shape[0]
                    yield targets
                else:
                    targets = targets[: n_data - count]
                    count = n_data
                    yield targets

        def targets_loader2():
            count = 0
            for targets in self:
                if count > n_data:
                    yield targets
                elif (count <= n_data) and (count + targets.shape[0] > n_data):
                    count2 = count
                    count += targets.shape[0]
                    targets = targets[n_data - count2 :]
                    yield targets
                else:
                    count += targets.shape[0]

        return self.from_callable_iterable(
            targets_loader1
        ), self.from_callable_iterable(targets_loader2)

        Split a targets loader into two targets loaders.

        Parameters
        ----------
        n_data: int
            Number of data point after which the targets loader should be split. The first returned targets loader will
            contain exactly `n_data` targets. The second one will contain the remaining ones.

        Returns
        -------
        Tuple[TargetsLoader, TargetsLoader]
            The two targets loaders made out of the original one.
        
fortuna/data/loader/array_loaders.py