def r_argmax(v):
 if (len(v) == 1):
  return 0
 maxbid = max(v)
 maxbidders = [i for (i, b) in enumerate(v) if (b == maxbid)]
 return choice(maxbidders)

def r_argmax ( v ) : if ( len ( v ) == 1 ) : return 0 maxbid = max ( v ) maxbidders = [ i for ( i , b ) in enumerate ( v ) if ( b == maxbid ) ] return choice ( maxbidders )
acts like scipy argmax .