Years ago I wrote a bunch of code in Pascal to analyze a large dataset on a population of African farmers. Now I need to resuscitate the data and do some further analysis. Pascal is obsolete and I am considering learning Python for this. But before I take the leap I hope someone can let me know what the old data structures would look like in Python. Most of the structures were what Pascal called arrays of records; they looked like this
PersonType = record name, mother, father, age, birthplace, religion, income end;
PersonArray [1..12] of PersonType;
What would that look like in Python? Thanks!
NamedTupleordataclass(depending on if you want the object to be immutable or mutable). Python doesn't have special constructs likerecord. Types originate asclasses, similar to other languages with classes. Some types likeNamedTupleanddataclassmodify how the classes work to add some new things.