Pandas OHLC aggregation on OHLC data

This is similar to the answer you linked, but it a little cleaner, and faster, because it uses the optimized aggregations, rather than lambdas. Note that the resample(…).agg(…) syntax requires pandas version 0.18.0. In [101]: df.resample(‘1H’).agg({‘openbid’: ‘first’, ‘highbid’: ‘max’, ‘lowbid’: ‘min’, ‘closebid’: ‘last’}) Out[101]: lowbid highbid closebid openbid ctime 2015-09-30 23:00:00 1.11687 1.11712 1.11708 1.117

Pandas Resampling error: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex

Convert the integer timestamps in the index to a DatetimeIndex: data.index = pd.to_datetime(data.index, unit=”s”) This interprets the integers as seconds since the Epoch. For example, given data = pd.DataFrame( {‘Timestamp’:[1313331280, 1313334917, 1313334917, 1313340309, 1313340309], ‘Price’: [10.4]*3 + [10.5]*2, ‘Volume’: [0.779, 0.101, 0.316, 0.150, 1.8]}) data = data.set_index([‘Timestamp’]) # Price Volume # Timestamp # 1313331280 10.4 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)