示例#1
0
def get_anchor_index(index, freq):
    ideal = get_time_index(freq)

    start = index[0]
    start = ideal.asof(start)
    end = index[-1]
    start, end = _get_range_edges(index, offset=freq, closed='right')
    ind = DatetimeIndex(start=start, end=end, freq=freq)
    return ind
示例#2
0
def get_anchor_index(index, freq):
    ideal = get_time_index(freq)

    start = index[0]
    start = ideal.asof(start)
    end = index[-1]
    start, end = _get_range_edges(index, offset=freq, closed='right')
    ind = DatetimeIndex(start=start, end=end, freq=freq)
    return ind
示例#3
0
 def generate_xticks(self, index, freq):
     """
         Ticks are really just the bin edges.
     """
     start = index[0]
     end = index[-1]
     start, end = _get_range_edges(index, offset=freq, closed='right')
     ind = DatetimeIndex(start=start, end=end, freq=freq)
     bins = lib.generate_bins_dt64(index.asi8, ind.asi8, closed='right')
     bins = np.unique(bins)
     return bins
示例#4
0
文件: charting.py 项目: wenzi/trtools
 def generate_xticks(self, index, freq):
     """
         Ticks are really just the bin edges.
     """
     start = index[0]
     end = index[-1]
     start, end = _get_range_edges(index, offset=freq, closed='right')
     ind = DatetimeIndex(start=start, end=end, freq=freq)
     bins = lib.generate_bins_dt64(index.asi8, ind.asi8, closed='right')
     bins = np.unique(bins)
     return bins