Python Forum
AttributeError: module 'string' has no attribute 'uppercase'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AttributeError: module 'string' has no attribute 'uppercase'
#11
At last I read the whole assignment and now I see you did exactly what you should do. Thumbs Up
And indeed you need to delete certain items from the dictionary afterwards. But you cannot delete them in the same loop. So the solution would be to fill a list of the keys that need to be deleted in the loop "for word, count in freq.items():".
After that loop you start a new loop over the "to_be_deleted" list. In that loop you can delete the items from the dictionary.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  AttributeError: 'NoneType' object has no attribute 'group' MaartenRo 3 185 Jan-02-2022, 09:53 AM
Last Post: snippsat
  AttributeError: 'NoneType' object has no attribute 'group' MaartenRo 3 156 Jan-01-2022, 04:16 PM
Last Post: MaartenRo
  AttributeError: 'Message' object has no attribute 'split' helpme1 3 2,114 Dec-14-2021, 07:20 AM
Last Post: alexaminar
  AttributeError: 'DataFrame' object has no attribute 'Articles' Anldra12 5 2,627 Jun-17-2021, 04:54 PM
Last Post: Larz60+
  AttributeError: 'Node' object has no attribute 'insert' Anldra12 4 2,109 May-11-2021, 10:12 AM
Last Post: Anldra12
  AttributeError: 'tuple' object has no attribute 'format' Anldra12 7 9,099 Apr-13-2021, 07:45 AM
Last Post: Anldra12
  AttributeError class object has no attribute list object scttfnch 5 1,273 Feb-24-2021, 10:03 PM
Last Post: scttfnch
  AttributeError: 'NoneType' object has no attribute 'next' loves 2 3,834 Dec-15-2020, 11:30 PM
Last Post: bowlofred
  AttributeError: 'str' object has no attribute 'name' deathsperance 4 4,727 Sep-25-2020, 04:36 PM
Last Post: Larz60+
  AttributeError: 'collections.OrderedDict' object has no attribute 'value_counts Kristenl2784 4 4,084 Jul-17-2020, 01:50 AM
Last Post: palladium

Forum Jump:

User Panel Messages

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