Closed MarvinLvn closed 2 years ago
I think it would make sense to have such a feature.
However, pd.to_datetime
will fail for dates that are too far back, e.g. 01/01/1000. You may ask why this is relevant. Well, in EL1000 for instance, some of the dates have been "anonymised" like that. This has the merit to make it obvious that the dates are not the real dates, but instead made up to keep ages consistent while protecting the privacy of the participants.
This is solved by using datetime.datetime.strptime
instead.
(saying this for whoever wanna implement this)
Regarding the implementation, maybe ChildProject.projects.ChildProject
should have a compute_ages
method that returns a pd.Series
with the computed age.
e.g.
project = ChildProject('.')
project.read()
project.children['age'] = project.compute_ages()
but the function should also accept custom dataframes maybe:
project = ChildProject('.')
project.read()
children = project.children.copy()
recordings = project.recordings.copy()
# work on the dataframes...
# ...
children['age'] = project.compute_ages(children = children, recordings = recordings)
We currently don't have access to the age information in recordings.csv To compute it, we need 'dob' from
children.csv
and 'date_iso.csv' fromrecordings.csv
itself. It'd be particularly useful for longitudinal studies :)Please, ignore this if the feature already exists (in which case, I'm sorry, I missed it).
For Lyon, I did it myself, using:
EDIT : I also realized that you may not want to go in that direction as the number of features to implement would be virtually infinite *_*