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

  • Home
  • SEARCH
  • 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 8809731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:56:59+00:00 2026-06-14T02:56:59+00:00

I have a dictionary of the example: E = 527:{ (‘GENERAL MOTORS CORP.’, datetime.date(1,

  • 0

I have a dictionary of the example:
E = 527:{ (‘GENERAL MOTORS CORP.’, datetime.date(1, 1, 1), False, ‘KENOSHA’, ‘WI’)}

I need to take out the datetime.date(1,1,1) and turn this into a separate list outside of the tuple. I’m supposed to access the date for multiple keys and include them into a list. I’m very confused and looking to do this for a general for of any key. This is taken from a general data table where the key is index 1 and the values in the tuples are the next indexed values.
Would [E[527][1] be correct?

  • 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-14T02:57:00+00:00Added an answer on June 14, 2026 at 2:57 am

    Use:

    dates = [v[1] for k,v in E.iteritems()]
    

    OR:

    dates = [v[1] for v in E.itervalues()] 
    

    OR:

    from operator import itemgetter
    
    dates = map(itemgetter(1), E.itervalues())
    

    As per you comment it can be something like:

    from datetime import datetime
    
    def get_dates(filename, A, B):
        with open(filename) as f:
            dates = [datetime.strptime(row.split()[2], format) for row in f.readlines()]
        dates = [dt for dt in dates if dt.year == A and dt.month == B]
        return [(dt, dates.count(dt)) for dt in set(dates)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have (for example) Dictionary of different generic types ( d1, d2, d3, d4
Up until now, I have maintained a 'dictionary' table in my database, for example:
My example dictionary is this data_dictionary = {1:'blue',2:'green',3:'red',4:'orange',5:'purple',6:'mauve'} The data_dictionary can have more elements
For this example, I have a dictionary, that when I call on it, Ember
I have a dictionary in Python where the keys are pathnames. For example: dict[/A]
Have a check? For example... I would have a dictionary with the parameters to
I have a dictionary: self.currently_occupied = {obj:[0, 0]} I need to check if the
I have a dictionary, for example Dictionary<int, string> . What would be the best
I have a dictionary of data that looks for example like this: dict =
I have a dictionary of keys and values, for example: { fred: 1, dave:

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.