Attributeerror: 'Nonetype' Object has no attribute 'fileno'

Asked

Viewed 213 times

0

Good morning! I’m starting my study in python-pandas, and I’m having a problem that looks like simple resolution. But not for me. Yet. I’m following this tutorial: https://pandas.pydata.org/pandas-docs/stable/cookbook.html

I can create the dataframe, but when I try the command "df.Loc[df.AAA >= 5,'BBB'] = -1", I have an error. The error message is large, but the end is this: "Attributeerror: 'Nonetype' Object has no attribute 'fileno'". Would anyone know what to do to solve this problem? Thank you

  • Put the code in the question and the error message. Do this by joining [Dit]; take the [tour] community to learn more about the site.

  • Or you put some intermediate value in the variable df, or there is something wrong with your installation. What is the return if you put only "df" and enter after this error? It should be the dataframe with the original values. If you restart the example, see the output of the dataframe, and still have the same error, try uninstalling the pandas, notebook and Python and installing everything back. (This is not a common or recommended solution for Python problems, but this error message suggests an internal library problem, and it’s the first assignment to transform df)

  • I will reinstall everything. The error appears when trying to use .loc. When typing df the dataframe appears normally. I have not added anything. I just followed the example of the tutorial. Thank you.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.