plotly.express Video Lecture Transcript This transcript was automatically generated by Zoom, so there may be discrepancies between the video and the text. 16:03:53 Hi! Everybody! Welcome back in this video. We're gonna talk about the express module of the plot. 16:03:59 Lea package. So let's go ahead and get started. 16:04:03 So what is plot, lead, dot, express well, plant lee on express is a module within the Plotley Python package that is a high level Api for creating over 30 different chart types within plot leaves quickly with less code than you would need if we were to add it manually like we did in 16:04:21 the previous notebook by adding lines individually for the 2 stocks, so we can kind of think of this like Seborn to Matt. 16:04:30 Plot. Lib. So C. One was a high level Api that allowed you to create quick, more complicated charts in that plot. 16:04:38 Lib. Quickly and with fewer lines of code than if you are timing them in map. 16:04:41 Hotlib directly. So that's exactly what plot lead out expresses. 16:04:44 So for many different types of charts, using plot Lee express is is quick and easy, and you can get pretty much all of the functionality you would want just by using the express function. 16:04:56 So that's why we're going to introduce it and then learn how to use it more in depth. 16:05:01 In the next notebook there will be things that we cannot do with Plotley express. 16:05:06 In those instances will default to using sort of the graph object approach. 16:05:11 And when we do show those we will go ahead and make a note of it, and make sure you're directed to the right documentation links. 16:05:19 So when we want to use Plotley express, how do we import it? 16:05:20 So we do import bought lead, dot express, and for the from the Plotley documentation the standard way is to import it as Px. 16:05:31 So as Px. So for the remainder of the notebooks in this section, like I said most, I would say 90 80 to 90% of the time will be using Plotley Express, and then the other times we will be just using, the graph objects directly, and in those times, it will be very clear to you that we're 16:05:48 Doing that, so to maybe motivate why you would want to use express instead of just graph objects directly. 16:05:58 Let's look back at that stocks example. So remember, we've got the collection day. 16:06:02 And then various closing prices for the trading day, and then various closing prices for these text stocks, and then the previous notebook. 16:06:11 We plotted the closing prior for Microsoft and Apple, so we can, instead of in that notebook we added traces individually for both lines. 16:06:21 But now we can just call P. X, dot line, and then the first thing we input is the data which is df, so a lot like Seborn, and then X is just gonna be equal to the date. 16:06:36 And then you put in y is equal to. So when we want to imply express, if you want to plot multiple values at the same time, you, input the column names for those values. 16:06:50 So the first thing we want is the apple, and then the second thing we want is the Microsoft. 16:06:54 So the list of Aapl, followed by Ms. Ft, and so now, when I go ahead and make this chart it's gonna display the figure. 16:07:05 Okay, so the same exact figure from the last notebook. But now it was created with 3 lines of quote code. 16:07:12 And I'll also point out that we didn't even have to remember in the previous notebook we had something like fig is equal to go figure when we use Plotley dot express that figure is created for us at the same time that the data is plotted as a trace on the figure in terms of 16:07:29 Same time meaning the same chunk of code. So this highlighted code both creates the figure, stores it within the fig variable, and then plots the trace on top of the fig. 16:07:40 So we'll dive more into Px line in the next notebook. 16:07:44 This notebook was just introducing you to this useful module that we're going to learn more about. 16:07:49 Okay. So I hope you enjoyed learning about plot lead our express, and I hope to see you in the next notebook when we see how to use plot.