0

I want to select only the rows with all the values equal to 0

I have tried also using & and removing the parenthesis. I get prompted this error every time:

  train[(train['severe_toxic'] == 0) and
               (train['obscene'] == 0)  and
               (train['threat'] == 0) and
               (train['insult'] == 0) and  
               (train['identity_hate'] == 0) ]

    Traceback (most recent call last):

      File "<ipython-input-65-0768a788df43>", line 1, in <module>
        train[(train['severe_toxic'] == 0) and

      File "C:\Users\los40\Downloads\WinPython-64bit-3.5.4.1Qt5\python-3.5.4.amd64\lib\site-packages\pandas\core\generic.py", line 1121, in __nonzero__
        .format(self.__class__.__name__))

    ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Gotey
  • 449
  • 4
  • 15
  • 41

0 Answers0