Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:37:20+00:00 2026-06-01T19:37:20+00:00

Probably an example will be easier to explain this. So imagine i have something

  • 0

Probably an example will be easier to explain this.

So imagine i have something like this:

 word_dict = {"word": frequency}

example would I loop thru a paragraph and in that paragraph I found the word freq as

 word_dict = {"this":2,"that":4} # assume that all the cases have just these two words..

yepp its a strange dict..

Now, each paragraph is assigned to a story and this story has an id:

lets say i get this:

{1234: {word_dict}} # where 1234 is the story id

and then this story is contanined in a book:
So if do something like book_dict[book_id][story_id], this would return me word_dict.

But there is a good chance that a same book_id, story_id will have different word_dict

i Know it sounds weird..

So what I want is that book_dict[book_id][story_id] = [{word_dict}] so it returns me a list of word dictionary..

How do I implement this.

Err. is the question making any sense?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:37:22+00:00Added an answer on June 1, 2026 at 7:37 pm
    book_dict = {}
    for each book_id, story_id, word_dict in who_knows_what:
        if book_id not in book_dict:
            book_dict[book_id] = {}
        if story_id not in book_dict[book_id]:
            book_dict[book_id][story_id] = []
        book_dict[book_id][story_id].append( word_dict )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok.. So probably an example is a good way to explain this problem So
This is probably best shown with an example. I have an enum with attributes:
This looks a lot easier than I am probably making it sound. I have
This is probably explained more easily with an example. I'm trying to find a
OK, probably best to give an example here of what I mean. Imagine a
Disclaimer: This question is strictly academic. The example I'm about to give is probably
This is something that has always bothered me about PHP and I have never
This will probably sound dumb, but I need to execute a C# code from
I would like to improve the performance of hashing large files, say for example
I should probably not ask a generic question with a specific example, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.