From the course: Data Analysis with Python and Pandas

Unlock this course with a free trial

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

Solution: Stylized line chart

Solution: Stylized line chart

- All right, everybody. Our solution code is up on the right. Let's go ahead and dive into the notebook. All right, so a couple ways to do this problem. The first thing that we want to do is import seaborn and set our style to dark grid. Again, you could have used a different style. I'm not going to review your work, so hopefully you're able to have a little bit of fun trying out the different styles. The next thing that I did was I renamed our, you know, dcoilwtico to oil price. That's going to make it very intuitive for our audience to understand. And then we're going to go ahead and move on to plotting. So we want to set our index to be our date, and we can chain the astype command to this. So we'll automatically get our index into a daytime format. You might have done this in a separate step, and that's just fine. We're then calling the plot method. We're setting a title, X axis label, Y axis label, and then just setting our color to black. And that will return this chart, which I…

Contents