Pandas QUERY // Examples of pandas query with MULTIPLE CONDITIONS and pandas query with a VARIABLE

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

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

  • @ИванАвито-и6э
    @ИванАвито-и6э Год назад +2

    Nice video, thx! More information about query:
    - u can check value in column is in the list using 2 methods:
    query('col1 in @list_') or less logical query('col1 == @list_')
    - u can use keywords AND, OR, NOT instead of operators &,|,~
    - u can use straightforwardly pandas built-in methods (include string and date ones):
    query('col1.str.contains("A") and col2.dt.year==2024 and not col3.isna()')

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

      Excellent - lots of great options for query! 😄

  • @goodmanshawnhuang
    @goodmanshawnhuang 7 месяцев назад +1

    it's a great video, thanks for sharing it, Kimberly!

  • @sketchytv1321
    @sketchytv1321 4 месяца назад +1

    Awesome thanks subscribed

  • @salmansiddiqui9502
    @salmansiddiqui9502 2 месяца назад

    Thank you. Insightful and Impressive.

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

    Thanks for the concise explanation, Kim!

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

    Nice job. The use of the @ symbol is slick. Thanks!

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

    Nice video! I always learn something after watching your videos. Thanks!

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

      Oh thank you! Glad you learned some thing new 😄

  • @idris8779
    @idris8779 Год назад +1

    Nice explanation. I will like to see lambda function in pandas in the nearest future. Welldone 👍

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

      Oh that's another good one - thanks for the suggestion! Cheers 😃

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

    Thanks, that was helpful.

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

    very good bravooo

  • @torque6389
    @torque6389 13 дней назад

    Great video, thanks! Can you use and or instead of & | in the query method?

    • @KimberlyFessel
      @KimberlyFessel  5 дней назад +1

      Most welcome! And yes! You can use "and" / "or" instead. I prefer sticking with & / | since that's what you need to use in a pandas mask. For example df[(df.height >= 3) and (df['weight (g)'] >= 100)] does not work, you must use & in that case, but query will accept either.

    • @torque6389
      @torque6389 5 дней назад +1

      @ thank you for the reply and explanation.

  • @maziarzamani6366
    @maziarzamani6366 5 месяцев назад

    This video was very, very great
    Thank you very much
    Will you be uploading new videos? 😊

    • @KimberlyFessel
      @KimberlyFessel  5 месяцев назад

      So glad you enjoyed it! Yes, hopefully some new videos soon!

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

    Is there a possibility that you could start a machine learning course (from beginner to advanced)

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

      Thanks for the suggestion! I’ve been considering more data science/ML videos

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

    Which runs faster, mask or query?

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

      Great question! I haven’t tested it myself, but my understanding is that mask is faster if you have 5 or less subconditions. After that, it’s pretty much a draw. stackoverflow.com/questions/53227279/difference-between-masking-and-querying-pandas-dataframe

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

    Hi dear! How are you? Do you teach JavaScript also?

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

      Hi there 👋 I have dabbled in JavaScript but not substantially. So to answer your question, not at this time!

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

    Hello mam....i have error in seaborn i type
    import seaborn as sns than i press only run without any entering datafram etc so there coming error
    I not getting proper solution
    I uploaded video short in my channel

    • @KimberlyFessel
      @KimberlyFessel  Год назад +1

      That certainly is an interesting error! 😅 I'm not sure what's going on, but I would try restarting your notebook, potentially uninstalling and reinstalling seaborn, and making sure Jupyter Notebook has the right path to your packages.

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

      @@KimberlyFessel thank you mam for answering

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

    I find conditional row selection in square brackets the ugliest thing.
    The Pandas team seem to override every [] with their own functions.

    • @KimberlyFessel
      @KimberlyFessel  10 месяцев назад +1

      Yup - query is a great alternative to [ ], though admittedly, I'm a habitual [ ]-er myself 😆

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

      @@KimberlyFessel 🤣