#100DaysOfCode in Python Transcripts
Chapter: Days 82-84: Data visualization with Plotly
Lecture: Creating bar and pie charts with Plotly

Login or purchase this course to watch this video and the rest of the course contents.
0:00 There is some prework necessary to get to plotting, but we can now do it. Let's start by transposing the post by month in X and Y axis.
0:10 Then it becomes pretty easy. You can just type data equals a list, bar, taking, X equals X, Y equals Y.
0:29 You can then say plotly offline, you have to specify the mode, iplot, data, and you can give it a file name. Look at that.
0:45 Even has numbers if you hover over the months. It also posted when I was preparing to a URL so you can access those here.
0:56 That's a nice feature of plotly that you can make your work easily accessible. Let's move on to the breakdown of the blog categories.
1:05 The code is very similar actually. I'm going to use my transpose helper. X and Y now make a bit better naming labels and values.
1:15 Again I use the go object but this time I calls with pie and I give it labels equals labels and values equals values.
1:26 Then we call plotly again, offline mode, iplot, put the pie object in the list and give it a file name.
1:43 Look at that. Challenges is our big thing, you probably know by now but we do as many articles, relatively. We have news and some special and guests.
1:58 Thirdly, the comment tags, similar code and to transpose list of tuples, and here I have to take the top tags as we find before.
2:14 Tags equals go, again I do a pie chart and I could be using other types of graph but I find a pie chart being adequate for this type of data.
2:27 I also want to keep it simple. So, in the coming days you can explore the library further yourself. Similarly, has to have labels and values defined.
2:38 Plotly, offline, iplot, and it's important to put this in a list, filename, just going to say tags for now. Cool, right?
2:53 Python learning Twitter Code Challenges. Of course similar to the categories but here you see also, when we get to a bit
3:02 more granular level you get into Flask and Django. It's true that we write quite a bit about those. There's even some machine learning, etc.


Talk Python's Mastodon Michael Kennedy's Mastodon