Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom data structure
#1
New to python, from .Net. I know python does not support arrays.

This class

class myStructure:
    """ My custom data structure for arrays """

    def __init__(self, date1=dt.datetime(2000,12,31), num1=0, str1="Nothing"):
        self.date1 = date1
        self.num1 = num1
        self.str1 = str1
I can do this ONCE
# Class Instance
res = my.myStructure()
res.str1 = "Yes"
res.num1 = 50
res.date1 = my.dt.datetime.strptime("05/01/1950","%m/%d/%Y")
Question: How can I use myStructure to store many records of data (like an array), or may be I cant?
Can I convert my class structure into a dictionary or something ??

Please advise
Reply


Messages In This Thread
Custom data structure - by icm63 - Mar-26-2019, 11:34 PM
RE: Custom data structure - by ichabod801 - Mar-27-2019, 01:03 AM
RE: Custom data structure - by icm63 - Mar-27-2019, 02:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I add certain elements in this 2d data structure and calculate a mean TheOddCircle 3 1,589 May-27-2022, 09:09 AM
Last Post: paul18fr
  Appropriate data-structure / design for business-day relations (week/month-wise) sx999 2 2,829 Apr-23-2021, 08:09 AM
Last Post: sx999
Smile Set 'Time' format cell when writing data to excel and not 'custom' limors 3 6,364 Mar-29-2021, 09:36 PM
Last Post: Larz60+
  what data structure to use? Winfried 4 2,861 Mar-16-2021, 12:11 PM
Last Post: buran
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 7,869 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt
  How to use Bunch data structure moish 2 2,949 Dec-24-2020, 06:25 PM
Last Post: deanhystad
  Correct data structure for this problem Wigi 13 4,704 Oct-09-2020, 11:09 AM
Last Post: buran
  Plotting 3D Data with Custom Colorbar Gates666 0 1,712 Jul-09-2020, 10:56 AM
Last Post: Gates666
  ctypes and custom data type (structures, pointer to structures) python_user_n 0 2,696 Jul-08-2020, 05:52 PM
Last Post: python_user_n
  difficulties to chage json data structure using json module in python Sibdar 1 2,105 Apr-03-2020, 06:47 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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