1

This is the code sample
df is a data frame with 26 columns, column "e" has values ranging from -1 to 6

if df['e'] <=0 :
        print("1")
    else:
        print("2")

i know i can get the true false by just running the code as

df['e'] <=0

but I want to do operations based on this condition

ERROR: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Teoretic
  • 2,483
  • 1
  • 19
  • 28
Rishi
  • 313
  • 1
  • 4
  • 18

0 Answers0