Skip to content
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

Deprecated attributes: AttributeError: 'DataFrame' object has no attribute 'ix' #13

Closed
sdworf opened this issue Dec 10, 2020 · 2 comments

Comments

@sdworf
Copy link

sdworf commented Dec 10, 2020

Some attributes are deprecated in current pandas version (1.1.5).

Traceback (most recent call last):
  File ".\main.py", line 149, in <module>
    Dyn_MFA_System.Consistency_Check()
  File ".\Programs\Python\Python39\lib\site-packages\odym\modules\ODYM_Classes.py", line 143, in Consistency_Check
    A = self.IndexTableCheck()
  File ".\Programs\Python\Python39\lib\site-packages\odym\modules\ODYM_Classes.py", line 103, in IndexTableCheck
    if self.IndexTable.ix[indx]['Dimension']  != self.IndexTable.ix[indx]['Classification'].Dimension:
  File ".\Programs\Python\Python39\lib\site-packages\pandas\core\generic.py", line 5141, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'ix'

I found the following fix:
https://stackoverflow.com/questions/59991397/attributeerror-dataframe-object-has-no-attribute-ix

Which version of pandas do you use or recommend to run the odym package with?

#4 indicates pandas 0.22.0, is that still accurate?

Thank you

@guest-cc
Copy link

guest-cc commented Jul 8, 2021

That's a helpful comment! This issue might also be relevant for the Jupyter notebook tutorials from the IE website.

romainbilly added a helpful pull request #14 to change .ix to .iloc for the relevant code passages. (You can also update the code on your branch.)

In the meantime, you could also create a new environment in Anaconda with an older pandas version (e.g. < 0.20) to work around this change.

@stefanpauliuk
Copy link
Member

Thanks to both @sdworf and @guest-cc for checking! The PR that replaces pd.ix by pd.loc is now merged and the main branch of ODYM contains the new version. Will still check the .ipynb tutorials for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants