Style Python Pandas DataFrames! (Conditional Formatting, Color Bars and more!)

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ค. 2024
  • Learn how to add style to your Pandas DataFrames, including formatting cells, conditional formatting in color, and applying bars to cells.
    Written tutorial: datagy.io/pandas-style/
    0:00 Introduction
    0:58 Loading DataFrame
    2:00 Applying Cell Styles
    6:20 Conditional Formatting in Python Pandas
    15:25 Applying Colormaps (Heat Maps) in Pandas
    17:38 Adding Bars to Pandas DataFrame
    21:49 Exporting and Reusing Pandas Styles
    ✅ Follow me on other platforms:
    Website: datagy.io
    Twitter: / datagyio
    Mailing List: mailchi.mp/f6a58f2d73d0/datag... (and get a FREE Pandas tip and tricks book and a FREE Guide to SQL)
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 20

  • @darrena3080
    @darrena3080 6 หลายเดือนก่อน

    This is exactly what ive been struggling with for these past couple of weeks.Im teaching myself data analytics and this video is making things so much better

    • @datagy
      @datagy  6 หลายเดือนก่อน

      Thanks so much!!

  • @mjacfardk
    @mjacfardk 2 ปีที่แล้ว +1

    great comprehensive and deep tutorial
    Thank you

    • @datagy
      @datagy  2 ปีที่แล้ว

      Thank you Dukaan!!

  • @evyatarse
    @evyatarse 2 ปีที่แล้ว +2

    it's important to me that you know how much you're content helps me.
    thank you so very much

    • @datagy
      @datagy  2 ปีที่แล้ว

      Thank you so much, Evyatar! That means a lot to me!

  • @clockfixer5049
    @clockfixer5049 ปีที่แล้ว

    An excellent tutorial, thank you so much

  • @sachinmaroky4600
    @sachinmaroky4600 ปีที่แล้ว

    thank you
    May I know when you used the styles in the second data frame , why $ sign not showing ?

  • @PaulWirsing
    @PaulWirsing ปีที่แล้ว +1

    Any hints or tutorials on applying this to pivot tables?

  • @narendramishra3503
    @narendramishra3503 ปีที่แล้ว

    Hello, I have an excel sheet which has some background colours in cells , while I am conditionally filtering and creating a new excel sheet using python pandas dataframe I am lossing the background colour in the cells. Can anyone help me how I can retain background colour ?

  • @balajibalaji9706
    @balajibalaji9706 ปีที่แล้ว

    How to apply colour for columns?

  • @kobilee7110
    @kobilee7110 2 ปีที่แล้ว +1

    Is there any way to output these styles to an excel file or CSV?

    • @datagy
      @datagy  2 ปีที่แล้ว +2

      Hi Kobi! You can export to Excel by applying the .to_excel() method to the styler object (rather than just the DataFrame).

  • @chriskeo392
    @chriskeo392 6 หลายเดือนก่อน

    This styling passes into csv and excel files?

    • @datagy
      @datagy  6 หลายเดือนก่อน

      Unfortunately not! For that, you can use other libraries like openpyxl :)

  • @KakdeG
    @KakdeG 11 หลายเดือนก่อน

    wonder if this works with steramlit

    • @KakdeG
      @KakdeG 11 หลายเดือนก่อน

      Just checked. Does not work with streamlit when using pandas dataframe

    • @datagy
      @datagy  11 หลายเดือนก่อน +2

      Thanks for the update!! You may be able to do some trickery to convert the dataframe to html first (which keeps the formatting) and then insert as an html block in streamlit?

    • @KakdeG
      @KakdeG 11 หลายเดือนก่อน

      @@datagy Thanks for the idea. Will give it a shot

  • @brunowendt1194
    @brunowendt1194 ปีที่แล้ว +1

    Nothing is working lol