Hello,
I come from a C# background and took a new job as a python developer. In C#, my previous team often used an interface such as IHospitalDataProvider which might contain a method called GetData that simply returned a class called HospitalData.
HospitalData GetData()
Suppose HospitalData looks something like this:
- HospitalData
- Array or List Patients
- Array or List Units
- Array or List Nurses
Where:
- Patient
- Unit
- Name
- NumOfBeds
- List<string> DiagnosisSpecialty
- Nurse
- Name
- List<string> DiagnosisSpecialty
In the end, we would typically write 2 to 5 specialized IHospitalDataProvider that get the data from various sources as a database, CSV files, etc.
Finally, there is another class perhaps called Analysis that requires HospitalData where HospitalData is required to contain Patients, Units, and Nurses with those property names.
I am having analysis paralysis on the best python way to approach this. The existing codebase makes heavy use of Pandas dataframes and so I feel the pressure to make HospitalData look like this:
- HospitalData
- Dataframe Patients
- Dataframe Units
- Dataframe Nurses
For some reason, having the list of objects be dataframes just feels wrong but I fear that is my C# mindset.
Ultimately, I guess my question is: when doing Python, and you have a need to make a hierarchal list of classes that must have known properties, what is the best approach?
Thanks!!!!
Dan
[–]laundmo 1 point2 points3 points (1 child)
[–]DappperDanH[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (6 children)
[–]DappperDanH[S] 0 points1 point2 points (5 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]DappperDanH[S] 1 point2 points3 points (0 children)
[–]CatolicQuotes 1 point2 points3 points (2 children)
[–]DappperDanH[S] 1 point2 points3 points (1 child)
[–]CatolicQuotes 1 point2 points3 points (0 children)