Research

  • [X] I have searched the [pandas] tag on StackOverflow for similar questions.

  • [X] I have asked my usage related question on StackOverflow.

Link to question on StackOverflow

AttributeError: 'pandas._libs.properties.CachedProperty' object has no attribute 'func'QST:

Question about pandas

%matplotlib inline

import numpy as np import pandas as pd import pandas_datareader.data as web

from pyfinance.ols import PandasRollingOLS

replaces pyfinance.ols.PandasRollingOLS (no longer maintained)

from statsmodels.regression.rolling import RollingOLS import statsmodels.api as sm from talib import RSI, BBANDS, MACD, NATR, ATR

from sklearn.feature_selection import mutual_info_classif, mutual_info_regression

import matplotlib.pyplot as plt import seaborn as sns


--> 516 @Appender(RegressionResults.aic.func.doc) 517 def aic(self): 518 return self._wrap(RegressionResults.aic.func(self)) 520 @cache_readonly 521 @Appender(RegressionResults.bic.func.doc) 522 def bic(self):

AttributeError: 'pandas._libs.properties.CachedProperty' object has no attribute 'func'

Comment From: twoertwein

func was renamed to fget in #43828 (since 1.4) to be more consistent with python's property. I assume that the external pandas packages you are importing pandas_datareader and/or pyfinance haven't yet been tested against pandas 1.4. Unfortunately, I forgot to add a whatsnewentry for this change in #43828.

Comment From: mroeschke

It appears that this an downstream issue in the packages mentioned since those libraries are using private APIs so they can be subject to change. I would recommend opening up an issue in the libraries you used to address the pandas usages.

Comment From: matteogabba

After reinstalling a fresh virtual env with the latest version of statsmodels, I solved the problem. I noticed though that the latest version of statsmodel is not available on the conda channels.

Thanks for your help!

Matteo