Simulating COVID-19 using Python, NumPy & Matplotlib [in-depth tutorial]

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии • 87

  • @paperzz6657
    @paperzz6657 4 года назад +45

    The moment I blinked, I missed 5 lines of code xD

  • @prestonwallitsch8636
    @prestonwallitsch8636 4 года назад +31

    Him: Lets make a viral simulation
    Humans: We already started one

  • @jindodogg
    @jindodogg 3 года назад +3

    Thanks, your tutorial gives me a good framework on how you think. I’m not an expert Pythonista like you but watching someone introduce the ropes helps!

  • @underdogrobot
    @underdogrobot 4 года назад +4

    I'm curious if you sped up the "typing" part as people were pausing the vid anyway....I like it as when I press un-pause you go right into another concept...Cheers

  • @BlochSphere
    @BlochSphere 4 года назад +6

    When you keep higher values for population, the sum of death & recovered is not equal to population

  • @KiteHQ
    @KiteHQ  4 года назад

    Join our community on Facebook for access to more resources and support from fellow Python developers facebook.com/groups/505658083720291/

  • @billnjoroge7088
    @billnjoroge7088 4 года назад +12

    Thanks for sharing the vid. you're a bit too fast, but all the same, great tut. Oh and Kite is amazing! makes coding way easier!

    • @KiteHQ
      @KiteHQ  4 года назад

      Try slowing the speed down to .5! :) Glad you enjoyed the tutorial and are digging Kite!

    • @arashparsa4012
      @arashparsa4012 2 года назад

      @@KiteHQ So as a Data Scientist in training. I could not have easily came up with this. Do you have any thoughts on that? How does someone come up with all this as a beginner let alone know that python is the solution as opposed to some other language?

    • @arashparsa4012
      @arashparsa4012 2 года назад

      @@KiteHQ when you specified the colors in tuples why are the values all less than 1? Are they not supposed to be between 0-255?

  • @azhisabirmohammed7988
    @azhisabirmohammed7988 3 года назад +1

    Thanks , which model do you used ? i mean the differential equations and diagram of the model ?

  • @champagnejin697
    @champagnejin697 4 года назад +5

    How could you code and talk simultaneously? And the speed is so fast, that's awesome! Besides, maybe you could introduce the math model first and then code it, that would make the video much more easy to understand.

  • @gaurishagrawal9404
    @gaurishagrawal9404 4 года назад +1

    Is their a way to take a input of morality rate,death rate,infection ratio, etc. And then make a custom simulation based on those inputs rather than the same one each time?

  • @MakaveliandPr0
    @MakaveliandPr0 4 года назад

    Can someone help? It looks like I messed up the dictionaries.
    self.mild[recovery_day]["thetas"].append(mild_theta)
    KeyError: 10

  • @danielalv7840
    @danielalv7840 4 года назад +1

    I get a invalid syntax error on line 69 (8:04) on "death"
    ^
    I know for sure I have the exact same code on my end so I do not know why is this happening, can anybody help?

    • @pysokon7714
      @pysokon7714 4 года назад +2

      @7:32 there is a coma after 365)} -----------------> ...365)},
      This resolved my problem.
      You can't see the coma later because of the window next to the code.

    • @universenerdd
      @universenerdd 4 года назад

      because "death" isn't a real python command, you have to tell python what that thing is supposed to do, this is typically what a python library does, by executing a few thousand lines of code when a certain thing is called, which is what makes a lot of people use python for inexperienced people who need a project that involves programming, however, they're is nothing in any library that describes death as a token(a token is basically grammer in programming languages, for example print() is a token)

  • @hatelovebowel4571
    @hatelovebowel4571 2 года назад

    you have no idea how much I love you

  • @binjun3551
    @binjun3551 3 года назад +1

    Thank you for your great video! I'm trying to type this project! It really helps me to understand python and using numpy!

  • @FunnyPantsTV124
    @FunnyPantsTV124 4 года назад

    How would one go about modifying the code to allow for a larger population size?? I tried just changing the number 4500 to a larger number but that broke the code? has anybody else had this problem?

  • @AlaEddine19176
    @AlaEddine19176 3 года назад +1

    Sir can you help me to build a simple room simulation in python i need it for a study project ??

  • @walterwachtel1834
    @walterwachtel1834 4 года назад

    Hi, thx a lot - complex background available! Program doesn`t start directly from spyder (with python 3.8). Anyone a solution?

  • @lanceandreijuat3953
    @lanceandreijuat3953 3 года назад

    Where did you get the data?

  • @cole8452
    @cole8452 3 года назад

    Everything was fine until the def main where I get
    "NameError: name 'Virus' not defined"
    But it is defined so does anyone know the fix?

  • @oludhe7
    @oludhe7 4 года назад +1

    Is there a mental kite autocomplete to help me explain to somebody how this code I so wonderfully copy and pasted works?
    Great video anyway!

  • @utube11235
    @utube11235 4 года назад

    Really great tutorial and nicely paced. Thanks a lot!

  • @emaadislam6197
    @emaadislam6197 3 года назад

    How do i run the copied code on jupyter notebook?

  • @FunnyPantsTV124
    @FunnyPantsTV124 4 года назад

    i keep getting this error? and im not totally sure how to fix it
    AttributeError: 'Virus' object has no attribute 'initial_population'

    • @utube11235
      @utube11235 4 года назад

      heck his code on Github.. you may just need to indent the def initial_population block once inwards. Had got the same error and got resolved with the indent.

  • @rectifyus7997
    @rectifyus7997 3 года назад

    Please some one help me:
    I'm getting indentation error in line 47 . But I did everything correct but then also I'm getting indentation error in line 47.

  • @policy01234
    @policy01234 2 года назад

    I was wondering if you can do one about the Cruise ship that had Covid 19

  • @AndrzejFLena
    @AndrzejFLena 4 года назад

    Hi
    It's great video, thanks a lot!
    I have just a question, I can't tell what params is? I can't see in the code where you've stored or defined it, and when I check its type(params) my computer tells me: name "params" is not defined. I see you using it a few times, although I can't locate where exactly you define it or store it. Any explanation would be grand, thanks!

    • @ericmckevitt8308
      @ericmckevitt8308 4 года назад

      he defines it at the top of his program just under imports and color variables. check 1:55 in the video.

    • @AndrzejFLena
      @AndrzejFLena 4 года назад +1

      @@ericmckevitt8308 oh wow, yes I see it now - must have completely glossed over it. Thanks for answering!

    • @ericmckevitt8308
      @ericmckevitt8308 4 года назад

      @@AndrzejFLena sure!

  • @dorianquelle327
    @dorianquelle327 4 года назад

    I get an error: AttributeError: 'Virus' object has no attribute 'animate' any idea where i messed up?

    • @jamesserenity8634
      @jamesserenity8634 3 года назад

      you need to add 'animate' as an attribute of the object 'Virus'

  • @basundharadeb5717
    @basundharadeb5717 4 года назад

    is this simulation used for prediction

  • @AnUncommonMan
    @AnUncommonMan 3 года назад +1

    Thanks, but I'm looking for the same except visualization so need to print everything on console like day wise . pls help for my intern project

  • @danielifeanyichukwu3110
    @danielifeanyichukwu3110 2 года назад

    Amazing video,...please how can I get these codes, I'm preparing for a project

  • @fgomez
    @fgomez 4 года назад

    How can I save the animation to a mp4 or any video file?

    • @ricetv942
      @ricetv942 4 года назад

      Yes, I use OBS to record my screen.

    • @liftedytt2189
      @liftedytt2189 4 года назад

      If you are on an iPhone screen record it using the stock recorder.

  • @shnibbydwhale
    @shnibbydwhale 3 года назад

    “Hopefully our pandemic won’t last that long, and our simulation suggests that it won’t.” Oof

  • @arjunbhat8685
    @arjunbhat8685 4 года назад +1

    Y does this keep giving synatx errors

    • @xfire3778
      @xfire3778 4 года назад

      Maybe you haven’t installed the imported modules into your terminal or command prompt

    • @cy-32santiagojesse60
      @cy-32santiagojesse60 4 года назад

      Were you able to solve it though? Cause I'm having the same problem in line 68 AHAHA

  • @adrianthebananaman6999
    @adrianthebananaman6999 4 года назад

    if you look into the middle of the like dots things it just BOOM lite its moving but its not wait thats an optical illusion

  • @GhosterionID
    @GhosterionID 4 года назад

    Hi kite, this work for jupyter notebook?

  • @aaalll9471
    @aaalll9471 3 года назад

    How can I put something like this on my python based website? Can someone please help me

    • @aaalll9471
      @aaalll9471 3 года назад

      Btw I use visual studio and I'm looking to code a a website on it

  • @alkalinebase
    @alkalinebase 2 года назад

    This looks so good but is making me feel bad about my abilities. I started like a warrior but I guess I cannot complete it :'(

  • @manuelmoulton4092
    @manuelmoulton4092 4 года назад

    my thing has a dumb syntax error for no reason

  • @hyecutie1
    @hyecutie1 4 года назад

    One more thing, the mortality rate reported is only 0.037% inflated. Your sim says 3.25% mortality rate. Ummmmmm

  • @anand_kumar927
    @anand_kumar927 4 года назад

    Is anyone else getting an 'Exception in Tkinter callback' ?

  • @blibilb
    @blibilb 2 года назад

    why is fatality rate greater than percent severe.. how does that make sense
    plus 0.034 is mortality rate calculated by WHO. 1.4% is the fatality rate (for covid)
    in your code:
    percent_severe = 0.2 (20% of infected individuals have severe symptoms)
    fatality_rate = 0.034 (3.4% of infected individuals will die)
    percentsevere_recovery variable is then calculated as 1 - (percent_severe/fatality_rate)
    the result would be percent_severrecovery = 1 - (0.2/0.034) = approx -4.88. severe recovery is NEGATIVE. This would mean that all infected individuals with severe symptoms are expected to die??? fatality rate is only 3.4% hows that possible????

  • @dennisasamoah2213
    @dennisasamoah2213 4 года назад +1

    kite is really great

  • @lizravenwood5317
    @lizravenwood5317 4 года назад

    golden information - and meaty Thanks

  • @sathish77j90
    @sathish77j90 4 года назад

    Really fantastic sir...

  • @invisibleman8897
    @invisibleman8897 4 года назад +1

    Code please

  • @bigmancozmo
    @bigmancozmo 4 года назад +4

    But why would we need to code one when we have one happening in real life xD

    • @stranostrani9212
      @stranostrani9212 3 года назад

      why would you watch this video while you could not

  • @leo848
    @leo848 4 года назад +1

    How do you even make money?

    • @KiteHQ
      @KiteHQ  4 года назад +3

      Howdy! Kite is currently free to use for any individual developer. Eventually we plan to monetize by providing a paid version of the product for professional use cases, as well as a version that is useful in team settings, thereby charging engineering teams to use the product. We will not monetize by sharing the usage data we collect.

  • @Jason-de3oo
    @Jason-de3oo 4 года назад +1

    Nice 👏

  • @anthonyfalteisek688
    @anthonyfalteisek688 4 года назад +2

    Great tutorial, I've been wondering how to do this. However, seeing someone do this is making me lose faith in my abilities.

  • @juhaynaahmad5700
    @juhaynaahmad5700 3 года назад

    wow! thank you

  • @ghostrunner228
    @ghostrunner228 2 года назад

    Thanks!!!

  • @mathieupotvin8601
    @mathieupotvin8601 3 года назад

    Interesting, but way too fast personnally

  • @lucaskelbe
    @lucaskelbe 4 года назад

    Wayyy to fast 💨

  • @IvaZinga
    @IvaZinga 4 года назад

    too fast

  • @selimcanpolat8664
    @selimcanpolat8664 4 года назад

    i would perhaps tolerate it if you hadn't been reading from a script

  • @homosapien8828
    @homosapien8828 4 года назад

    BAAAA!!

  • @dronezai7714
    @dronezai7714 4 года назад

    Code Download? I Guess Theres No Point. Python/VS Code Doesn't Even Work And Is Useless To Me And Whatever Code I Put Doesn't Work.

  • @jaimeestarellas5206
    @jaimeestarellas5206 2 года назад

    You go too fast

  • @universenerdd
    @universenerdd 4 года назад

    what is the point of kite? if you use Visual studio code you have all the features of kite anyway, oh yes, because it's a sponsorship made to look like you're company is a god compared to the companies that do the exact same thing, just are bad at marketing

  • @dronezai7714
    @dronezai7714 4 года назад

    Kite Is Useless To Me. No Offence.