Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. salary = employees['Salary']
  2.  
  3. if Salary > 50000:
  4. print('Over £50,000')
  5. else:
  6. print('Under £50,000')
  7.  
  8. def SalaryCheck():
  9. if Salary > 50000:
  10. print('Over £50,000')
  11. else:
  12. print('Under £50,000')
  13.  
  14. employees.Salary.apply(SalaryCheck)
  15.  
  16.  
  17. Traceback (most recent call last):
  18. File "<input>", line 1, in <module>
  19. File "C:UsersPeterPycharmProjectsuntitledvenvlibsite- packagespandascoregeneric.py", line 1556, in __nonzero__
  20. self.__class__.__name__
  21. ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  22.  
  23. Traceback (most recent call last):
  24. File "<input>", line 1, in <module>
  25. File "C:UsersPeterPycharmProjectsuntitledvenvlibsite- packagespandascoreseries.py", line 4038, in apply
  26. mapped = lib.map_infer(values, f, convert=convert_dtype)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement