Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
threehappy opened this issue Mar 22, 2022 · 3 comments
Closed
2 tasks done
Labels
Needs Triage Issue that has not been reviewed by a pandas team member Usage Question

Comments

@threehappy
Copy link

Research

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

  • 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'

@threehappy threehappy added Needs Triage Issue that has not been reviewed by a pandas team member Usage Question labels Mar 22, 2022
@twoertwein
Copy link
Member

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.

@mroeschke
Copy link
Member

mroeschke commented Mar 22, 2022

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.

@matteogabba
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Triage Issue that has not been reviewed by a pandas team member Usage Question
Projects
None yet
Development

No branches or pull requests

4 participants