Python Forum
ValueError: The truth value of a Series is ambiguous ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ValueError: The truth value of a Series is ambiguous ?
#2
You got this error because v (or maxVal) in line #39 is a vector or a matrix.
It is unclear why do you introduce data dict (line # 36). You can do everything using pandas.
If you are tyring to select rows where the maximum value is located, you can do it as follows:
df[(df == df.values.max()).any(axis=1)]
Reply


Messages In This Thread
RE: ValueError: The truth value of a Series is ambiguous ? - by scidam - Aug-01-2019, 12:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Data cardinality is ambiguous: x sizes: 51 y sizes: 26 sidra 0 2,328 Oct-03-2020, 11:43 AM
Last Post: sidra
  error : value of a DataFrame is ambiguous Sonata 1 2,264 Apr-24-2020, 05:40 PM
Last Post: anbu23
  TensorFlow get error - array with more than one element is ambiguous vokoyo 3 5,566 Nov-07-2019, 01:12 PM
Last Post: ThomasL
  ValueError: The truth value of an array with more than one element is ambiguous. Eliza5 1 14,355 Apr-02-2018, 12:03 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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