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 - Python Tutorial
From the course: Data Science Foundations: Python Scientific Stack [CoderPad]
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
-
-
-
-
-
-
-
-
-
Overview of matplotlib58s
-
(Locked)
Use styles1m 40s
-
(Locked)
Customize pandas output3m 16s
-
(Locked)
Plotting with pandas2m 18s
-
(Locked)
Use Matplotlib with pandas2m 15s
-
(Locked)
Tips and tricks1m 50s
-
(Locked)
Other plotting packages2m 43s
-
(Locked)
Challenge: Stock data bar charts28s
-
(Locked)
Solution: Stock data bar charts1m 20s
-
-
-
-