KeyError Traceback (most recent call last)
<ipython-input-19-f1e64dc1b990> in <module>()
2 # Compute Passive Aggressive Mean Reversion with no given weights and epsilon of 0.3.
3 pamr = PAMR(optimization_method=0, epsilon=0.3)
----> 4 pamr.allocate(asset_prices=us_equity, resample_by='W', verbose=True)
5
6 # Compute Passive Aggressive Mean Reversion - 1 with given user weights and epsilon of 0.4.
5 frames
/usr/local/lib/python3.7/dist-packages/portfoliolab/online_portfolio_selection/base.py in allocate(self, asset_prices, weights, resample_by, verbose)
80
81 # Initialize all variables.
---> 82 self._initialize(asset_prices, weights, resample_by)
83
84 # Iterate through data and calculate weights.
/usr/local/lib/python3.7/dist-packages/portfoliolab/online_portfolio_selection/pamr.py in _initialize(self, asset_prices, weights, resample_by)
52 'M' for Month. The inputs are based on pandas' resample method.
53 """
---> 54 super(PAMR, self)._initialize(asset_prices, weights, resample_by)
55
56 # Check that epsilon is greater than 0.
/usr/local/lib/python3.7/dist-packages/portfoliolab/online_portfolio_selection/base.py in _initialize(self, asset_prices, weights, resample_by)
105 # Resample asset.
106 if resample_by is not None:
--> 107 asset_prices = asset_prices.resample(resample_by).last()
108
109 # Set asset names.
/usr/local/lib/python3.7/dist-packages/pandas/core/generic.py in resample(self, rule, axis, closed, label, convention, kind, loffset, base, on, level, origin, offset)
8078 >>> df2 = pd.DataFrame(d2,
8079 ... index=pd.MultiIndex.from_product([days,
-> 8080 ... ['morning',
8081 ... 'afternoon']]
8082 ... ))
/usr/local/lib/python3.7/dist-packages/pandas/core/resample.py in <module>()
34
35
---> 36 class Resampler(_GroupBy, ShallowMixin):
37 """
38 Class for resampling datetimelike data, a groupby-like operation.
/usr/local/lib/python3.7/dist-packages/pandas/core/resample.py in Resampler()
782 return self._upsample(method, limit=limit)
783
--> 784 @Appender(_shared_docs["interpolate"] % _shared_docs_kwargs)
785 def interpolate(
786 self,
KeyError: 'interpolate'