def freq(self, x=None): """ Number of data items per year. If data does not contain datetime index, assume daily frequency with 252 trading days a year.""" x = x or self.r return tools.freq(x.index)