Python TypeError: нехешируемый тип: решение `dict`

–Ø–∑—ã–∫ Python –æ–ø—Ä–µ–¥–µ–ª—è–µ—Ç, —á—Ç–æ –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∫–ª—é—á–∞ –≤ —Å–ª–æ–≤–∞—Ä–µ . –í —Å–ª–æ–≤–∞—Ä–µ Python –≤—Å–µ –∫–ª—é—á–∏ –¥–æ–ª–∂–Ω—ã –±—ã—Ç—å —Ö–µ—à–∏—Ä—É–µ–º—ã–º–∏.

–ï—Å–ª–∏ –≤—ã –ø–æ–ø—ã—Ç–∞–µ—Ç–µ—Å—å –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –Ω–µ—Ö–µ—à–∏—Ä—É–µ–º—ã–π —Ç–∏–ø –∫–ª—é—á–∞ –ø—Ä–∏ –¥–æ–±–∞–≤–ª–µ–Ω–∏–∏ –∫–ª—é—á–∞ –≤ —Å–ª–æ–≤–∞—Ä—å, –≤—ã —Å—Ç–æ–ª–∫–Ω–µ—Ç–µ—Å—å —Å " TypeError: unhashable type: " dict " " –æ—à–∏–±–∫–∞.

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã –ø–æ–≥–æ–≤–æ—Ä–∏–º –æ —Ç–æ–º, —á—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç —ç—Ç–∞ –æ—à–∏–±–∫–∞ –∏ –ø–æ—á–µ–º—É –æ–Ω–∞ –≤–æ–∑–Ω–∏–∫–∞–µ—Ç. –ú—ã —Ä–∞—Å—Å–º–æ—Ç—Ä–∏–º –ø—Ä–∏–º–µ—Ä —ç—Ç–æ–π –æ—à–∏–±–∫–∏, —á—Ç–æ–±—ã –≤—ã –º–æ–≥–ª–∏ —É–∑–Ω–∞—Ç—å, –∫–∞–∫ –∏—Å–ø—Ä–∞–≤–∏—Ç—å –µ–µ –≤ —Å–≤–æ–µ–º –∫–æ–¥–µ.

TypeError: unhashable type: " dict "

–°–ª–æ–≤–∞—Ä–∏ —Å–æ—Å—Ç–æ—è—Ç –∏–∑ –¥–≤—É—Ö —á–∞—Å—Ç–µ–π: –∫–ª—é—á–µ–π –∏ —Ü–µ–Ω–Ω–æ—Å—Ç–∏. –ö–ª—é—á–∏ - —ç—Ç–æ –∏–¥–µ–Ω—Ç–∏—Ñ–∏–∫–∞—Ç–æ—Ä—ã, –ø—Ä–∏–≤—è–∑–∞–Ω–Ω—ã–µ –∫ –∑–Ω–∞—á–µ–Ω–∏—é. –ö–æ–≥–¥–∞ –≤—ã —Å—Å—ã–ª–∞–µ—Ç–µ—Å—å –Ω–∞ –∫–ª—é—á, –≤—ã —Å–º–æ–∂–µ—Ç–µ –ø–æ–ª—É—á–∏—Ç—å –∑–Ω–∞—á–µ–Ω–∏–µ, —Å–≤—è–∑–∞–Ω–Ω–æ–µ —Å —ç—Ç–∏–º –∫–ª—é—á–æ–º.

