Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Value error
#1
for data in alldata:
    if (data['Familysize']==1):
        data['isalone']=1
What is the error in this simple code?

Error:
ValueError Traceback (most recent call last) <ipython-input-20-853203b87769> in <module> 1 for data in alldata: ----> 2 if (data['Familysize']==1): 3 data['isalone']=1 ~\Anaconda3\lib\site-packages\pandas\core\generic.py in __nonzero__(self) 1553 "The truth value of a {0} is ambiguous. " 1554 "Use a.empty, a.bool(), a.item(), a.any() or a.all().".format( -> 1555 self.__class__.__name__ 1556 ) 1557 ) ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Reply


Messages In This Thread
Value error - by jithin123 - Apr-10-2020, 09:39 PM
RE: Value error - by avinash8s - Apr-11-2020, 06:29 AM
RE: Value error - by jefsummers - Apr-12-2020, 10:37 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020