-3

input code:

randomlabel = [(random.randint(1,10),i) for i in geneex]
sortlabel = sorted(randomlabel)
store = {}
for i,j in sortlabel:
store.setdefault(i,[])

for i,j in sortlabel:
store[i].append(j)
print store

I got the rather cryptic error message

sortlabel = sorted(randomlabel)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

1 Answers1

0

Here the array comparison returns the boolean expression.

The Methods any() and all() reduce values over the array.

It would work fine if you replace the code with np.allclose()

Please have a look here ..It would help you out

Community
  • 1
  • 1
Avinash Babu
  • 6,171
  • 3
  • 21
  • 26