–¢–æ–ª—å–∫–æ —Ö–µ—à–∏—Ä—É–µ–º—ã–µ –æ–±—ä–µ–∫—Ç—ã –º–æ–≥—É—Ç –±—ã—Ç—å –∫–ª—é—á–∞–º–∏ –≤ —Å–ª–æ–≤–∞—Ä–µ. –ù–µ–∏–∑–º–µ–Ω—è–µ–º—ã–µ –æ–±—ä–µ–∫—Ç—ã, —Ç–∞–∫–∏–µ –∫–∞–∫ —Å—Ç—Ä–æ–∫–∏ , —Ü–µ–ª—ã–µ —á–∏—Å–ª–∞ , –∫–æ—Ä—Ç–µ–∂–∏ –∏ –∑–∞–º–æ—Ä–æ–∂–µ–Ω–Ω—ã–µ –Ω–∞–±–æ—Ä—ã –º–æ–≥—É—Ç –±—ã—Ç—å —Ö–µ—à–∏—Ä–æ–≤–∞–Ω—ã, –∑–∞ –Ω–µ–∫–æ—Ç–æ—Ä—ã–º–∏ –∏—Å–∫–ª—é—á–µ–Ω–∏—è–º–∏. –°–ª–æ–≤–∞—Ä–∏, —Å–ª–µ–¥–æ–≤–∞—Ç–µ–ª—å–Ω–æ, –Ω–µ–ª—å–∑—è –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∫–ª—é—á–∞ –≤ —Å–ª–æ–≤–∞—Ä–µ.

