Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
Key Takeaways
This video covers the basics of data analysis and science, including statistics, data analysis, EDA, AI, machine learning, and deep learning, as part of a 5-day data science crash course.
Full Transcript
Okay. That's great. So, we are live now. Hello everyone. Welcome again. Ashish Jangra this side. This is day two of uh data science boot camp and uh Yeah, that's it. So, do let me know if everything seems fine. Do let me know in the chats. Uh audio, video, everything seems fine so that we can start the session. And before that, we are going to summarize the last session as well that is taken by Arpit Jain. So, do let me know in the chats. Yes. If everything seems fine like the audio and video so that we can start uh taking the session. Okay. Not audible properly. Let me Okay. Is it audible now? Am I audible enough? Are there still some issues? Okay. Hi Abdul Fazil. Okay. That's great. Voice is too low. Okay. Is that fine now? Okay. Hi Shruti. Hi Franklin. That's great. So, today uh as I've told you this is day two. So, what we are going to discuss? Let me summarize the last session that we have done. So, yesterday we have discussed about Python specifically used in data science. Clear? Because that as a brush up session that as I've told you earlier as well. Uh Arpit has took the session. That was a wonderful session. I'm hoping all the concept of uh are clear for the list. Now, today we are going to take this step further and we are going to apply the knowledge that we have discussed earlier on a data set, real-time data set. Okay? Okay, audio is too low. Okay, so uh now Now I'm hoping it would be Okay. Is that okay now? Okay, great. So, uh let me present my screen with you. You are also having a link given in the uh description for the codes. So Yes. So, TED Talk analysis, this is the code that uh is already given in the description. So, what we will do, we'll go to the data set, we'll see how the data set looks, and after that we'll discuss how to go with the code. Okay, how to go with the flow. The concept that we have discussed yesterday, how we can take the concept and apply it on the data analysis. Okay? So, uh this is the code, but we are more concerned about the data. So, this is how the data set looks. As I've told you, there are around around 4 5 and 1/2 thousand TED Talks happened so far. Here we are having the title, who is the author of it, when it happened, uh how many views it is having, how many likes it is having, and what is the link of the TED Talk. Okay? These are the things that we are already having. So, what should be the next step? The next step is we are having this data set. You can either download this data set and you can apply operations on it, or I am going to do the second thing, which is I am creating a new notebook. To do that, you need to have an account on Kaggle. So, you can register yourself in on Kaggle. It is just an online platform for data science. It is same like we are having Geeks for Geeks portal where we can practice code in C, C++, or any programming language. Similarly, we are having Kaggle for data science platforms, okay? So, you can go to the link and create a new notebook. You don't need to do it now because now all you need to do is just understand the concept. How the thing works, okay? Once you're having all the concept clear, okay? You know how the thing because the video will stay here. The stream still here will stay here on the channel itself. So, all you need to know is how the whole process works. Once you know that, you can proceed further with the code, okay? So, I'm sharing the screen again. So, this is how it will look once you open it for the first time, okay? And the link is already in the description uh uh of the code. Now, there are some codes already written in this. Some of them are uh commented, so I'm removing it and I'll only take the most important code. Okay? So, this is a notebook. I would say it is same like a Jupyter notebook. It's called as Kaggle notebook. This is where you can write the code. Okay? You can call it as an coding environment as well. This is how you can write This is how you can run the code. When you're writing it for the first time here, like here I'm writing play. So, here you can see session is starting now. Clear? From here you can change the name, like this is for TED Talk analysis, and this is we are going to do it from scratch. We are not going to use any special inbuilt function. We are going to do all of the things using the concept we have discussed earlier using lists. Okay? Here you can see it is still executing. It has provided a couple of resources like RAM, ROM, SSD, so that you can uh perform operations on it, okay? Now, if I'm executing it here, you can see here is the link of the data set. It is a CSV file. What is a CSV file? It is just an Excel file where we are having rows and columns. Okay? And uh we are going to take this. I'm adding a a cell here so that we can write the code. So, what should be the next step? I'm going to take this path. This is the path where the data set is located. Okay? I've already shown you the data set, how it looks. If you still want to go through it, this is the data set. Okay? You can go to this link. Uh means you can you can go to the profile and you can see the data talk data data analysis link. This is how the data set looks. Here we are having multiple rows, multiple columns, as I've told you. This is just a CSV format, comma separated values format. Same like an Excel, rows and columns. So, I'm taking this and I am going to use Pandas for that. Pandas is a library which you use to perform we use to take data set and analyze it. Clear? So, we are going to use Pandas for that. Pandas is a library that I've already imported because the code some codes are already written. This is a CSV file, so I write pd.read_csv. I'm expecting you know that libraries are something. Libraries are Okay, let me introduce you to the libraries as well. So, what happen sometimes like if you want to perform if you are having a list and a list if you want to find the maximum element. You need to find the minimum element. You need to find the average of it. So, what will happen if you want to do these operation? You having two options. Either you can use inbuilt functions or you can write your own logic. Clear? Now, there are this is just easy task that you can write your own logic as well. But, let's suppose there are some computationally expensive task like like you need to do a lot of things to get that thing done. So, what we can use? We can use some codes which someone else has written. You can take those codes and you can use them with reading their documentation, how they have used it. This This is called as a library. So, someone has made a library to work on data set. Pandas is one of them. We can take that library and we are going to use the function written in that. Clear? So, here you can see I'm using pd.read_csv which which is a function uh in uh Pandas, and I'm storing it in a variable named as df. Now, if I'm printing df, so here you can see this is the whole data set which is with us. If you go back, here you can see the first TED Talk name is The Dark History of uh Overthrow of a Why, okay? And here you can see it is the same. Uh The Dark is Yeah, here it is. Okay? And uh this is the first actually. I have made a mistake. Climate action needed, and this is the first TED Talk, and here you can see this is the first TED Talk. Okay? Uh the date, this is an updated data set we are having. So, this is as I told you this is the data set. And this is also nothing but a 2D list. We are having rows and columns. Yesterday we have discussed about how we can work on this. Today as well, we are going to convert this in form of a list or to be more specific, an array. Okay? Uh both of things are the same, but arrays are faster because the uh the operations are pretty much optimized. Okay? Now, what I will do, I will write df. Means, if you are directly printing df, it is giving you the whole data set where we are having five 5,440 rows and six columns. Now, what if I want to just display first five or a particular number of rows? I can write dot head, and I can define any number here. For example, 10. Execute it. Here I'm having first 10 TED Talks starting from index 0 to 9. 0 to 9 total of 10. If you are not defining anything, you will have nothing. Now, you tell me if I'm giving a number 13 here. If I'm giving a number 13 here, how many rows will be displayed? Do let me know in the chats. if I'm writing data of df.head of 13, how many rows I will get? I will get 13 rows. Simple, no rocket science. So, now what I will do First of all, means I'm just telling you a uh end-to-end pipeline, okay? Once you're having the data set, what are the things that you need to do? Okay, good Raja Yadav, good Rajat. Yes. The answer is correct. It will display you 13 of them. Great Shruti, nice King TV. So, what we will do? Now, we will check if there are some null values or not. Because if because it is a huge file of 5,440 rows and six columns, so there might be some values which are missing. So, we need to check if there are some missing values or not. And I'm going to do the same. So, I'm writing df.isnull.sum. This is the operation which will help you to check if there are any null values or not. And here you can see, we are having one row where author name is missing. Okay, we can have it, but out of 5,440 rows, one is okay. But even if you want to remove that, I'm going to remove that row now, okay? So, to tell you about this, so if I'm printing df now, here you can see 5,440 rows. Now, what I will do after performing this operation, I'll write df. drop and A. And if I'm executing it now, here you can see I'm having now 4,000 5,439 rows. There is a row where we are having one missing value. I have removed that row because it is just one value. Now, we are having a fully clean data set. Even uh I'm calling it as uh Once after doing it, I'm saving it in same variable because of the data frame I'm having. Now, if I'm printing the data frame, here is the original data frame I'm having now. Processed data frame where I'm having no null values. Clear? If anyone has any doubt, do let me know in the chats, okay? So, null value is something So, this is just an inbuilt function we are using here. Like how to find if there are null values or not. Uh and now let's go to the best part, I would say, where we are going to convert this into some sort of array, 2D list, and we are going to perform some operation on it. I'm going to first tell you the scratch method, then I'll tell you tomorrow about how we can do all the things in very easily. Okay. So, to do that, I'm calling it as df.values. If I'm executing it, df.values, so this is something what I will have. Now, this time it might look a little bit complicated to you, like, where the hell is this? But, if I'm checking the shape of it, shape means how many rows and how many columns are there. Okay, it is a tuple, by the way. So, if I'm going through it and checking the length of it, and execute it, let me zoom a little bit in so that you can see it. So, if I'm checking the length of it, here you can see I'm having 5,439 rows. And this value is nothing but an array now. It is same like a list, but in NumPy it is called as an array. Indexing is same, slicing is same, but arrays are way faster because they are optimized to do multi-processing. Okay? So, what we need to do once we are having the values, let me zoom a little bit in as well. So, once we are having the value, I'm calling it an a variable named as data. So, if I'm printing data, so I'm having a 2D list. Okay? It is same data. Like if I you are going through the climate action needed for the front leadership, so it is here as well. Then we are having Ousmane Benichi Albert, who is the author of it. Then we having December 2021, which is also there. Then we having views, then we having likes, then we having TED Talk. So from here to here, one list is open and closed. One list finished. Then in the next list we are having the data of next TED Talk. Then in this list we are having the data of nest TED Talk. Means it is a two-dimensional list. If I'm going for data of zero, this is the data of first TED Talk. Similarly, if I'm going for data of one, here we are having the dark history by Sydney. So dark history by Sydney, February 2022, 64,000 6,400 likes. So this is the data we are having now. So what you can do because this is the data now we are having, we can go through each and every row. We can find 5 3 0 0. Right? So this is 5,300th TED Talk. What was the title? Who was the author? And when it just happened. How many views it is having? How many likes it is having? Okay? So this is how the thing worked. Now, let's dig a step ahead and we are going to take author column this time. Okay? We are going to take author column this time. And how to take the author column. Now you might have discussed yesterday about if we are having a two-dimensional list. Okay? For example, this is the list we are having. Okay? And let's go to the zeroth column only so that you you can we can see directly from here as well. At zeroth index, okay? Because data of zero is a list. If I'm going off data of zero of zero, do let me know everyone, what I will get as an output? If I'm writing data of zeros of zero, what I will get as an output? Yes, let me know in the chats. Okay, let me Okay, drop NA. So, drop NA is just a function where means it will directly drop the rows where we are having uh means where we are having some null values. This is This will do just like this. Okay? So, we are having couple of answers. So, like climate. Okay. Uh TED Talk, yes. TED Talk will be the exact answer. Great, Abdullah. First column of the first row. Yeah, that's correct. First column, climate action. Uh yes, this whole thing will be displayed, exactly. So, let me display it here. Copy it and paste it here. So, data of zero of zero will give you the title of that particular TED Talk. Brilliant. What if I want to display the author name? If I want to display the name of the author, what I need to write here? Yes, let me know in the chats. If you want to know how many author Who is the author of the first TED Talk? What I need to do? This is at index zero. Right? This is index zero. Now, this is what? This is index one. Exactly. Great, Rish. Abdullah, okay. That's brilliant. So, we will go for data of zero one. This will give you the name of the author. Similarly, this of two will give you when it happened. This of three will give you how many views it is having. Four will give you how many likes it is having. Clear? Brilliant. So, this is just to give you a brief like how the whole process works. Now, as I've told you we are going to talk about authors this time. Now, if I'm writing I'm just changing the question a little bit, okay? If I'm writing data one of one, what do you think we'll get? If I'm writing data one of one and I'm printing the data frame here as well. If I'm writing data of one of one, what you will get? I'm telling you the very scratch method how you can take the list and after that performing the operation. If you are writing data of one of one, what you will get as an output? Second row's author. Exactly. If we are writing data one of one, you will get second row's author. Okay? Now, you are getting my point. If I'm going data of five of one, what you will get as an output? Or data of four. If you are going data four of one, what you will get? You will get the author of fifth author of this one, Mahendra Singh. Okay? So, now because we know how the process works, we can take for loop for that. Can we? So, I'm taking a list named as author. I'm going through for I in length of let's suppose I'm going for I in data. Okay? And what I will do? Or you can also go for for I in range of length of data. This is a basic for loop concept that I'm going through. I'm going through with the whole data and what I will do, I will print here data of I of zero or one. If I want to all the authors, what I should write here? I of zero or I of one? Or two or three? What I should write here? This I will go through each and every row. Okay? And this index will tell you which uh column you want to take. Okay. Shesh Ravindranath is saying the answer should be one. Okay, let's try it. And if I'm executing it, okay, the spelling should be correct, otherwise it won't work. And from here you can see these are all the authors we are having. It is displaying the list of all the authors possible. Okay? And let's suppose if I am taking a list here and I'm I am writing author.append And this if I'm appending it and executing it and here if I'm printing the author Let me create a new cell here. Okay. Let's print here only. So if I'm printing author, these are all the authors. Exactly in the same order. Ozawa, Sydney, Marlin, uh Martin. Ozawa Sydney, Martin. It is in the same order. The last one is AI Gore. Like it will take couple of second, but I will give Okay, it will not It is not displaying all of them, but yes, this is the answer. This is how it is displaying. Now First question as a data analyst that you are going to answer to me. Okay? How many TED Talks happened so far? That's something we know. But how many authors we are having? How many authors we are having? How we can find it? This author is uh means this author is giving you a list of all the TED Talk happened so far. But the problem is there might be couple of authors which are repeating. There might be couple of author we have given more than one TED Talk. Is it possible, right? So what we are going to do, we are going to find the unique authors. If I'm checking the length of author, what I'm having? 5,439. That should be the answer. But, because we want only the unique authors, so we are having a data structure in uh I would say Python, which is called a set. Right? And what is set? Set is same like a list, but in set we cannot have duplicate values. Right? So, what we can do, we can define a set here, and instead of writing all the values in data uh in a list, I'm going to add the values in a set. In list, we are going to use append. In set, we are going to use uh means set is nothing but uh a data data structure, which will only take input of unique elements. If you are passing duplicate elements in it, it will still give you unique elements. So, I'm defining a set here, and in that particular list in that particular set, I'm adding all the values. If I'm executing it now, earlier the number of authors are 5,439. Now, how many authors we are having? 4,443 authors only remained. Okay? That is the answer. So, we have found out how many authors we are having. This thing is not given in the data set. We have found it out. Right? So, that's our task that we have done it. Clear? So, this is how we have approached the problem, how many authors we are having. Clear? First question answered. Great. So, now you tell me know what are the other things that you want from me to know from this data set. We will try to find that out as well. Okay? So, we are trying total number of authors. How many total of number of authors are there? I I directly print it. Length of author. That is the answer. Okay? From here we can even dig deeper. We can find which author has given most number of talks. We can find that out. That's pretty easy. Okay? But uh This is the first answer that we have given in terms of total number of authors. We will as we dig deeper we are also going to find out which uh author has given how many TED Talks. Clear? So, till here everything is clear. If anyone is having any doubt, do let me know in the chats. Okay? And I'm going to switch to the next where I'm printing the data frame again. And this time we are going to take some other column. Let's take views column this time. And let's find out what is the average view a TED Talk is having. We will find the average views or average like a video is having. Okay? Similarly, we can take let's suppose Steve Jobs, which will be there. Uh it it might be there, but uh Bill Gates will be there. I'm not sure if Steve Jobs in there has given any TED Talk or not, but there is Bill Gates who are having millions of views. So, we can find that out how many What is the average views of Bill Gates' TED Talk? How many TED Talks of Bill Gates happened so far? We can find that out, right? Let's uh see. Okay, let's find it out from here only. If we can find out the TED Talk of uh Bill Gates. Okay? So, what I'm going uh I'm going through each and every TED Talk. And here I'm checking here if I'm going through each of the TED Talk author and here I'm checking if Bill Gates is there or not. If Bill Gates is there, I'm going to print the data of I. So, let's execute it. Hope for the best. And yes, brilliant. We have found the TED Talks that Bill Gates has given. These are the links to it. You can go to the links and find out. Right? You can check the title, The Innovation We Need to Avoid a Climate Disaster. These are the number of views. These are the number of likes. How the pandemic will shape the uh shape the near future in at uh June 2020. March 2015. These are all the TED Talks given by him. We can find the average views and likes, right? But now let's stick to that uh same thing where I'm going through rather than going through the data frame where we were discussing about author column, we are going to now discuss about the views column. Okay? To know about the views column, what we will do? I'm writing df uh Okay. Can anyone wants to give it a try how we'll find the average number of views? First of all, do let me know if I want to print views, what should I write here? Instead of in place of it, what should I write here? Do let me know. For I in range of length of data, what should I print? What should I write in these two index so that I will get all the rows or all the views? What should I write here? Do let me know in the chats everyone. So, this is at index zero. Title is at index zero. Okay? Similarly, author is at index one, date is at index two, views are at index three. Okay? So, Ravinash says Shruti, Rajat. Yeah, that is the correct answer. So, no, four is not the correct answer. The correct answer is three. So, I will write I of three. So, if I'm executing it, here you can see 40,000 uh means 404,000, 214,000, 412,000, 427,000. This is the answer, right? Now, because this What is this? These are the number of views we are having. So, I'm creating in the views list, and every time I'm doing it, I'm feeding as views uh dot append. Okay? I'm appending in a views. If I'm executing it and here if I'm printing the views, these are all the views we are having. Okay? Now, what I need to find? I need to find uh if I'm printing uh for example, the length of it, how many views are having I'm having 5,439 different videos, and for each video I'm having a view. Right? Number of views can be different, obviously. Now, to find the average number of views, what should be the formula? Just let me know in the chats. How I will find the number How I will find uh the average views? Yes. So, uh Ishan is saying, yes, here I is the row and he here uh three is the column. So, what I'll do? I'll go through each and every row and select this column. Third column, which will print all the column all the basically views. So, what I should do? So, I should write sum by count. Exactly, that should be the formula. Well done, Arunath. And Phoenix as well. So, what we will do? We will find the sum of views, which will give you total number of views in all the TED Talks. It should be sum, not sim. So, if I'm printing sum of view, these are the total number of views TED Talk is having. So, this is also thing that we have just analyzed. Uh so, let's write here total number of views in all the TED Talks. That's something we have analyzed. These are the number of views. You can see 1 2 1 2 3. I think it's 11 billion views. Just means Sorry if I'm wrong, but I think it's 11 billion views, okay? So, now because we want we need to find out the average view. So, this will give you the total number of views and we can divide them by the length of views. Length of views means how many TED Talks happened so far. You can also write length of data. How many TED Talks happened so far? If you're executing it, this is the average views per TED Talk. It is in the It is in float format. You can type cast it into integer because nothing can have like you cannot have 206,000 means 2,061,954.89 views. You cannot have it. So, if I'm executing it So, 2,061,954 are the total number of views. Clear? So, this is also something we have found out. So, let's write it here because So, average view per video on TED Talk. That's also something we have found out. Right? Do let me know in the chats if you want to know about something like Arun is saying find the average views of Bill Gates. That's a good question. So, let's find out. And this is the formula that we have already written to find it. So, what I'm going to do I'm writing it here, creating a markdown, and find average number of views for Bill Bill Gates. Nice question. So, what we will do? We'll go through each and every row, and we will check if the author is Bill Gates or not. That's the first thing that we have done. Okay. Once we find out, okay, if this is Bill Gates or not, so we are printing the whole row. But we do not want to print the whole row. What we all want to print? Can anyone wants to give it a guess? What I want to print? Because obviously I don't want to print the whole row. I just want to print the views. And at which index I'm having the views? Do let me know in the chats. At which index I'm having the views? Exactly. We will append it to a new list. And but what I will append? Do let me in the chats about the index. I'm creating the new uh the same list. And here you can see the third column should be there. If I'm printing third, so these are all the views of Bill Gates TED Talk. I'll take it. I'll save it in views. {dot} append. Simple. Execute it. Print the views. This is the list. We'll find uh sum of all the views divide by how many TED Talks happened so far by the length of views. What is the length of views? If I'm executing the length of views is eight. 1 2 3 4 5 6 7 8. Total eight TED Talks happened so far. And sum of all the views are this. So if I'm executing it, the the average view of uh uh is 9 million. You can even convert it into an integer because as I've told you, you cannot have uh decimal views. So if I'm executing it, the total number of views of Bill Gates is this much. Right? And this is the answer. Yes. Anyone else want to give it a try? Want to add something? Like what do you want to analyze from this data set? Do let me know. I'd be It would be I would be more than happy to answer it. Okay. So, average number of views is there. And now what we are going to do, we are going to go a step further. We are going to dig a step further. And what we are going to find, we are going to find something which is not given in the data set. That is about like to view ratio. Okay. Like you can you can find out means the most popular TED Talk happened. You can find out the most means to find the most number of views TED Talk, you can sort the whole data frame in terms of view. You can find it out. But it is not possible the TED Talk which is having most number of views are having most number of likes as well. You can take any Bollywood song. Even means I don't want to comment on that, but yes, it happens. The song might be not that good, but they are having a huge number of views. Right? So, what what will happen in that case? You need to take the help of like to view ratio. Right? For example, if we are having a TED Talk where out of 1,000 we are having 500 likes. So, like to view ratio is almost 50%. But we are having a TED Talk where we are having 10 million views, but the likes are let's suppose only 100 or 200. So, it won't work like that. There might be bots which are liking it. Okay. That happens sometime. But what we will do, we'll take this and we'll find view to like ratio. Now we are just going to find the view to like ratio. And after that we are going to append it in this list only. This is going to be really interesting thing. Okay. So, let's find Just take care uh, means just, uh, don't take seriously with the spelling. It It happens sometime. So, now we are going to find like to view ratio. Okay? And as we proceed further, we are also going to discuss like like let's suppose if you want to learn about space. If you want to know about all the tech talks happen on space, we can find it out. We are going to find it out at the end of the session. So, just stay tuned. And I'm also having a surprise for you. Uh, I'm going to discuss that in the at any point of view at any point of time. Okay? So, uh, now we need to find out like to view ratio. So, what I need to do? I'm going to apply the same approach here for I in range of length of data. And what I'll print? First of all, just whenever you are writing an algorithm or writing anything, make sure to first use first print the values so that you can see if you are going uh, means as per the plan or not. So, that is why I like to print the variables and see if I'm going as per the plan or not. Now, I'll go through the data and because I what I want to find, I want to take the views as well as likes. Where we are having views? Do let me know in the chats. So, here you can see 0 1 2 3. At third index I'm having views, fourth index I'm having likes. So, let's take uh, third index I'm having views. Uh, okay, I need to remove it. Okay. Here I'm having views. So, let's execute it. Here we are having all the views. At the same time with a comma, I also want to print the likes. So, these are the number of views, these are the number of likes. Simple? Simple view to like ratio. Okay? So, what we need to do once we are having view and like we will find the view to like ratio as well. How we will find? We will divide the views which are at index three, divided them by divide I of four. If I'm executing it, here's the view to like ratio, 33%, 35%. For some of the video in means on an average we are having 30 to 35% view to like ratio. But we can have even better than that as well in some of the cases. We'll find that out, right? What is the average view to like ratio, what is the minimum view to like ratio, and maximum view to like ratio as well because we can find out. Why not? So what I will do once I'm having that now view to like ratio is like 33.66. We can round that value off. Or you can directly convert it into an integer, like 33% or 34 or 35. I'm going to convert it into integer format because I don't want to take care of about either it is 33.01 or 02 or 03. I just want to take care about the integer value. So once we are having all the view to like ratio, let's create another list. As I've told you, we are creating a hell lot of list. Why? Because I am telling you the scratch method. How you can do it if you you means you want to write your own logic to do the things. So I am writing view underscore to like uh ratio. I'm creating a list here. And once it is done, I'm going to take view to like ratio and append the values in this. Execute it. If I'm going for view to like ratio view underscore to like ratio. So this is the view to like ratio. And sorry, I just shifted the tab and I was at this. Okay. And I will find the length of it. Length is obviously the same. Now what I want to find I will want to find what is the maximum view to like ratio. Okay? And if we are printing the uh I would say max of it. Max of view to like ratio. Just give me a random guess what it would be. It would be third It is 36. Okay? And what is the minimum uh of it? Let's find. The minimum view to like ratio is 30. Okay. So, on an average is 30 to 36. This is the uh view to like ratio we are having. But from here as well, we can find out, okay? Because uh from this as well, we can map the videos. Clear? So, this uh what is the view to like ratio? This is the view to like ratio we are having. We can even add that view to like ratio to our data frame. How we can do that? For example, this is the DF we are having, the data frame. In this DF, I want to add, let's suppose, view {underscore} to {underscore} like {underscore} ratio. Okay? Or I'm also writing it VTL means view to like ratio. Clear? So, that we can make it a little simple. So, this is the view to like ratio I want to add as a new column. And uh with which data I want to add? I want to add this whole row. Or this whole list. After executing it, just hope for the best. And the value trying to set in copy. Okay. And uh Okay. Let's give it a try in the data frame it is present or not. And now you can see a new column is added in the data frame named as view to like ratio. Now, what you can do? You can find You can sort the videos based on view to like ratio as well. How? I will let you know in just a second. But this is how we have created a new column. You can delete a column. You can select a particular column from here as well like uh if you want to discuss about title, you can select title. But, I was telling you scratch method because this will help you to make your own logics. This will make your logical ability better. This is the main thing. Either you want to become a programmer or in any field, the practice makes the man perfect. Right? So, the more practice you will do, the better you will become at this. Clear? So, so far so good. If anyone is having any doubt, do let me know in the chats. Okay? And if you like the session, please like, click on the like button, please to our channel. And if you want more such uh events, just do let me know in the chats. Right? So, this is the data frame we are having. Now, let me know in the chat what you want to find out. Okay? Sort by date. Yes, we can also sort the different thing because in the data set itself, if I'm going through the code that is already shared with you, in the code itself, it is given how we can we can even find out at which day of the month we are having most number of TED Talks happen. At which month of the year we are having most number of TED Talks. Which year most number of TED Talks happen. Okay? What's the overall trend going on? Either it is going up or down. We are going to find all the things. We are going to just means uh squeeze the data set and find the most information that we can find. Okay? So, this is the data frame we are having. And this time what we are going to do, we are going to go a step ahead and we are going to find out the uh description of each and every column. Okay? This time we are uh using some inbuilt function because now you know, if you want to know about the author, for example, uh Mahendra's Singhi, you can find how many TED Talks happened of him. What is the average view? What is the view to like ratio of him? We can find out, right? Now, what we will do, we are going to make the groups of it or make uh means find out to do like whatever we things we are doing earlier using the logics, how we can do the same thing using the inbuilt methods. Okay? So, for example, if I want to find out the same thing like TED uh talks of Bill Gates. If you want to find out the TED talks of Bill Gates earlier how we have done it? Earlier we have done it using this logic. Uh here. Right? We have written whole logic. Now, what we can do? We can take the data frame. Now, what I want to know? I want to know about Bill Gates only. Right? So, Bill Gates, who's Bill Gates? Bill Gates is a author. So, we will write author. Make sure to write the correct spelling, otherwise it won't work. If you're writing DF of author, it will print you all the authors. Now, what you want? You want to know about Bill Gates. So, I'm writing DF of author is equals to is equals to Bill Gates. If I'm executing it, here you can see it is showing you false. All of them are false. There are 5,439 values. It is printing all the values wherever Bill Gates is there, that would be true. Rest all of the cases it is false. Okay? What I will do? I'll take this whole area of true false and pass it to the original that we are having. Now, if I'm executing it here are the TED talks. Total eight TED talks happened so far. And the view to like ratio is almost 33. Right? So, we don't need to now write the special function. I have just told you so that you can write your own logics as well. Okay? Now, what if you want to find out what is the average views of it? Okay? Because that's the data frame we are having. Can we find the views? Can we take the views of it? Yes. We have taken the views of it. This uh these are all the TED Talks of Bill Gates. And we can copy it, we can paste it here, and we will find the we'll take the views of it. And these are the views of it. Right? And what is the average view? We can even find out using dot mean. Because in date in pandas, a lot of things are in bit. What is the average number of views? 7 million uh 7.7 9.725 million. Let's find out if we have find the earlier answer correct or not, and that is absolutely correct. Okay? This is how the things are done. That's how easy it is. All you need to know is the proper guidance, how the things works, and a prac- practical knowledge basically. Okay? If you're having a data set, what are the steps that you need to find out? If you want uh something you found out, what are the logic that it that need to be written? Okay? So, these are the average views of I would say Bill Gates. Okay? Do let me know in the chat what do you want to find out. Okay? The author who gave most number of TED Talks. Yeah, that is a good question. So, for that purpose, we are having two approaches. First is we need to find out or we need to sort the values using inbuilt function. That thing can be done uh easily. Okay? Our second uh option is you can use some inbuilt function for the same. Okay? Now, let's suppose if you're having a data frame because uh this time we need to find out which author has given the most number of TED Talk. So, we need to take author column as uh author as the main column. Now, if I'm using describe, Okay? Uh let's hope for the best if the spellings are correct. And yes, spellings are correct. That is why it is taking a couple of second. And from here you can see the top author. Uh it is just giving you a brief about the column author. So, there are four 5,439 total number of values in this. Unique values are 4,443. Let's compare it. That means these are the total number of unique authors we are having. Let's find out and compare it from the top if we have find the correct answer or not. 4,443. Absolutely correct. So, what we can do? And this is the author which appear most of the times. How many time it appears? 45. Means Alex is the author who has given most number of TED Talks. Let's find out who is Alex and how many TED Talks he has given. I'm removing all the things. I'm just taking and in the condition I am going to write his name. So, if I'm executing it, here you can see these are all the TED Talks happened from Alex's side. Blood, women, a new design, how the world's tallest sky- skyscraper. So, a lot of them are here. Right? And if you are finding the average number of view or the total number of views, let's find out the total number of views of Alex only. Because he would be at the top one, definitely. We will find the sum. These are the total number of views of Alex only, which is around 187 million views. Can you imagine it? From just one author. Great. Now, now let's go to the last topic of discussion today, which is what if I want I want to find out a particular topic. Okay, let's suppose you are a student from or if you want to learn about space tech. Okay, black hole like I'm a huge fan of it, so that's why I'm discussing about it. So, if you want to learn about space or black hole or wormhole or basically about space and I want to know about all the TED Talks happen on space. So, what I will do? I need to I need to find all the TED Talks so that I can go and watch them. That will act as your personal recommender. Right? So, how you will do that thing? We will take this. Okay, I means not only take this. I'm going to write the logic for it. So, first of all, I'll take the data frame. I'll go and take the same logic first of all. Okay. Length of data. Okay. And once it is done, now what I want? I am defining a variable here. Okay, the variable is suppose the topic I want to search. What I want to search? For example, space. I want to search space. All the topics with the space. Now, how I can find the title? How I can find the topics on space? I will take this title column. So, what I am doing? I will take data of I of zero. If I'm executing it, I'll have all the titles printed. Okay. Now, the problem is in some of the TED Talks, okay, it happens a lot of time. Some of the TED Talks I am writing space, but in the TED Talks the title might be S P A C E capital S. But if we are comparing them, they are not equal. Even if in some of them it might be for example, space. They are also not equal. So, what it will what we will do? Whatever we are having, we are going to lower case them. If we are lower casing them, either it is this space or this space or even this space, the all of them will be true. So, what we will do, I will take each column and I'll lower case them. Simple. After lower casing them, this is the title we are having. After going through the title, what we will do, we will find and this is the simple approach, if we are having a topic, if topic is in the title or not. I'm not writing any special function of all right. I'm using the inbuilt functions, like if the topic that I have written space is in the title or not after lower casing. So, what it will do? And here I'm going to print, let's suppose, data. So, what will happen? First of all, it will go to this and it will check if space is written here or not. Not written, go to the next one. Space is written here? No. Go to the next one. Next one, next one. And it will print only the ones where we are having the topic space is here. Execute it and check. And here you can see space. Mhm. Okay. We are printing data. It should be data of I because we are printing the whole data frame. So, if I'm executing it, here you can see how feeling captured the space between hope and despair. Okay? The documentary film that explore trauma and make the space for healing. Now, this space and that space is uh obviously different. You can uh write uh on a specific topic, for example, the power of spaces. So, that that is a different topic. Let's call it as black hole. If we are having topic on black hole, yes, we are having couple of talks on black hole. Steve uh Hawking's black hole paradox explained. So, these are the TED Talks. You can go Go watch them. Right? That's pretty easy. You can click on it and you can you can reach to the page. And here it is. Just go through it. Right? So, this is how easy it This will act as your personal recommender that will work for it. Okay? So, do let me know in the chats if you're having any question. Do let me know in the chat if you're having any question at any point of time. Okay? So, this is how you can do it. Totally depends upon your topic. Either you want to do it on let's suppose disaster management. So, these are all the topics on disaster. If you want to know about let's suppose politics. These are about the politics. You want to know about India. Here is India. If you want to know about education. Here are all the TED Talks on education. Similarly on COVID. The list goes on and on. Totally depend upon how you want to do it. How what you want to learn. Okay? So, it would be COVIDs. If you're having COVIDs, then that might be happen. Uh so, if I'm writing, so double quote starting, double quote open, and COVIDs. Okay, there are there might be no TED Talks on COVID probably. But uh on education, it would be there. Right? So, these are all the TED Talks of a specific topic. Clear? Now, uh as we have discussed earlier as well as per the students' demand because yesterday the session link was also not displayed on for our live program. So, this is the live program page. The link is also given in the description. You can register yourself if you want to have a consultants. Okay? Because what will happen, lot of time you might think like you even if you don't want to become a data scientist, or if you want to explore this field, you want to know okay if this is a good fit for me, this field is a good fit for me. So, in that case, you can register yourself. Our counselor will call you, will contact with you, and we'll discuss with you what are your goals. Okay? And accordingly, we can plan out if you want to learn it, if you want to explore this field, then what should be the case? Right? Because sometime it might happen you just jump into the fees uh jump into the case like if you want to become a master in data science. Okay? You just go for the master. You just means uh pay uh let's suppose thousands of means fees in lakhs for data science program, but at some point of time you might understand after paying the fees that this is not the field where where I want to become what I want to become. So, in that case, you need to have uh means you need to see if that field fits for you or not. For that case, you can consult with us. Uh you can register with the form, and we are having live program as well where you will be mentored in the same way like we are discussing now. Okay? If you are having any If you are having any question, do let me know in the chats, okay? So, you can register yourself, and the coupon code is all already in the description that will expire by the by the end of the day today. So, let me summarize whatever we have done so far. And tomorrow, what we are going to discuss, we are going to discuss about how we can sort the values, how we can make beautiful visualization, how we can make the graphs, right? To give you a brief about the code, I'm going to show you the code as well. Let me show you the code as well so that you can have an understanding what are the things we are going to learn. So, this is the code where you can see we have already discussed with it finding the most popular TED Talks. These are the most popular TED Talks. Right? This is the thing that we have already find out. Right? Alex is the one who has given most number of TED Talks. After that, we are also having at the month of February, we are having most number of TED Talks. Okay? And uh uh in 2019, most number of TED Talks happened. Before that, it is decreasing and also it is decreasing because of COVID. Right? The events are not possible. And these are all the uh I would say, for Alex, these are all the uh TED Talks. Clear? The like to uh means finding the best view to like ratio, that's something we have find out. We have find it out. Okay? And uh finding the talks based on the tags, that's also something we have done. Right? These are all the TED Talks and we can just go to the link and find out and go through the TED Talk. Okay? Uh finding the most popular TED Talk speaker, that's something we have already done it. Clear? So, that is it from my side. If you are having any question, do let me know in the chats. I'd be more than happy because we are still having two to three to four minutes. Please share the code. Okay, I am going to share the code as well with you. So, uh Okay. Sure uh Okay. What I'll do, I'll make it public from here. Uh like Let me share it with a public tag. And uh Okay, tag should be written. Uh can we save it? And here you can see inactive Okay. So, this will be public and displayed at this link only. I would say, if you go to this page, TED Talk or this data set. But so, what you need to do, there is a link given in the description. You can go to my profile and in the profile, you can see the codes. Okay? And the TED Talk analysis scratch is the one. Okay? You can click on this and the code will be shown to you. And best part of it is you can directly execute from here. You don't need to install anything. Okay? So, you can directly go here and you can find the links. So, kaggle.com/asifjan27/code and you can get all the codes. And the link is already given in the description. You can find the links. Okay? So, yes. So, now this is the time for us to discuss about your query. So, if you're having any query, do let me know in the chats. How we can avoid the for loop and perform the same operation in the list comprehension for the other methods? Yes, uh Shokai is having the question. So, the question already answered. I was just telling you how to do the things in the scratch method, where you means even if you don't know about the inbuilt functions, how you can write the code by your own. Because sometime it happens. Like whatever you want to find out, you might have you might not have the inbuilt functions for that. So, in that case, what you need to do? You need to write your own logical ability. So, to do that, you need to have a good logical ability, obviously. So, what you need to do? You need to write the logic by your own. But, tomorrow, like today as well, we have discussed about some of the things. But, tomorrow we will discuss in detail. If you want to know about the top author, if you want to sort the values in terms of views, if you want to sort the sort the whole talks in terms of like to view ratio, likes, uh anything, you can do it. We are also going to make different kind of plots or visualization on that. Apart from that, I am also going to give an assignment on our custom data set that is not means discussed anywhere on internet so far. Okay? So, we are having a custom data set that was just public a couple of weeks ago. We are going to work on that data set. Okay? And that is an assignment for you. I'm going to give you a of questions on that. Okay, I will give you a data set like to give you brief of that. So, this is the data set that we are having. Okay? And uh I'm also going to share this link tomorrow with you. So, here you can see uh in GeeksforGeeks article, there are around means there are more articles but this data set is around 34 thousand articles published on GeeksforGeeks. Okay? And here we are having same kind of thing. The title, who's the author, when it is published, what is the link, either it is means easy, medium, hard, expert because they are different kind of uh articles here. So, what we need to do, I'm going to ask you couple of questions that you need to answer and submit. And based on the submission, you might get a lot of things. You will definitely get a lot of things, but that would be based on your performance. You can get the certificate if you went to the threshold, if you means the top 100 uh candidates will get the certificate of the data science master boot camp. 5 days, okay? And apart from that, you can get the scholarship on our data science live program that is of 10 weeks live interaction with the mentors, Arpit and me. And apart from that, you can also win exciting goodies. Right? So, how to access the assignment? That is something I'll tell you tomorrow. Okay? Because tomorrow at the end of the uh session tomorrow at around this point of time only after exactly 24 hours, I will tell you how the assignment works. I'll give you the questions as well. That is something that you need to submit. I'll give you the exact instruction. You need to follow those instructions to submit it. Otherwise, you might submit it in a different manner, we are evaluating it in different manner, and you might not get selected. Okay? So, do uh let me know in that as well. And uh do cover Okay. Okay. R versus Python. Python always. So, but that depends upon the use case. Most of the time I use Python because all the thing that you can use in R can be used in Python because Python is having more number of libraries. Multiple times more number of libraries uh that you can use, right? But in R it is not something like that. Okay. So, that is it. Thank you so much everyone. It was a wonderful session. Do let me know in the chat. Do like the video. Subscribe to the channel if you want more such session. Do let us know and we are more than happy to engage you in that and we are like now started working on the data science field as well. So, there are more sessions, more better and better sessions coming up this time on data science field. So, do let me know. Do let us know in the chats in which topic you want sessions to be. And yeah, thank you so much everyone. I'll see you tomorrow and yeah, same time and bye.
Original Description
Data Science is a quiet advance and complex to learn because there are a lot of things like Statistics Data Analysis, EDA, AI, Machine Learning, Deep Learning, Text Datasets, Image Datasets and a lot more. So we've made it really simple for you with our 5 Days Data Science Crash Course for Free. You'll learn the components of Data Science and not only that you'll also make 2 projects on Data Analysis with our Custom Datasets.
Data Science live course - https://practice.geeksforgeeks.org/courses/data-science-live
Use this code for 20% off on Data Science live course - STARTDS
Register here for Data Science master Bootcamp -https://practice.geeksforgeeks.org/courses/data-science-bootcamp
This is Day-2 of Data Science Crash Course by GeeksforGeeks where you'll learn the fundamentals of Data Analysis using the following topics
⭐️ Topics for the Video ⭐️
- Introduction to Kaggle
- Getting Started with Pandas
- Dataset Handling
- Data Preprocessing
- Data Analysis Fundamentals
- DIY logics for Data Analysis
- Data Analysis on TED Talk Analysis
Subscribe to our channel for more such content ✌🏻
Connect with Ashish -
LinkedIn: https://www.linkedin.com/in/ashish-jangra
Dataset Link: https://www.kaggle.com/ashishjangra27/ted-talks
#DataScienceBootcamp #MachineLearning #GeeksforGeeks #
Playlist
Uploads from GeeksforGeeks · GeeksforGeeks · 12 of 60
1
2
3
4
5
6
7
8
9
10
11
▶
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How I got into Walmart | Shailesh Sharma
GeeksforGeeks
Upgrade yourself In 29 Days | GeeksforGeeks
GeeksforGeeks
Learn AWS Fundamentals For Free
GeeksforGeeks
Conversation With Young Achievers | Meet the winners of Bi-Wizard Coding Contest | GeeksforGeeks
GeeksforGeeks
Meet The Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
Interview Prep Strategies | PayPal
GeeksforGeeks
OLX Interview Preparation Strategies | Hukam Singh
GeeksforGeeks
Meet Some More Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Microsoft Azure For Absolute Beginners
GeeksforGeeks
Python for Data Science | Data Science Master Bootcamp | Arpit Jain
GeeksforGeeks
Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
How to prepare theory subjects for SDE interviews | Geeks Summer Carnival 2022
GeeksforGeeks
Get Your Tickets To The Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
TED Talk Data Analysis Project | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
How I Secured AIR 9 in GATE'22 | Tushar
GeeksforGeeks
Learn Java Backend Development | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
How to Recognize which Data Structure to use in a question | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
Learn Data Structures and Algorithms | GeeksforGeeks
GeeksforGeeks
Interview experience at Flipkart | GeeksforGeeks
GeeksforGeeks
Lets Prepare for GATE'23 the Right Way | Sakshi Singhal | GeekSummerCarnival
GeeksforGeeks
Highest Paying Jobs in 2022 | Ishan Sharma | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival 2022 | 5th April- 11th April | GeeksforGeeks
GeeksforGeeks
Preparing for SDE interviews | Soham Mukherjee | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Full Stack Development with React & Node | Utkarsh Malik | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
Introduction to Open Source and Roadmap to GSOC 2022 | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Web Scraping in Action | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Getting Hired at BITCS via GfG Job Portal | Get Hired With GeeksforGeeks
GeeksforGeeks
How to build a faster landing Page | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival | 5th To 11th April, 2022 | GeeksforGeeks
GeeksforGeeks
How to get ideas for Startup | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Journey from Tier 3 to JusPay | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Dispelling Myths and Pre conceptions of Programming Languages
GeeksforGeeks
Must Do System Design Questions
GeeksforGeeks
Understanding Sorting Techniques in an hour | Keerti Purswani | Geeks Summer Carnival
GeeksforGeeks
Get Hired at NEC | Job-A-Thon 8
GeeksforGeeks
Journey from Tier 3 college to Microsoft | GeeksforGeeks
GeeksforGeeks
Get Hired with GeeksforGeeks at SuperK | Job A Thon 8
GeeksforGeeks
GeeksforGeeks: Redesigned
GeeksforGeeks
From Tier 3 to cracking multiple interviews | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Youtube Data Analysis | Ashish Jangra | GeeksforGeeks
GeeksforGeeks
DSA Self-Paced Course Preview | Sandeep Jain | GeeksforGeeks
GeeksforGeeks
GATE Live Classes | Prepare for GATE CS 2023 | GeeksforGeeks
GeeksforGeeks
Journey from JIIT to Adobe
GeeksforGeeks
Life Is Unfair Ft. Shonty badmash | LIVE Discord Session | A GeeksforGeeks Exclusive
GeeksforGeeks
Interview Experience at Google | Tech Dose
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Interview Experience @ Amazon | GeeksforGeeks
GeeksforGeeks
My journey through the tech world from India to US | Vidushi | GeeksforGeeks
GeeksforGeeks
Complete Interview Preparation Course | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Getting Hired at FiftyFive Technologies | Job-a-thon 9.0
GeeksforGeeks
GFG Karlo, Ho Jayega | GeeksforGeeks ft. Khaleel Ahmed
GeeksforGeeks
How I got job offers from 2 big companies : Arcesium & Microsoft | GeeksforGeeks
GeeksforGeeks
LINUX for Beginners | GFG x Itversity
GeeksforGeeks
My interview experience at Walmart | GeeksforGeeks
GeeksforGeeks
Get Hired at Speckyfox
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
More on: ML Maths Basics
View skill →Related Reads
📰
📰
📰
📰
Blending and Voting: Four Noses, One Bottle, and the Blender Who Graded His Own Homework
Dev.to · Sachin Kr. Rajput
Data Science Interview Questions: The Complete Prep Guide (2026)
Medium · AI
Data Science Interview Questions: The Complete Prep Guide (2026)
Medium · Machine Learning
SkewAdam cuts training memory over 60%
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI