Guest User

Untitled

a guest
Nov 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. if df['a'] > 0:
  2. df['c'] = df['a']
  3. if df['b'] > 0:
  4. df['c'] = min(df['a'],df['b'])
  5.  
  6. ---------------------------------------------------------------------------
  7. ValueError Traceback (most recent call last)
  8. <ipython-input-17-00945ffeddda> in <module>()
  9. ----> 1 if df['a'] > 0:
  10. 2 df['c'] = df['a']
  11. 3 if df['b'] > 0:
  12. 4 df['c'] = min(df['a'],df['b'])
  13.  
  14. /opt/python/python35/lib/python3.5/site-packages/pandas/core/generic.py in __nonzero__(self)
  15. 1574 raise ValueError("The truth value of a {0} is ambiguous. "
  16. 1575 "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
  17. -> 1576 .format(self.__class__.__name__))
  18. 1577
  19. 1578 __bool__ = __nonzero__
  20.  
  21. ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Add Comment
Please, Sign In to add comment