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 97837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:04:52+00:00 2026-05-11T00:04:52+00:00

I am working with a set of data that I have converted to a

  • 0

I am working with a set of data that I have converted to a list of dictionaries

For example one item in my list is

{'reportDate': u'R20070501', 'idnum': u'1078099', 'columnLabel': u'2005',  'actionDate': u'C20070627', 'data': u'76,000', 'rowLabel': u'Sales of Bananas'} 

Per request

The second item in my list could be:

 {'reportDate': u'R20070501', 'idnum': u'1078099', 'columnLabel': u'2006',  'actionDate': u'C20070627', 'data': u'86,000', 'rowLabel': u'Sales of Bananas'} 

The third item could be:

 {'reportDate': u'R20070501', 'idnum': u'1078100', 'columnLabel': u'Full Year 2005',  'actionDate': u'C20070627', 'data': u'116,000', 'rowLabel': u'Sales of Cherries'} 

The fourth item could be:

 {'reportDate': u'R20070501', 'idnum': u'1078100', 'columnLabel': u'Full Year 2006',  'actionDate': u'C20070627', 'data': u'76,000', 'rowLabel': u'Sales of Sales of Cherries'} 

The reason I need to pickle this is because I need to find out all of the ways the columns were labeled before I consolidate the results and put them into a database. The first and second items will be one row in the results, the third and fourth would be the next line in the results (after someone decides what the uniform column header label should be)

I tested pickle and was able to save and retrieve my data. However, I need to be able to preserve the order in the output. One idea I have is to add another key that would be a counter so I could retrieve my data and then sort by the counter. Is there a better way?

I don’t want to put this into a database because it is not permanent.

I marked an answer down below. It is not what I am getting, so I need to figure out if the problem is somewhere else in my code.

  • 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. 2026-05-11T00:04:53+00:00Added an answer on May 11, 2026 at 12:04 am

    So what’s wrong with pickle? If you structure your data as a list of dicts, then everything should work as you want it to (if I understand your problem).

    >>> import pickle >>> d1 = {1:'one', 2:'two', 3:'three'} >>> d2 = {1:'eleven', 2:'twelve', 3:'thirteen'} >>> d3 = {1:'twenty-one', 2:'twenty-two', 3:'twenty-three'} >>> data = [d1, d2, d3] >>> out = open('data.pickle', 'wb') >>> pickle.dump(data, out) >>> out.close() >>> input = open('data.pickle')     >>> data2 = pickle.load(input) >>> data == data2 True 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 59k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer In Delphi 7 you would do this: Project | Options… May 11, 2026 at 8:56 am
  • added an answer If you write EventGetSum() that immediately calls the EventGetSum method.… May 11, 2026 at 8:56 am
  • added an answer There is no need in spaces or anything, its working… May 11, 2026 at 8:56 am

Related Questions

I am working with a set of data that looks something like the following.
I am working with a set of data that I have converted to a
I am working with a set of what is essentially Attribute/Value pairs (there's actually
I am working on a ASP.net project created with local file system settings. I
I am working with a PC based automation software package called Think'n'Do created by
I am working with a large Java web application from a commercial vendor. I've
I am working with a Visual Studio 2005 C++ solution that includes multiple projects
I am working with a hosting provider who has installed mod_python for me. I
I am working with a log of events where there are about 60 different
I am working with a huge list of URL's. Just a quick question I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.