-2

I am using the python code : dataReg=pd.DataFrame(data.loc[data['Store']=='1']) to extract the data of store 1.

But following warning encountered.

C:\Users\hp\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py:253: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  res_values = method(rvalues)

Can anyone suggest how to Resolve this?

Subbu VidyaSekar
  • 2,503
  • 3
  • 21
  • 39
  • 1
    Does this answer your question? https://stackoverflow.com/questions/40659212/futurewarning-elementwise-comparison-failed-returning-scalar-but-in-the-futur – gmdev Oct 19 '20 at 12:02

2 Answers2

0

It looks to me like you are comparing an int in your table to a string in your code. Try removing the '' from the statement.

Also if data is already a DataFrame you don't need to use pd.DataFrame again.

dataReg=data[data['Store']==1])
B. Bogart
  • 998
  • 6
  • 15
-2

Future Warnings is just a small warning which is not be to be concerned about It can be ignored so it doesn't get displayed.

Try This code:

import warnings as w
w.filterwarnings('ignore')