Python Forum
TypeError: unhashable type: 'set'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: unhashable type: 'set'
#1
Hi all

I have two dictionaries, containing (for example):
dict1 = {'k1':{1,2,3},'k2':{4,5,6},'k3':{7,8,9}}
dict2 = {1:12,2:23,3:34,4:45,5:56,6:67,7:78,8:89,9:90}
I want to find the dict1 set value, having max of dict2 value.
I do:
print(max(list(dict1.values()),key=dict2.get))
and get "TypeError: unhashable type: 'set'"

What am I doing wrong?
Reply


Messages In This Thread
TypeError: unhashable type: 'set' - by Stager - Jun-08-2020, 01:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unhashable error - Histogram code lsbpython 1 1,031 Aug-07-2022, 04:02 PM
Last Post: Yoriz
  TypeError: unsupported operand type(s) for +: 'dict' and 'int' nick12341234 1 9,444 Jul-15-2022, 04:04 AM
Last Post: ndc85430
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 2,280 May-07-2022, 08:40 AM
Last Post: ibreeden
  You have any idea, how fix TypeError: unhashable type: 'list' lsepolis123 2 3,101 Jun-02-2021, 07:55 AM
Last Post: supuflounder
  TypeError: __str__ returned non-string (type tuple) Anldra12 1 7,474 Apr-13-2021, 07:50 AM
Last Post: Anldra12
  TypeError: 'type' object is not subscriptable Stef 1 4,604 Aug-28-2020, 03:01 PM
Last Post: Gribouillis
  TypeError: __repr__ returned non-string (type dict) shockwave 0 3,232 May-17-2020, 05:56 PM
Last Post: shockwave
  calculate_bai -- TypeError: unsupported operand type(s) for *: 'float' and 'NoneType' pantherd 1 3,294 Apr-21-2020, 12:31 PM
Last Post: anbu23
  TypeError: can't multiply sequence by non-int of type 'float' DimosG 3 3,424 Apr-04-2020, 05:16 AM
Last Post: michael1789
  TypeError: size; expecting a recognized type filling string dict a11_m11 0 2,584 Feb-10-2020, 08:26 AM
Last Post: a11_m11

Forum Jump:

User Panel Messages

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