5

I have seen several of these questions along with some answers about it all however either I'm super dumb and can't work out what they are meaning or I'm just extremely dumb and I'm doing it wrong

I am getting this warning using Pandas and Pandas_datareader

"You may find the 'util.testing' code in pandas_datareader, which is separate from pandas."

This is one of the answers I have seen and I don't understand how to fix it I don't have any code that has 'until.testing' it so I don't know to remove it when it's not there and adding it did nothing but due to the warning, my program won't work on my raspberry pi which is the intended location.

please help

Hoskj578
  • 87
  • 2
  • 8
  • Can you edit your question to provide the code that produced this error and the questions and answers that you refer to in your question? It's not possible to help you with the information that you've provided so far. – Jason Mar 23 '20 at 21:56
  • If it's only this warning that is preventing you from running the program in your raspberry pi and you are ok with not seeing any other possible warnings, you could try disabling the warnings from Python by running your progam with `python -W ignore `. Taken from https://stackoverflow.com/questions/14463277/how-to-disable-python-warnings – mastropi Apr 04 '20 at 10:23

2 Answers2

4

It is a warning, it should not prevent your program to run properly. However, it is true that it uglifies the console output. If you want to suppress the warning adding the following lines to the imports of your program will do the job (as suggested here):

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

Hope it helps.

joanlofe
  • 3,360
  • 2
  • 26
  • 44
  • Random warnings from sub-packages have plagued me for months in my package. Putting this into top the `__init__.py` file in, the first file imported when someone imports my package silenced them. Doesn't work well if you try to put it into places where pandas is later imported. – Marc Maxmeister Apr 22 '21 at 18:50
  • 1
    I don't want to suppress warnings. Rather I would like to understand those. Any pointers/answers on what is python trying to warn and how to improve the code? My Code: https://colab.research.google.com/drive/1AknJaskJVKJfEnov5ZcrFqPySp3gExX3?usp=sharing – Dr Nisha Arora Jul 25 '21 at 04:51
0

open the file:

/Users/your_user_name/anaconda3/lib/python3.7/site-packages/statsmodels/tools/_testing.py

Replace:

from pandas.util.testing import assert_frame_equal

with

from pandas.testing import assert_frame_equal

This solution was taken from this github comment.

T.Lipperz
  • 581
  • 2
  • 5
  • 7