When i run this function - I get the following error below: I also checked my numpy version is 1.14 (which is higher than 1.7 when this issue was reported/resolved previously) - but still cant get to run this without error.
def rank_to_dict(ranks, names, order=1):
minmax = MinMaxScaler()
ranks = minmax.fit_transform(order*np.array([ranks]).T).T[0]
ranks = map(lambda x: round(x, 2), ranks)
return dict(zip(names, ranks ))
Error
<ipython-input-12-d23066e235d3> in rank_to_dict(ranks, names, order)
21 def rank_to_dict(ranks, names, order=1):
22 minmax = MinMaxScaler()
---> 23 ranks = minmax.fit_transform(order*np.array([ranks]).T).T[0]
24 ranks = map(lambda x: round(x, 2), ranks)
25 return dict(zip(names, ranks ))
TypeError: unsupported operand type(s) for *: 'int' and 'map
ranks
when passed into the function originally? – n1k31t4 Jun 25 '18 at 21:26