I have some experience in Python and want to manipulate some data files using classes, mostly to gain experience in OOP. Here is the scenario: for each sample that we test (e.g., sample_1), the tool generates a text data file (e.g., sample_1_file) with the following structure (you can see the file has different data sections):
test_type_I, meta_data_I
{data_I = n1 rows x m1 columns}
test_type_II, meta_data_II
{data_II = n2 rows x m2 columns}
test_type_III
{data_III = n3 rows x m3 columns}
.
.
and so on
What I hope to achieve is to be able to access the test_type, meta_data, and data, for each data section, and then manipulate the data however I want. For example, say I create an object like
sample_1 = myClass(sample_1_file)
then I want to be able to access different sections of the data file:
sample_1.meta_data_I
plot(sample_1.data_I['x'],sample_1.data_I['y'])
print(sample_1.data_I)
and so on
I have read about classes, and have seen some youtube videos, typical employee class and such. However, in my case, here are my questions:
1. What does my __init__ method take as input?
2. What am I initializing?
3. What would be my typical methods?
4. What are the data for my class
I can do what I want with simple functions in Python (and pandas), but I really want to gain experience in classes and want to apply it to something that is relevant to my work. I found this: How to overload __init__ method based on argument type? which has some relevance, but the answer uses advanced concepts that I am not familiar with.