From the course: Data Science Foundations: Python Scientific Stack [CoderPad]

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Customize pandas output

Customize pandas output

- [Instructor] Visual Studio Code can render Pandas DataFrame nicely. Let's have a look. So we're going to load the iris dataset from scikit-learn doing load_iris with as frame equal true to get a data frame. And we're going to get the first five rows from the data and look at this data frame. Let's run the cell and you see it rendered nicely. We have headers, we have different colors for even and odd rows, et cetera, et cetera. Let's highlight the maximum value in each column. This can be done with data frame style highlight max. And we run this one. We see that we get the value highlighted. On the last column of the petal width every value is the maximal value, so all of them are highlighted. There are several other built-in styles. For example, instead of highlighting the maximal value you can use a gradient. The higher the value the darker blue the cell will be painted. So let's run this one. And now we see…

Contents