Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Write fast OHLC aggregator #152

Closed
wesm opened this Issue · 1 comment

1 participant

@wesm
Owner

To work with GroupBy

@wesm wesm was assigned
@wesm
Owner

speed of current OHLC function can be improved:

def translate_grouping(how):
    if set(how) == set('ohlc'):
        return {'open'  : lambda arr: arr[0],
                'low'   : lambda arr: arr.min(),
                'high'  : lambda arr: arr.max(),
                'close' : lambda arr: arr[-1]}

    if how in 'last':
        def picker(arr):
            return arr[-1] if arr is not None and len(arr) else np.nan
        return picker

    raise ValueError("Unrecognized method: %s" % how)
@wesm wesm closed this in b15ae85
@wesm wesm referenced this issue from a commit
@wesm wesm Merge branch 'timeseries'
* timeseries: (200 commits)
  TST: don't use deprecated DateRange
  BUG: fix buglets surfacing from merge
  RLS: set released to false, bump dev version to 0.8.0
  BUG: fix major performance issue in DatetimeIndex.union affecting join performance on irregular indexes, remedying #1046
  ENH: add to_datetime method to Index, close #208
  ENH: legacy time rule support and refactoring, better alias handling. misc tests, #1041
  ENH: to_datetime will convert array of strings and NAs to datetime64 with NaT, close #999
  ENH: more datetime64 integration in core data algorithms per #996, close #1035
  ENH: handle datetime64 in block formation from dict of arrays in DataFrame constructor, close #1037
  BUG: fix broken time_rule usage in legacy DateRange, close #1036
  BUG: name inline method something different
  ENH: initial version of convert_to_annual for pandas, #736
  BUG: convert datetime64 -> datetime.datetime for matplotlib, close #1003
  ENH: integrate cython ohlc in groupby and test, close #152
  ENH: implement Cython OHLC function for groupby #152
  ENH: use cython bin groupers, fix bug in DatetimeIndex.__getitem causing slowness, some timeseries vbenches
  ENH: enable to_datetime to be vectorized, handle NAs, close #858
  TST: interactions between array of datetime objects and DatetimeIndex, bug fixes
  TST: remove errant foo and test_datetime64.py
  TST: moved test_datetime64.py tests to test_timeseries
  ...
63207b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.