@classmethod
def fromSubsample(cls, prices, datetimes, prices_per_day, aggregator=None):
    """Constructor: Creates a Stock instance by subsampling prices to a smaller
        number of prices per day than present in the original data.

        Args:
            prices (numpy.ndarray, float): A vector containing stock prices.
            datetimes (numpy.ndarray, int): A vector containing datetime.datetime
                    instances each containing date (and possible time) stamps
                    associated with the price observations.
            prices_per_day (int): Number of prices per day to sample. For example, if
                the original data has 400 prices per day, it is possible to
                subsample it to have 80 prices per day by taking every 5th price of
                the original data.
            aggregator (function): Function used to aggregate prices. If None is given,
                then the last value of the subsampling interval is used.

        Returns:
            (Stock): An instance of the Stock class.

        """
    return cls.fromDatetimes(prices, datetimes).subsample(prices_per_day,
        aggregator=aggregator)
