Home > Software engineering >  Pandas sends me a warning when using pd.reset_option('all')
Pandas sends me a warning when using pd.reset_option('all')

Time:10-03

I am trying to reset all my rows and columns to pandas' default DataFrame format (truncated)

pd.reset_option('all')

but I'm getting a warning:

C:\Users\victo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pandas\_config\config.py:630: FutureWarning:
: boolean
    use_inf_as_null had been deprecated and will be removed in a future
    version. Use `use_inf_as_na` instead.

What command can I use instead? I tried to follow the recommendation "Use use_inf_as_na" but it is not working.

Thanks in advance.

CodePudding user response:

Add silent=True, and there would be no warning:

pd.reset_option('all', silent=True)

IMO This is the best way.

  • Related