Median Program in Python | Python for Math

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

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

  • @the_py_peeper01
    @the_py_peeper01 Год назад +2

    Your explanation is so clear and amazing! I wish I had learnt the basics from you!

  • @scottcardwell932
    @scottcardwell932 8 месяцев назад

    I was able to use this to understand getting the median and use it in a larger class assignment. Thank you

  • @dharanimurugan5887
    @dharanimurugan5887 10 месяцев назад

    Need a video like how to find the middle element is even or odd in python

  • @BadAce1508
    @BadAce1508 8 месяцев назад

    What are the advantages of this over using the "statistics.median( )" function?

  • @bharadwajkamepalli3903
    @bharadwajkamepalli3903 2 года назад +3

    Do more videos on python mate

    • @WrathofMath
      @WrathofMath  2 года назад +1

      Working on it! Any specific requests?

    • @bharadwajkamepalli3903
      @bharadwajkamepalli3903 2 года назад +1

      @@WrathofMath like about numpy how it's useful in statistics or other areas of math , also more advanced once that r normally difficult but easy to do with python, some stuff like that.
      Thank you for reply mate

    • @WrathofMath
      @WrathofMath  2 года назад +1

      Definitely plan on doing numpy lessons, but I'm a little out of practice with it, so will need to spend some time reviewing. I'm very practiced at explaining maths, but always feel a little out of my element when I make these videos.

  • @ukoni8667
    @ukoni8667 Год назад

    Great

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

    Can we code it without using if statement? Like using mathematical logic

    • @WrathofMath
      @WrathofMath  2 года назад +1

      Not exactly sure what you mean by "mathematical logic" in this context, but we could write it without explicitly using the if statement. If we loop the process of removing the top and bottom element from our list (n-1)//2 times, then return the average of what remains, this will produce the correct result for even and odd lists.
      However this only works for sorted lists, so we still need to sort it, which requires if statements even though they may not explicitly appear in our code since the sort method is built in. So we don't need ifs to deal with the even/odd problem, but sorting is a different matter.

  • @BAIW8
    @BAIW8 11 месяцев назад

    i did not understand very well why we should sort the list ,??

    • @WrathofMath
      @WrathofMath  11 месяцев назад +1

      We should sort the list because the median is defined (roughly) as the middle number of a sorted list. If the list is not sorted, the middle number has no particular significance.