Python Forum
Correct data structure for this problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correct data structure for this problem
#1
Hi all !

New to the forum and rather new to Python scripting, but not new to programming in general. I am looking for advice on the data structure to incorporate the below. Looking at the attached picture, I have a structure that looks like an array in Excel VBA. The rows and columns need to be dynamic. Each column will always have 10 fixed entries to start with (shown in yellow), followed by a variable part containing each time a number and a string.

I coded this in Excel VBA as a proof of concept but it's painfully slow. The question: how do I set it up in Python objects ? Is this feasible in a list ? or an array ? A dictionary ? Or nested objects ? There are 1 to 100 columns at most, and 1 to 4000 rows per column, at most.

The source of the data is a text file. Each line will have some information stored in the object. After that, I need to loop over the object to output to a new text file.

Thanks a lot !

[Image: 01.png]
Reply


Messages In This Thread
Correct data structure for this problem - by Wigi - Oct-06-2020, 11:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting the correct data from a CSV file S2G 6 345 Jun-03-2024, 04:50 PM
Last Post: snippsat
  How can I add certain elements in this 2d data structure and calculate a mean TheOddCircle 3 1,681 May-27-2022, 09:09 AM
Last Post: paul18fr
  Looking for data/info on a perticular data-proccesing problem. MvGulik 9 4,113 May-01-2021, 07:43 AM
Last Post: MvGulik
  Appropriate data-structure / design for business-day relations (week/month-wise) sx999 2 2,909 Apr-23-2021, 08:09 AM
Last Post: sx999
  what data structure to use? Winfried 4 2,944 Mar-16-2021, 12:11 PM
Last Post: buran
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 8,114 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt
  How to use Bunch data structure moish 2 3,064 Dec-24-2020, 06:25 PM
Last Post: deanhystad
  difficulties to chage json data structure using json module in python Sibdar 1 2,168 Apr-03-2020, 06:47 PM
Last Post: micseydel
  File system representation in a data structure Alfalfa 1 2,155 Dec-18-2019, 01:56 AM
Last Post: Alfalfa
  Custom data structure icm63 2 2,631 Mar-27-2019, 02:40 AM
Last Post: icm63

Forum Jump:

User Panel Messages

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