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

Related Questions

I have a large data set that I'm working with in excel. About 1000+
I have a working program in C++ that generates data for a Mandelbrot Set.
I'm working on a Spring application that simply searches a set of data for
I'm working with about a 1 million record data set. Currently the data is
I was wondering... when working with a fixed set of data (say: the population
I am working with a set of T4 script that generate partial classes for
I have a working process, behind a web application, that is generating some records
I have a single row of data in a SQL Server table that I'm
I am working on a project that involves a lot of data, and at
I'm working on a web app that passes data to a custom client app.

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.