Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculator is maybe not true #12

Open
binhmuc opened this issue Nov 2, 2018 · 2 comments
Open

Calculator is maybe not true #12

binhmuc opened this issue Nov 2, 2018 · 2 comments

Comments

@binhmuc
Copy link

binhmuc commented Nov 2, 2018

Hi,
I run your example code at 02/Nov/2018. Your code example is 9 months ago. So the day of birth is 02/Feb/2018.
But your function "helpers.date_to_age_in_months" is calculate valid_age is: 8 ( i think 9 is correct, because 9 months ago, right ?)
Maybe your code.
def date_to_age_in_months(date): delta = datetime.date.today() - date print (delta.days / 30.4375) #years = delta.days / 365.25 return str(int(delta.days / 30.4375))
In file helper is wrong, delta.days / 30.4375 = 8.969199178644764 and return 8.

@jbaldivieso
Copy link
Collaborator

hi @binhmuc – you might want to instead check out my rewritten version which lives here: https://github.com/jbaldivieso/pygrowup2 (the long term hope was to have that ultimately replace pygrowup, but we haven't tackled that code merging yet). The API is different, but it features some improvements in terms of accuracy.

@binhmuc
Copy link
Author

binhmuc commented Nov 20, 2018

Thank for you reply, bro. Anyway, your work is so great. Do you know WHO also public dataset base on date also ?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants