Я звоню .loc () на панде Dataframe, используя версию 0.25.1 (pd. версия = 25.1)
В предыдущих версиях pandas была ошибка (до 0.21 Iдумаю) который, кажется, вернулся сюда.
10/17/2019 00:02:26 WARNING TREND BASKET FX.LS.CAD SHRINK 0.1, LIMITS (-0.2, 0.8), failed 2017/10/21-2018/06/30: reindex() got an unexpected keyword argument 'axis'
Traceback (most recent call last):
File "/Users/adamarla/PycharmProjects/research/trendfollowing/adamarla/factors/model.py", line 234, in calc_trend_basket_weights_ts
**vol_estimates[np.isnan(vol_estimates)] = vol_estimates.index.map(lambda c: np.sqrt(cov[c].loc[c]))**
File "/Users/adamarla/anaconda3/envs/trading/lib/python3.7/site-packages/pandas/core/series.py", line 1241, in __setitem__
setitem(key, value)
File "/Users/adamarla/anaconda3/envs/trading/lib/python3.7/site-packages/pandas/core/series.py", line 1232, in setitem
self._where(~key, value, inplace=True)
File "/Users/adamarla/anaconda3/envs/trading/lib/python3.7/site-packages/pandas/core/generic.py", line 9112, in _where
transpose=self._AXIS_REVERSED,
File "/Users/adamarla/anaconda3/envs/trading/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 563, in putmask
return self.apply("putmask", **kwargs)
File "/Users/adamarla/anaconda3/envs/trading/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 436, in apply
kwargs[k] = obj.reindex(b_items, axis=axis, copy=align_copy)
**TypeError: reindex() got an unexpected keyword argument 'axis'**