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
  module 'openpyxl.workbook' has no attribute 'active' lsaavedra21 5 1,560 Oct-30-2024, 06:26 PM
Last Post: lsaavedra21
  trouble reading string/module from excel as a list popular_dog 0 890 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  getpass.getpass() results in AttributeError: module 'os' has no attribute 'O_NOCTTY' EarthAndMoon 4 2,719 Oct-03-2023, 02:00 PM
Last Post: deanhystad
  AttributeError: '_tkinter.tkapp' object has no attribute 'username' Konstantin23 4 5,730 Aug-04-2023, 12:41 PM
Last Post: Konstantin23
  Parallel processing - AttributeError: Can't get attribute 'sktimekmeans' Mohana1983 1 1,899 Jun-22-2023, 02:33 AM
Last Post: woooee
  Python: AttributeError: 'PageObject' object has no attribute 'extract_images' Melcu54 2 7,077 Jun-18-2023, 07:47 PM
Last Post: Melcu54
  cx_oracle Error - AttributeError: 'function' object has no attribute 'cursor' birajdarmm 1 4,635 Apr-15-2023, 05:17 PM
Last Post: deanhystad
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 15,420 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Pandas AttributeError: 'DataFrame' object has no attribute 'concat' Sameer33 5 10,100 Feb-17-2023, 06:01 PM
Last Post: Sameer33
  AttributeError: 'numpy.ndarray' object has no attribute 'load' hobbyist 8 10,254 Jul-06-2022, 10:55 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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