style object of DataFrame

Create the sample DataFrame from here.
By using lower() we will change the name column data to lower case.{'name':lambda x:x.lower()})'lightgreen')'red')\
.highlight_max(color='lightgreen'){'name':lambda x:x.lower()})\

Highlighting the row based on condition

If the mark column is more than or equal to 60 then highlight the row with background colour. ( Note the *4 for number of columns )
def highlight(s):
    if s.mark >= 60: # change this condition 
        return ['background-color: yellow']*4
        return ['background-color: white']*4, axis=1)

Pandas Pandas DataFrame
contains() to display and delete row based on Conditions


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2021 All rights reserved worldwide Privacy Policy Disclaimer