–ß—Ç–æ–±—ã –¥–æ–±–∞–≤–∏—Ç—å —ç–ª–µ–º–µ–Ω—Ç –≤ —Å–ª–æ–≤–∞—Ä—å, –≤—ã –¥–æ–ª–∂–Ω—ã —É–∫–∞–∑–∞—Ç—å –¥–µ–π—Å—Ç–≤–∏—Ç–µ–ª—å–Ω—ã–π —Ö–µ—à–∏—Ä—É–µ–º—ã–π –∫–ª—é—á. –ù–∞–ø—Ä–∏–º–µ—Ä, " name " - –¥–µ–π—Å—Ç–≤–∏—Ç–µ–ª—å–Ω—ã–π –∫–ª—é—á, –Ω–æ {" name & rdquo ;: " test " } –Ω–µ—Ç.

–ü—Ä–∏–º–µ—Ä —Å—Ü–µ–Ω–∞—Ä–∏—è

–ó–¥–µ—Å—å –º—ã –ø–∏—à–µ–º –ø—Ä–æ–≥—Ä–∞–º–º—É, –∫–æ—Ç–æ—Ä–∞—è –¥–æ–±–∞–≤–ª—è–µ—Ç –≤—Å–µ —Ç–æ—Ä—Ç—ã, –∫–æ—Ç–æ—Ä—ã–µ –±—ã–ª–∏ –ø—Ä–æ–¥–∞–Ω—ã –≤ –ø–µ–∫–∞—Ä–Ω–µ –±–æ–ª–µ–µ –ø—è—Ç–∏ —Ä–∞–∑, –∏–∑ –æ–¥–Ω–æ–≥–æ —Å–ª–æ–≤–∞—Ä—è –≤ –¥—Ä—É–≥–æ–π —Å–ª–æ–≤–∞—Ä—å.

–ù–∞—á–Ω–∏—Ç–µ —Å –æ–±—ä—è–≤–ª–µ–Ω–∏—è —Å–ø–∏—Å–∫–∞ —Ç–æ—Ä—Ç–æ–≤, –∫–æ—Ç–æ—Ä—ã–π —Å–æ–¥–µ—Ä–∂–∏—Ç —Å–ª–æ–≤–∞—Ä–∏ –ø–æ –∫–∞–∂–¥–æ–º—É —Ç–æ—Ä—Ç—É. –ú—ã —Ç–∞–∫–∂–µ –æ–ø—Ä–µ–¥–µ–ª—è–µ–º —Å–ª–æ–≤–∞—Ä—å, –≤ –∫–æ—Ç–æ—Ä–æ–º –º—ã –º–æ–∂–µ–º —Ö—Ä–∞–Ω–∏—Ç—å —Ç–æ—Ä—Ç—ã, –∫–æ—Ç–æ—Ä—ã–µ –±—ã–ª–∏ –ø—Ä–æ–¥–∞–Ω—ã –±–æ–ª–µ–µ –ø—è—Ç–∏ —Ä–∞–∑.

81% —É—á–∞—Å—Ç–Ω–∏–∫–æ–≤ –∑–∞—è–≤–∏–ª–∏, —á—Ç–æ –æ–Ω–∏ –ø–æ—á—É–≤—Å—Ç–≤–æ–≤–∞–ª–∏ —Å–µ–±—è –±–æ–ª–µ–µ —É–≤–µ—Ä–µ–Ω–Ω—ã–º–∏ –≤ —Å–≤–æ–∏—Ö –ø–µ—Ä—Å–ø–µ–∫—Ç–∏–≤–∞—Ö —Ç—Ä—É–¥–æ—É—Å—Ç—Ä–æ–π—Å—Ç–≤–∞ –≤ —Å—Ñ–µ—Ä–µ –≤—ã—Å–æ–∫–∏—Ö —Ç–µ—Ö–Ω–æ–ª–æ–≥–∏–π –ø–æ—Å–ª–µ –ø–æ—Å–µ—â–µ–Ω–∏—è —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è. –ü—Ä–æ–π–¥–∏—Ç–µ —É—á–µ–±–Ω—ã–π –∫—É—Ä—Å —É–∂–µ —Å–µ–≥–æ–¥–Ω—è.

–°—Ä–µ–¥–Ω–∏–π –≤—ã–ø—É—Å–∫–Ω–∏–∫ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –ø–æ—Ç—Ä–∞—Ç–∏–ª –º–µ–Ω–µ–µ —à–µ—Å—Ç–∏ –º–µ—Å—è—Ü–µ–≤ –Ω–∞ –ø–µ—Ä–µ—Ö–æ–¥–Ω—É—é –∫–∞—Ä—å–µ—Ä—É, –æ—Ç –Ω–∞—á–∞–ª–∞ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –¥–æ –ø–æ–∏—Å–∫–∞ —Å–≤–æ–µ–π –ø–µ—Ä–≤–æ–π —Ä–∞–±–æ—Ç—ã.

–ù–∞—à–∏ " —Ç–æ—Ä—Ç—ã " –°–ø–∏—Å–æ–∫ —Å–æ–¥–µ—Ä–∂–∏—Ç —Ç—Ä–∏ —Å–ª–æ–≤–∞—Ä—è. –ö–∞–∂–¥—ã–π —Å–ª–æ–≤–∞—Ä—å —Å–æ–¥–µ—Ä–∂–∏—Ç –¥–≤–∞ –∫–ª—é—á–∞ –∏ –∑–Ω–∞—á–µ–Ω–∏—è. –ö–ª—é—á–µ–≤—ã–µ –Ω–∞–∑–≤–∞–Ω–∏—è: " cake " –∏ " –ø—Ä–æ–¥–∞–Ω–æ & rdquo ;.

–¢–µ–ø–µ—Ä—å –º—ã –ø–∏—à–µ–º —Ü–∏–∫–ª for , –∫–æ—Ç–æ—Ä—ã–π –ø—Ä–æ—Å–º–∞—Ç—Ä–∏–≤–∞–µ—Ç –Ω–∞—à —Å–ø–∏—Å–æ–∫ —Ç–æ—Ä—Ç–æ–≤ –∏ –Ω–∞—Ö–æ–¥–∏—Ç —Ç–µ, –∫–æ—Ç–æ—Ä—ã–µ –±—ã–ª–∏ –ø—Ä–æ–¥–∞–Ω—ã –±–æ–ª–µ–µ –ø—è—Ç–∏ —Ä–∞–∑. –≠—Ç–∏ –ø–∏—Ä–æ–∂–Ω—ã–µ –±—É–¥—É—Ç –¥–æ–±–∞–≤–ª–µ–Ω—ã –≤ —Å–ª–æ–≤–∞—Ä—å " sold_more_than_five ":

–í –Ω–∞—à–µ–º —Ü–∏–∫–ª–µ for –º—ã —Å—Ä–∞–≤–Ω–∏–≤–∞–µ–º, –±–æ–ª—å—à–µ –ª–∏ –∑–Ω–∞—á–µ–Ω–∏–µ " sold " –≤ –∫–∞–∂–¥–æ–º —Å–ª–æ–≤–∞—Ä–µ, —á–µ–º 5. –ï—Å–ª–∏ –¥–∞, —ç—Ç–æ—Ç —ç–ª–µ–º–µ–Ω—Ç –¥–æ–±–∞–≤–ª—è–µ—Ç—Å—è –≤ –Ω–∞—à —Å–ª–æ–≤–∞—Ä—å " sold_more_than_five " –ó–∞—Ç–µ–º –Ω–∞ –∫–æ–Ω—Å–æ–ª—å –≤—ã–≤–æ–¥–∏—Ç—Å—è —Å–æ–æ–±—â–µ–Ω–∏–µ, –∏–Ω—Ñ–æ—Ä–º–∏—Ä—É—é—â–µ–µ –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è –æ —Ç–æ–º, —á—Ç–æ –∫–æ–Ω–∫—Ä–µ—Ç–Ω—ã–π —Ç–æ—Ä—Ç –±—ã–ª –ø—Ä–æ–¥–∞–Ω –±–æ–ª–µ–µ –ø—è—Ç–∏ —Ä–∞–∑.

–ü–æ—Å–ª–µ –≤—ã–ø–æ–ª–Ω–µ–Ω–∏—è –Ω–∞—à–µ–≥–æ —Ü–∏–∫–ª–∞ –º—ã –ø–µ—á–∞—Ç–∞–µ–º t –æ–Ω " sold_more_than_five " —Å–ª–æ–≤–∞—Ä—å –≤ –∫–æ–Ω—Å–æ–ª—å.

–ó–∞–ø—É—Å—Ç–∏–º –Ω–∞—à –∫–æ–¥, —á—Ç–æ–±—ã —É–±–µ–¥–∏—Ç—å—Å—è, —á—Ç–æ –Ω–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ —Ä–∞–±–æ—Ç–∞–µ—Ç:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –æ—à–∏–±–∫—É.

–†–µ—à–µ–Ω–∏–µ

< p> –ù–∞—à –∫–æ–¥ –Ω–µ —Ä–∞–±–æ—Ç–∞–µ—Ç, –ø–æ—Ç–æ–º—É —á—Ç–æ –º—ã –ø—ã—Ç–∞–µ–º—Å—è —Å–æ–∑–¥–∞—Ç—å –∫–ª—é—á —Å–ª–æ–≤–∞—Ä—è —Å –ø–æ–º–æ—â—å—é –¥—Ä—É–≥–æ–≥–æ —Å–ª–æ–≤–∞—Ä—è.

–ó–Ω–∞—á–µ–Ω–∏–µ " c " —Ä–∞–≤–Ω–æ —Å–ª–æ–≤–∞—Ä—é –∏–∑ –Ω–∞—à–µ–≥–æ " —Ç–æ—Ä—Ç–æ–≤ " —Å–ø–∏—Å–æ–∫. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –∫–æ–≥–¥–∞ –º—ã –ø—ã—Ç–∞–µ–º—Å—è –¥–æ–±–∞–≤–∏—Ç—å —Ç–æ–≤–∞—Ä –≤ " sold_more_than_five " —Å–ª–æ–≤–∞—Ä—å, –º—ã —Å–ª—É—á–∞–π–Ω–æ –ø—ã—Ç–∞–µ–º—Å—è –¥–æ–±–∞–≤–∏—Ç—å —Å–ª–æ–≤–∞—Ä—å –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∫–ª—é—á–∞:

–ö–æ–≥–¥–∞ –Ω–∞—à " if " –û–ø–µ—Ä–∞—Ç–æ—Ä –≤—ã–ø–æ–ª–Ω—è–µ—Ç—Å—è –¥–ª—è " –ú–æ—Ä–∫–æ–≤–Ω—ã–π —Ç–æ—Ä—Ç " —Ç–æ—Ä—Ç, –Ω–∞—à –∫–æ–¥ –ø—ã—Ç–∞–µ—Ç—Å—è –∑–∞–ø—É—Å—Ç–∏—Ç—å:

–≠—Ç–æ –Ω–µ–¥–æ–ø—É—Å—Ç–∏–º–æ, –ø–æ—Ç–æ–º—É —á—Ç–æ –º—ã –ø—ã—Ç–∞–µ–º—Å—è –¥–æ–±–∞–≤–∏—Ç—å —Å–ª–æ–≤–∞—Ä—å –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∫–ª—é—á–∞ –≤ —Å–ª–æ–≤–∞—Ä—å. –ú—ã –º–æ–∂–µ–º —Ä–µ—à–∏—Ç—å —ç—Ç—É –ø—Ä–æ–±–ª–µ–º—É, –∏—Å–ø–æ–ª—å–∑—É—è c [" name "] –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∏–º–µ–Ω–∏ –∫–ª—é—á–∞ –Ω–∞—à–µ–≥–æ —Å–ª–æ–≤–∞—Ä—è:

–ó–∞–ø—É—Å—Ç–∏–º –Ω–∞—à –∫–æ–¥ —Å —ç—Ç–∏–º –∏–∑–º–µ–Ω–µ–Ω–Ω—ã–º –∫–æ–¥–æ–º:

–ù–∞—à –∫–æ–¥ —Ä–∞–±–æ—Ç–∞–µ—Ç —É—Å–ø–µ—à–Ω–æ. –¢–µ–ø–µ—Ä—å –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º –Ω–∞–∑–≤–∞–Ω–∏–µ –∫–∞–∂–¥–æ–≥–æ —Ç–æ—Ä—Ç–∞ –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∫–ª—é—á–∞, –∞ –Ω–µ —Å–ª–æ–≤–∞—Ä—è.

–ó–∞–∫–ª—é—á–µ–Ω–∏–µ

–û—à–∏–±–∫–∞ " TypeError: unhashable type: " dict " " –≤–æ–∑–Ω–∏–∫–∞–µ—Ç, –∫–æ–≥–¥–∞ –≤—ã –ø—ã—Ç–∞–µ—Ç–µ—Å—å —Å–æ–∑–¥–∞—Ç—å —ç–ª–µ–º–µ–Ω—Ç –≤ —Å–ª–æ–≤–∞—Ä–µ, –∫–ª—é—á –∫–æ—Ç–æ—Ä–æ–≥–æ —è–≤–ª—è–µ—Ç—Å—è –Ω–µ—Ö–µ—à–∏—Ä—É–µ–º—ã–º. –æ–±—ä–µ–∫—Ç. –í –∫–∞—á–µ—Å—Ç–≤–µ –∫–ª—é—á–∞ –≤ —Å–ª–æ–≤–∞—Ä–µ –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ç–æ–ª—å–∫–æ –Ω–µ–∏–∑–º–µ–Ω—è–µ–º—ã–µ –æ–±—ä–µ–∫—Ç—ã, —Ç–∞–∫–∏–µ –∫–∞–∫ —Å—Ç—Ä–æ–∫–∏, –∫–æ—Ä—Ç–µ–∂–∏ –∏ —Ü–µ–ª—ã–µ —á–∏—Å–ª–∞.

–ß—Ç–æ–±—ã —É—Å—Ç—Ä–∞–Ω–∏—Ç—å —ç—Ç—É –æ—à–∏–±–∫—É, —É–±–µ–¥–∏—Ç–µ—Å—å, —á—Ç–æ –≤—ã –∏—Å–ø–æ–ª—å–∑—É–µ—Ç–µ —Ç–æ–ª—å–∫–æ —Ö–µ—à–∏—Ä—É–µ–º—ã–µ –æ–±—ä–µ–∫—Ç—ã –ø—Ä–∏ —Å–æ–∑–¥–∞–Ω–∏–∏ —ç–ª–µ–º–µ–Ω—Ç–∞ –≤ —Å–ª–æ–≤–∞—Ä—å. –¢–µ–ø–µ—Ä—å –≤—ã –≥–æ—Ç–æ–≤—ã —Ä–µ—à–∏—Ç—å —ç—Ç—É —Ä–∞—Å–ø—Ä–æ—Å—Ç—Ä–∞–Ω–µ–Ω–Ω—É—é –æ—à–∏–±–∫—É Python, –∫–∞–∫ –ø—Ä–æ—Ñ–µ—Å—Å–∏–æ–Ω–∞–ª—å–Ω—ã–π —Ä–∞–∑—Ä–∞–±–æ—Ç—á–∏–∫!

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

News


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method