I have a dictionary in some class,
self.tables={'tableA':df_a,'tableB':df_b,...,'tableZ':df_z}
and a corresponding list of indices for each dataframe:
self.indices={'tableA':indices_a,'tableB':indices_b,...,'tableZ':indices_z}
The idea is that when the user of my class writes
someClass.tableA
he will get
self.tables['tableA'].iloc(self.indices['tableA'])
and when he will set it eg
someClass.tableA=some_df
He will actually change the corresponding indices.
I know how to do this with 26(26 comes from the a-z portion) @property and other 26 @property.setter,for instance:
@propery
def tableA(self):
return self.tables['tableA'].iloc[self.indices['tableA']]
Is there a better way?