Exemple #1
0
    def __init__(self, index, warn=True):
        self.index = index
        self.values = np.asarray(index).view('i8')
        self.warn = warn

        if len(index) < 3:
            raise ValueError('Need at least 3 dates to infer frequency')

        self.deltas = lib.unique_deltas(self.values)
        self.is_unique = len(self.deltas) == 1
        self.is_monotonic = self.index.is_monotonic
Exemple #2
0
    def __init__(self, index, warn=True):
        self.index = index
        self.values = np.asarray(index).view('i8')
        self.warn = warn

        if len(index) < 3:
            raise ValueError('Need at least 3 dates to infer frequency')

        self.deltas = lib.unique_deltas(self.values)
        self.is_unique = len(self.deltas) == 1
        self.is_monotonic = self.index.is_monotonic
Exemple #3
0
    def __init__(self, index, warn=True):
        from pandas.tseries.index import DatetimeIndex

        if not isinstance(index, DatetimeIndex):
            index = DatetimeIndex(index)

        self.index = index
        self.values = np.asarray(index).view('i8')
        self.warn = warn

        if len(index) < 3:
            raise ValueError('Need at least 3 dates to infer frequency')

        self.deltas = lib.unique_deltas(self.values)
        self.is_unique = len(self.deltas) == 1
        self.is_monotonic = self.index.is_monotonic
Exemple #4
0
 def ydiffs(self):
     return lib.unique_deltas(self.fields['Y'].astype('i8'))
Exemple #5
0
 def mdiffs(self):
     nmonths = self.fields['Y'] * 12 + self.fields['M']
     return lib.unique_deltas(nmonths.astype('i8'))
Exemple #6
0
 def ydiffs(self):
     return lib.unique_deltas(self.fields["Y"].astype("i8"))
Exemple #7
0
 def mdiffs(self):
     nmonths = self.fields["Y"] * 12 + self.fields["M"]
     return lib.unique_deltas(nmonths.astype("i8"))
Exemple #8
0
 def deltas(self):
     return lib.unique_deltas(self.values)
Exemple #9
0
 def deltas(self):
     return lib.unique_deltas(self.values)