Data Analysis with Pandas and Python - Complete Beginners | Shubham Sarda | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Data Analysis with Pandas and Python - Complete Beginners

teacher avatar Shubham Sarda, Python Developer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      What is Pandas?


    • 2.

      Starting With Pandas And iPython


    • 3.

      Working with Jupyter Notebooks


    • 4.

      Important Jupyter Notebook Commands


    • 5.

      Working with CSV, Excel, TXT and JSON Files


    • 6.

      Working with API Response


    • 7.

      Indexing and Slicing Dataframe Tables [Part 1]


    • 8.

      Indexing and Slicing Dataframe Tables [Part 2]


    • 9.

      Deleting Columns and Rows


    • 10.

      Adding and Updating new Columns and Rows


    • 11.

      Thank You For Being Here!


  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Welcome to Data Analysis with Pandas and Python For Complete Beginners,
This course will help you to understand fundamentals of Data Analysis with Python and its Pandas library. 

You will learn,

1. Perform data analysis with python using the pandas library.

2. Learn Data Frames, basic plotting, indexing, and groupby

3. Understand about Jupyter Notebook, iPython and more.

4. Learn how to work with data more effectively with CSV, TXT and API's.

After completing this course you will be ready to expand your knowledge over Data Analysis and Pandas. 

Meet Your Teacher

Teacher Profile Image

Shubham Sarda

Python Developer


Hey there!

I've created Complete Roadmap to become a Developer with different projects, specifically for the SkillShare audience. 

With this roadmap we will start with Python Programming, learn about basics, important concepts and solve some real life problems by building projects. Once we are ready with Python, its time to gain more experience with different field projects in Automation, Data Analysis, GUI Programming and Web Development. 

Here is Complete Python Programming - 
Python A-Z: Learn Python Programming By Building Projects
Python Programming - Advanced Concepts

Python Projects - 
Python Project - Building Twitter Bot With Python and Tweepy
Python GUI Programming - Build a Desktop Application with Tkinter and SQLit... See full profile

Level: All Levels

Class Ratings

Expectations Met?
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. What is Pandas?: Hey, guys will come back in. This letter will be talking about one most important fight on library called pandas. So Pandas is quite a game changer when it comes to analyzing data with Fight On, and it is one of the most preferred and violently you stool in data and unless is, and also playing with data that are stored in CSE. File text file Jason File and different type off a PS and downloadable file. So this is one of the most important library, which is currently used to perform operations over data. The major Pappas off behind us is to be used for data manipulation, analyzes and cleaning. So it is well suited for different kind of data in which we require some type off manipulation, or maybe changing off data on maybe cleaning and removing on required data. Or maybe performing analyzes. Like if I talk about basic example, I usually do Web scraping. That means I don't contain from different website. Store them in a CSP or Jason file, and then you spanned us to perform different experiments with them to get my desired drizzle. So that's how it is used. It is suitable for data's that are stored in either tabular form or some ordered or an order form or in some form off metrics on maybe some unlabeled data. So you should know to studio die in some type of form, and you should know that how the do it I store or how the data is structured. And then you can use pond us to perform different operation now before talking about anything else with pandas or before performing anything I would request You don't visit the official website off Pandas Library, and it would be really helpful for you to understand a bit about its history and how you can walk along with it. Don't worry, we are going to go home. Everything. I just want to make you a habit going to sound different libraries because there are over 1 70,000 libraries and you might need to use different libraries a different point off time, maybe in future with some project. So it's a good habit to judge a library and understand. The second thing I would request you to do is visit bye bye on such about bundles on just really out its description. That would be really helpful for you and also you will be understanding a lot more thing about behind us. This is the first thing that I do with any library on my recumbent us as a good habit. So just take a pause, visit pie pie and search about pandas and also visit the official website off pandas. So you will get a basic in four now before installing bond us. I just want to talk about one small thing. That bond us is, ah, high level library. That means there are certain other library least that are required to grant pandas. So the library that is required is numb by on what is numb by. So number stands for new medical pipe on, so it is a library consist off multi dimensional Aires. You can consider it as multi dimensional list. So when we play with metrics or when we play with different type off processing formats which use inputs off mighty dimension at A at that point of time, we used number. It is also one off the most important scientific library. If you have used open city dump, I would have already been installing new system, and if you're going to use pond US number, I will automatically get installed in your system here. The point was to make you understand about pandas that it is a high level library, and it requires some other libraries to work perfectly. So without any delay, let's create a new full local by a bond us on. Let me open my command from. So first I need to install pandas. You can do that in any full left. Let me install my partners. All you have to do is pip Install partners. One status done. Just try to verify that all you have to lose in value by tone shell and then import binders . So I haven't got any air while importing pond off. That means my libraries and stroll. There are chances that on some window system you might get better with pandas or number I. So for that you have to do one simple step. Remember, this step is only for someone who is getting error while installing any library. So all you have to do is this. Visit Google and search about pre compiled bite home libraries, and here you will get information about pre compiled libraries. Just visit the Force One that missiles for banners. Here. Here you go. So now you have an executable file. Check your pie tone origin. Since this is for 3.7 words in and these two are the words in for 32 bit and 64 bed it mean don't know this one. Remember, you have to install boat numb by as you respond as the first will be the umpire and the second will be behind us. And remember, I have downloaded this in my pipe on does so I have to be inside my pipe behind us file All you have to do is pride Pip install and then in courts give the fine name that's all if you breast in the Eurobond as will be in strong But I have already installed. So I'm not going to do this process. That's all for this lecture. We have talked about pandas we have in store ponders and by now we also know stroller how to install pre compiled libraries whenever we are going to get better. So you are good to go over different methods. That's all for this lecture. In the next letter, I will be talking about I point on as well as stupid a notebook. So these two are really important to see you in the next one. 2. Starting With Pandas And iPython: we'll come back and this lecture will be talking about I pandas on the next lecture. We were talking about Jupiter nor Bow. So what are these two? So firstly, I want to talk about whenever we are going to work with pandas. So we'll be dealing with Data's So we are not going to work with any editor. So I opened Atom at the back just for some compassion. But at this point of time, I pandas mean it is just exactly same like interactive cell. But it would be easy for us to the mind different type of data. So that said, what are we going to do with partners? So basically, we take some data in the form off list, additionally, or maybe a text file, maybe a CSE file. Maybe I excel file or maybe a Jason file, use our fight on library and then we use our different data structure, which we call us data frames. You would understand everything once we start doing all the operation that we are going to perform with the help of pandas, command will be performed over data frames. Maybe if I talk about slicing, indexing margin, joining concatenation or maybe dealing with columns and rows or maybe other form off data manipulation. Everything would be perform or our data frames. So without any day, let us get started. So first I need to install my I bite on. All you have to do is just pip install. I bite on and don't forget to check its description or bye bye while it is getting downloaded. Leaders discussed for use molding while we use interactive shell. The main reason is to test our commands on whenever we don't stock a month's free majorly for cause on interactive ship. Because we get a result in strictly or if there is any error, we get that result in strictly whenever we want to see what court off whenever we want to experiment, event it. We usually use any editor you can be using atom. You can be using python, so basically, whenever you are testing whenever you are practising, you might be using one off then captive shell. But whenever you are writing some serious court that you want to say you might be using any day and the solution off both days is our Jupiter notebook that we'll be discussing in the next lecture. But now let us focus on. I fight on Gettinto by potential. We usually write Fight on gettinto I launcher. We just tried. I fight on. That's done. You are inside or potential. One important thing is you might be seeing an indication off this line number which you don't see with the direct my attention. Now let me import. My Banda's find us is important Now let me created data for him. So for that I would be taking a variable as your phone and I need to call my partners. And inside that I would be using data frame on inside that we need to pass either a list dish very or identify. So I would be passing a basic list. You can understand it does off the offer table in which the first fearless for date, the second feelings for visitor on the third feel, is for bomb straight. And remember, I'm going to pass this with help off our list. So I'm going to pass a list inside that I would be passing these items. So the first I need to pass as days. So let me talk about maybe five days then I need to bus number off. Visitor. I would be calling it as 5000 and then my bounce rate. So that is 20. Now, if I need to pass one more row, I have to repeat the same step. Maybe this time I'm taking data for 10 days and the number of visitors are 9800. And then the bombs. So once your data is entered, all you have to do is presenter. Now we have a store. Our data inside our data from one that is a variable d of one. Let me check that out. Now you can see in the output. I'm getting a Matics. You can see a rule or column field. So this is my column. And this is my room. So my column zero has number off days and my column. One has number off visitors, and then my column do That is my Bond Street. And these are my indexes. That is my rules. So here you can see these are just exactly in the line. 5 5025 5020 and then 10 9823 till 9823. So these are some type of sequins. Don't worry. We are going to deal with a lot more data. This was a basic sample. Now I can also in in these. So instead, off 01 into I can actually rename them as number of days. Visitors and bounced. Read. Let me try that. So, after your first argument, that is your complete list. Use a comma and then you have to pass a perimeter as column. Then again, a list and then the three item name. Let me are these three item I would call it as days. And the second item is visitors. And the third item is bound turd. I would call it as beer and the short form this looks finally innuendo. And let me bring my did offer him here. You can see now I have changed the heading. Mean, that is instead of 01 toe. I now have these visitors on Bond Street. I can also change the name off indexes. That is our rules. So instead, Off column You have to use our index name to start a new perimeter and past argument. Remember? Usually when we deal with data there are less number of callers, but there are more number of flows like currently we have only two rows. But what if I am taking data off 100 of different website? Or maybe I'm taking data off 3 65 days so each they will have a different role on, then the column would be seen. That is my day. That is my visitor in bomb tree. But the row will be 3 65 So it is really hard to give in next to each row. That is why we by default, eg 0123 But it is easy today column them because they are easily accountable and can be named. Let me enter with my index and let me bring this one. You can see now we have f Penis instead off my zero and one. And now we have different column name. Remember data for a mass table. If I take an example off my excel file, that is exact example off my data frame in stuff playing with my Excel file. Now I'm taking all the data from my Excel file inside my bite on that is my I buy it on and then play with. The main reason is because you can be dealing with tons of data. It is just to wait upon at this point of time. But when we deal with data, that can be off 3 65 days or maybe some 1000 David up. Or maybe I'm taking data off different listing off ICO, most website or maybe a real state website at that point or time, you cannot deal with Excellency. We'll be dealing with. Find us also. You might be taking Data's from a P A's so we can directly deal with data off a P A's in the form of Jason. With the help of find us, we'll be doing everything in Jupiter nor book at this point of time. This is just to make you comfortable with data frame. Let me take one more data for him in the former stationary and pastor seemed, did are and the simpler manner it may scrawl it up on. Take a date of him as DF two get inside. My pond does then need a frame on here inside that I need to borrow the data either my less traditionally let me take my Additionally on with that destiny. I knew to passkey and Malou pair so each key would act as column on all the values off that key would act after value of the column. Admitted the example. So the first thing I need to take us days and here with the value and passing a list on I would be passing us 5 10 because that's the value I'm taking for these now. The second I don't the time passing in the national is my visitors. That is my second key. And then I need to pass a list in which I would be giving our 5000 and 9800 the third I knew toe passes br and then provide a list. Ask 20 and 23. Thanks. Looks fine to me. Let me presenter, friend, The state of frame You can see I got my exactly sir, This is because I'm bossing directly My Additionally with the help off key and value pair this one is the easiest one because you have to pass all the data in the one short in this one Whenever you need to add a neuro all your Lewis part a rule strictly That means you just add a coma and passed on your list. And this one, if you need to add more did are you have to add a value inside this, then this, then this. Then you're going to get that. Just get family with that. At the end of the day, we have to play with files. I hope by now you are comfortable with data frames and you understand this metrics, column and row. Let us do a small thing. Let me use type or my data frame. Hey, you can say about the results. Nasty, tougher am, which is OK now, remember, at the starting, I said that all the operation we need to perform would be done over our data frames. Suppose we need project maximum number of visitors. So you have to do is use your data frame and then passed ahead of value. And then you Max method Here, you can see I got 9800 at currently we have only does but suppose if it was a date off one year, so we might need to search from 3 65 days. Let me check out a mean off these so that I got as 7000 food. Indeed. Let me check out different type of methods and function that are very well. So all you have to Lewis used the I r. And then pass that data frame. Hey, you can see these are different type off function. The words that are available who are suffering. I hope by now you understand about data frames. In the next lecture, we'll be talking about Jupiter notebook, which is something really important. I hope this lecture was helpful. See you in the next one. 3. Working with Jupyter Notebooks: Now let's talk about Jupiter Nobuo. So I've already talked about editor as well as interactive shell. So Jupiter notebook is actually ah, hybrid tool in which we can do both things simultaneously. That means we can check out court. Also, we can save that core inside. If I so remember, we have to install that locally. And then we can use that on our local news. So this is a simple tool which works on browser on this really handy to build a down brother in studio for common luncheon. So let us in strollers or pretend notebook. So install Jupiter notebook with help off Cape installed and in Jupiter one status install , make sure you go in tighter designed fuller. I would be working inside pipeline us because we can see files off super turned notebook. So I would be recommending you toe create a new folder on Walk Inside that so I would be walking inside my pipe on us and to open the Jupiter notebook. All you have to do is call a command Jupiter and then no book. Hey, you can see it would be working on your default browser accurately. My local host is working on my default browser that has Internet exploder or edge. Hey, you can see all my activities you can also see in my CMB That is my command problem. So the reason for specific folder is you can also see the different files that are available inside my folder. And if I want to create a new file that is my Jupiter notebook file, all I produce click on New and My Pie Tone Wars in. Just click on that, and here you will get your interactive shell that you can see. So this is our interactive shell on inside this interactive shell. If I want to print something, maybe a print 123 hair single enter means new line in that shell on control, placenta means to execute that articulation. So this was my shell first. These were the three lines, and when I used single enter, I was creating a new line inside their chill when I pressed control Bliss Ender. Then I executed that line. Now, to create a new show, you have to use old place sender, and I can execute more coats inside. This particle line may be praying for, or maybe import my bundles here. Remember to create a new line it center to execute that its control presenter are you can just radically create a new shell. It would be executed. Hey, you can see how it's working. So this is the basic example of trepidation. We'll be walking with that in the next lecture. Let me save this file. But before saving, let me open my pipe on this folder Here you can see I have a file called I g Y N B. That is my eye. Pytorch notebook on it is currently untitled. So let me save this one with that title here. You can see I got my script. One s name on it is automatically see on whenever I want to end it. The script. I can do that with my interactive ships as well as my editor. So in the next lecture, let us use our fight on use different type of files and and try to play with our data. So see you in the next one 4. Important Jupyter Notebook Commands: welcome back in this lake, Taylor stopped more about two potential bow. So in the previous literary performed some basic stuff in this. Let Taylor just know more about its keyword and also how to open a fight inside a Jupiter notebook. So let me open my job. 10 or book hair. It is up. Anything here you can see I have few fights. That is some off my jizz on some off my CSP on other the extra funds. Also here is my previous I fight on notebook which your everything in the previous lecture these were the command that was or to see. Let me delete this one. All you have to do is select the cell and then press duty. Now it's a fresh stupid and notebook. Also, if you want to rename them, just click here on give your resigning and the most important thing this Jupiter nor book are or Tosi. So if you're doing any changes, they would be saved automatically at a certain period of time. And if you want to launch a new notebook, all you have to do is click on new and then select the language. If you are also running PHP or maybe some other languages. You will get their option also. And at this point of time, I'm running this script. One I fight on notebook. Let me get back here. And one most important thing is different type of peace talks. So if I click on help here, you can see keyboard shortcuts on If you play care, you will see different type of short cards that you can also customize according to you. But these are some really important. So if you're someone who's going into data analysis, feel for your future Jupiter notebook is one of the best choice. Also, these are few really important things that you need to remember. So I hope you will give a look to it. Now let us do some basic thing. Let me import my pond us. And also let me try to take CSP and read the fine. So what I want to do is just important. One does. Once ponders is important. You have to create a data for him Now, here, remember, I'm trying to reel a CSP so I would be using a method coil read underscore CSP. In the previous videos, we were directly using our missionary or a list in this lecture we're trying to read RCSC file that is stored in the same fuller, which is our five pandas Fuller. So how to take care of that? So if I'm reading any particular file I have to take care about their read CSP is the mattered for text file RCSC file. Now here. I need to give the location off my file. Since the vote are in the same polar, all I have to give us find him. Otherwise, I have to define see Dr or D Drive or the required Fuller. So have the boat on the same folder. I just need to pass my fine name Press all plus enter to execute this line here. Now you can see I'm able to get my result. So I'm just basically reading CSE. Fine. At this point of time, we'll be reading all the different type of four months in the next lecture. At this point of time, you have to see this is a table a form on. Let me open my CFC file. So this is the mean file. Andi, we are reading it and I Jupiter notebook. I hope. Now you are able to understand that. Let me open my excel file. So let me create a new shell that is all. Please enter. Create my data frame to use my ponders and then read Excel. And then I knew toe pass my final name. Let me execute this one with the help off control and enter and you can see I got an ener. Now you need to think that why we are going to get this Ever let me read this one? So here we haven't air corn more new name XLR, Dean or form. So basically recently bond us what updated on? We need to install this particular dependency to run our excel file. Also not a big issue. All you have to do is use pip install and then give the dependency name. So let me do that. Also, before doing that, let me talk about my ex isi, because now we're going to walk on it. What I've done is after getting a report off my website are 10 days report in which I'm taking six field. That is my date. The number of visitors bombs rate most popular country number off ad clicks and then they So this is the date That is the first number off visitors that were 1500 bounce rate was 20 . Most popular country was U S. A number off our picks were 20 and then Iwas boosting seeing follows with all the data. So this is a basic data which I have taken on the same date allies in different format. So you can talk about Jason. You can talk about txt fire. You can talk about CS, verify the same data is stored in different formats, I hope. No, you understand these data and basically destroys in next number that is by default on this is my header. I hope they love your fine. Let me install this dependency and run my excel file. You can also check the background and you can see we have a connection error at this point of time because you have disturbed on Jupiter notebook. It stunned. Let me down, my doctor nor book again on this works Fine. Let me close the old abs and open my script One. Now let me execute this one Holier place controlled the center remember? You might get an error because off the pandas. So all you have to raise either you need to execute import behind as again if you are getting in. And okay, let me execute this one on, then. Yeah, that's works fine for me. I want to ableto read my excess fi. So that's all for this lecture in the next. Let Taylor display with all the different type of formats on you will also learn more things regarding Jason or reading from direct ap A. We'll be doing that in the next lecture for this lecture. My main more divorce to make you understand how to read a file on to make you more comfortable with Jupiter on oboe. So if you want to know more about different type off key words, all you have to do is just moved to help and news, cable, short cards. That would be great health for you to understand Jupiter, Nor go. So that's all for this lecture. See you in the next one 5. Working with CSV, Excel, TXT and JSON Files: Welcome back now in reflection or the stalk about CSU file Jason file XLs file Txt fine. And also warders comma, separated file or maybe semi colon separated file. So there are different neighbor files that we need to blame on. Remember, I'm just taking 10 days off data. Usually if someone tried toe ordered, they might take a 3 65 days off data. Or maybe you are trying to work on a country population file. That can be a big data. So think from a perspective off website donor, because I usually got a lot of question that we can perform everything on excel. Still why we're using partners. Think from the perspective off website donor. So when we do some clicks on a website and they automatically calculate all the different type of 10 whole new thing that happened because maybe upon does the script on, maybe some different time off script is already running in the background, so that is done automatically. There is no real human that is doing calculation on Excel sheet. They have done everything automatic in their Web framework. Or maybe they have created an A p A. Send a request to pardon us, do some calculation and take response. So that's the main reason that we're learning this. So once you are comfortable, you know what we're going to do. You try and test it on Jupiter nor book, save that core and create script 0.1 and then you can upload it on. So were so that can be done. Now hope that give you enough motivation on let us get back to our top down or book and create a new cell on Just opened my Jason file. Let me create data frame £3 us and then re Jason Matter and in the file name. Same follows with my Jason fire where you can see I'm getting a different result from what I was expecting from my CS three and Excel file. Hey, we're going to the sequence off column is not there. Since we have a define and label column, there is not a big issue. But why? This is happening because Jason is just like, additionally and if you remember, additionally, don't have sequence or indexes, so they are known with the key. So this is their key and this is their value. Let me open a Jason file. So this is our Jason fire looks. You can see this is traditionally in which these are keys and these are value on this is another additionally and they are stored in our type off list. So there is open list on then all the elements are dictionary Here you will see 10 different dictionaries with all the leader and as you know, there is no sequence for additionally so we're getting the result a same. The other thing that I want to talk about this How do my final lost that is how does my Jupiter notebook result? Note that this was the header because I have just given the result. I've given just 11 fields. How do they know that this was my header and these are all my fields. So we have a batter meter here we just call header on which is by default. True, that means they will consider first line as header And if I try to make header as none they were definitely include that in the value pair Let me execute this one You can see a result now. So what actually happened is I just did header as none. Now they're concerned them as the other value. So now we have 10 different values, which was different. But I have fire. Try to remove this header, which is by before. That's true on. I need to execute both the files. You can see we are back with the reserve on. You can play with Jupiter upside down. So whenever you want to edit any line, you just need to jump on that line. I hope now you understand about Header feel auto Excellency, A suit filed follows the same rule. But Jason file, we have key and the loop here so they can radically different shit Legman dilute this still and let me work more with my Excel file for all you have to do its duty. Now I have a thought. What if I try to remove this index and try to use data as index? Since I know this is not useful for me, the 01 toe all I need us date and then the result. So we can do that. We can change the state into our index that is into our row. Feel so to perform that we just need to do a simple task. Create a data frame and then use a matter as certain index and then passed the value here. My value will be dead since I want my date to be treated as index. Now, check out downtown. Hey, you can see now you can compare both the result. Now we have date as our index and we're only dealing with five major columns. Sixties are dead, but it does. Treated as next, we don't have the 0123 We have our index as one poetry. You can also pass different type of values. So if I try to make day as index, it won't find. Now my data is included in our column on this day is working as index, so you can treat them accordingly. Now, the next thing I want to talk about this, you can also check their shape. So if you remember while doing Matt, we used to do Mataric shape. You can also do shape off our table. So let me do that. You can see it's currently 10 by six. That means 10 news and six collar. But if I try to bring my DF two, this is printing the default table because we're not saving this. We're just printing that. So if I want to save this result all after Lewis either save in a new variable that is my new data frame or just overwrite my previous variable. Now I've heard Try to print. They have to You can see this is the permanent change. Earlier, I was not doing the Roman and change. I was just trying to change these thing, test them out, bring them. But I was not storing them in my variable. I hope they allow things are looking fine despite be confusing. But with practice you can easily excel him also, I'm attaching all these files in the resource section so you can play with them. Let me create a new cell on gunplay with my txt files. Remember, whenever we are going to read any txt file, we need to use CSP on dsi SVs comma separated values before reading both the text file. Look at them here. I'm taking comma separated file. You can see all the values are separate day with the help of coma. And the second txt file that I'm taking is separated with the help off semicolon So there is a pyramid a called separate on by default dis coma. So if I try to run this file, this would run perfectly. So let me use why traffic dot commas You can see I was able to get my results for my data frame. Four, because here we have a perimeter called sip and have a value by default. Tescoma. So they just separated all the commas and give us the result. But if I tried to run the semi hold on file, you'll get an N er let me do that. You can see what I'm getting. I'm getting an index and then wonder This is the complete room on all the results in a complete room. So there are 10 different rules and one column So they're recognizing this as a complete column. So I need to add a perimeter concept and then pass on my semicolon. Now, if I tried to execute this one, you can see I was able to get the result. So that's how we play with different perimeters. The next thing is to read our file directly from online source in the next. Let Tallulah statically use our online Ling's on perform the scene 6. Working with API Response: we'll come back. So in the previous lecture, we used our safe files. That is files that are already saved in our system. Like Jason CSE text and excel in this Lake Erie abusing Barrick ap A's or response off a PS or direct links. For example, I will be using this ap Ages on Ling to radically fetch our data. Or maybe this link or maybe this one or direct downloadable file You can see if I click enter for this particular link, you will see our download option. That means if I visit this link, I will have my traffic dot CS three fight available for download So we'll be using these type off linked to fetch data. So let me create a new data for him. Let me copy this one. Create a data from six. Now instead, off using that fine name. I just need to pass my link in the courts. So here I have my traffic dot CS feeling. All actors just passed that link here on. Let me execute this one. You can see now I'm able to fit all the data that waas available in this particle. If I didn't, we try that for Jason. Let me create a new data frame on replace. Yes, Really? With Jason on, replace the link. Execute this. Fine annuals, get the exact result that you are getting with Jason file. And if you want to try out, you should try these underlings. Also, you will get basic knowledge off to use online files and how to use response off a B A in our pandas. Let me execute this one. Yeah, I'm getting the same result. So that's how it works. And it is quite easy for you to understand with Jupiter nor boat. So we have tried our AP, and we have also tried rcsc file one important thing that I want to tell you about this. Whenever you close your Jupiter notebook on re open it, you have tow execute few lines like you have to execute partners every time. Because remember, it is a combination off editor as well as interactive shell. So whenever you use interactive shell, you have to write some stuff at initial level. You cannot start writing core with Jupiter notebook. We haven't had one taste that are cool deceived, but it actually worked like interactive shell. So Whenever you try to run the command without importing pandas, it will give you an ener. So you have to execute this line and then you can execute any line it will work. Fine. I hope that you understand how to use your direct link. Internal files on this would be really helpful for you in future. So in the next leg teller to stop more about manipulation. I hope this lecture was helpful. See you in the next one. 7. Indexing and Slicing Dataframe Tables [Part 1]: Now let's get back to work from this lecture will be talking about manipulation, how to delete a column or maybe adding new column, maybe adding new rose, modifying some values or maybe about indexing and slicing. So we're doing all the stuff from this lecture. So the first thing that I want to talk about this I remember this one is the column or the header on this one is the road or we call us in next. So if I talk about forced index off visitor, that is 700 on. If I talk about first and second index off visitor, that is 709 100. If I talk about first column and then our first row, then it means seven. Read. If I talk about first column and forced in second row, that means 709 100 so these are actually labels. So whenever we try to slice something or whenever we try to index something, we use label based indexing. So that means I would be using their names, particular names, I can say, like data off visitor, bomb street and country. What I can use position like 0123 so something like that I need to follow. So there are two approaches for slicing and indexing. The 1st 1 is level based on the 2nd 1 is position based. So let us get started. So the logistical for staff, What I have to do is I have to take a slice. What? I have to take us in Nick's from second. So fifth. Andi, I need only country and clicks. So who are that? I would be using my data frame and then I need to use lock. That is loc. And then with a square record, I need to pass two parameters. So I need to pass the label names. That is, if I'm taking Index. I need to pass their label names on. If I'm taking columns, I need to pass their label names. So suppose I need our intersection from two to fifth and country two clicks. So I would be passing the first well, us to do fifth and then coma. And then you need in the section from country to clicks. Let me take this example and execute this one. You see, I want my dessert. So here I'm taking tables. Remember, whenever you are going to use a Lucy that is locked. So you're going to take intersection with labels. So hair the difference will be if I'm taking the index. When you as you remember, what list This fifth will not be included. In this case. We're depending on labels. So it's working as a label and not the next value. At 0123 it is actually label on. It is considering as a level name, same follows with this particular header. So one point I need to talk. About what? If I need a country click send days. So all you have to do is take from countries through these, So it would take country clicks and these at me execute this one. So here you will get the result from country clicks and these sorts basically an intersection. And what we're doing is we're taking this particle apart. You have to be careful with slicing. And one thing you need to remember is this is not saving and a f one memory. So if I use my DF one and print that you would see it still having this result, that means this law is not an in place operation. So you have to create a new variable and store them. Let me create a Do you have to store these value inside that we're able Let me open a new shell and then print out finding of to Hey, you can see I got my results successfully. I hope this was clear. Let me execute few more result on delete the shell. What if I need a value from a single cell? Maybe I warned clicks on I just warned for this particles start label. So what I have to do is just pass that, will you? So maybe I just want this tree on. I just want clicks. You can see I got the value off. Well, that is clicks and then from third. So this looks when I'm able to get the value of single cell. Now what if I need all the rows for clicks? That means I need all the rules. Only four clicks, four rows. We can get all the elements and then coma and just add click. So this will return you the result off clicks. Now, this was basically important for law in which we totally depend on labels. I really agree with that because you might be using different names in sort of 0123 You might be using some particular index acquitted in earlier videos used to set up index, and then we can use that. 8. Indexing and Slicing Dataframe Tables [Part 2]: the 2nd 1 I want to talk about this I law which totally depend on the index values. That is the number rings. Now here, I need to pass to wear lose again. But remember this time in numbers to suppose I need to slice will lose from six to it on I want from visitor two days So 6 to 8 means I need critic six At my starting on, I want to include the eighth. So I would be taking nine. That means 6 to 9 were nine will not be included. Remember the list system also were using I lock if we're using lock That is a Lucy. I would be using six to it because I depend on labels. Where is I? Love depend on the in exposition. The second thing is I'm taking visitors today. So visitor means its value is one and the naval lose five. If I execute this one, you can see I'm able to grab that desert so I cannot pass visitors as a label And I cannot pass day as a label. And if I tried to warn him that I would definitely get an error. Let me try that one Hagen CIA garden error. And if I scroll down, you can see cannot go slice indexing on with these indexers. So this is a type error and I cannot utilize that. You can also do a lot more stuff with guy law. So if you want a particular row, maybe I just want to number five. I can simply enter that on. If I execute this one, you can see I got all the values off. Rule number five that is my visitor. My bomb Strip my country. Then click on. If I want just one value, I just need to pass that particular position. Maybe I want from visitor Toby are only so remember this last value would not be included. So visitor Toby are means one and two and three will not be included. And let me do that one again from my visitor today on that swine for this looks fine. The next thing I want to talk about this I x we have talked about a block Then I look and then i x so I x basically take both take indexes as a less label, so it just quite convenient. But remember, I x will be removed somehow End up coming updates Maybe in the middle of 2019. Or maybe a diner off 2019 Eso you have to be careful with block and my lonely And if I try to run this example with I X, it will work Fine. But remember, I x will be removing a coming fight on update Let me use my ex. So after using i X, I got my result. I also water depreciation warning So I need to check ponders documentation. So that's when I will be using I lock and law on the border sufficient to extract any portion off our data frames. I hope this election was helpful. The motive What This lecture wants to make you understand how to slice thing, how to slice a particle, a portion on how to take particular values. So see you in the next one we will be talking about how to delete columns and rows 9. Deleting Columns and Rows: now it is quickly talk about deleting columns and rows. So in this particular example, we have several columns. So what if I need to drop my day? Khanum? So for that, all we have to do is use our data frame. Then we have a method called drop on that would take two para meters. The 1st 1 will be label off Lou on column. And the 2nd 1 will be zero or 10 is for Rose and one will before corner to suppose I need to drop day corner. So hair I'm taking day. That is my label. And how they'll find us that this is a condom. I need to pass one. Let me execute this one. You can see in my new result. I have a day corner missing. Same follows with my room. Let me remove Luna. Married. Remember, this is our label hair brutal partners that this is a row. I need to pass zero. And if I execute this one, you can see I have a missing dona married. But remember, all these drop methods are not in place. So if I print data frame, you would get the original one to make them in place. You have to store them in a portable are very well. Either you can store them in the same variable that is TF one are You can create new variables like the F toward a of three and store inside them. So for now, I'm taking this. Just one example. In both these cases, we were passing neighborly. But what if I need to pass the position that is my in exposition. So what if instead of passing visitors are instead of passing day, I just need to pass my position. That is my fifth position. You can do that. So all we have to do is it's all there. Trudeau's creator data frame and then use the drop mattered on the two perimeter that were passing. So instead, off label, I can pass the particle a position with the help off my indexing. And the second thing I need to pass is the collar on. If I try to execute this one so you can see I actually drop my D corner. And if you directly execute the value of this corner, you will get the data as resumed. So I'm taking a disposition and see him, I can do with my index. If I execute this one, you can see it could return me as my fifth label on hair It er done my day as label. So here I'm actually passing label only, but with the help of position. So if I take in next year, and if I want to brought my second position that is my second label all after the US used my position. And also, I need to change this value. Do zero. And if I execute this one, you can see I have deleted that. Remember, this is in place. So if you're doing it for permanent drizzled trying to store that in a memory either a new variable all whether the F one itself now this was quick and easy way to actually drop our columns and lose. So in the next lecture to stalk about how we can update, we'll use for a certain column position and also talk about how to add new columns and lose . So that's all for this lecture. See you in the next one 10. Adding and Updating new Columns and Rows: now in this little Children to stalk about how to update and add new columns and euros before doing anything like that. Remember how we are new element inside that list? Or remember how we are new element inside? Additionally, also, remember how weird new element in our data for him with the help of Traditionally. So what we used to do is we take the heading and then passed on a moral values that is a key and a loop here. Same. We have to follow toe other new corner. So the first thing that we need to do is just take our data frame and then use of square brackets and then give the column name. So here my column name will be status. Now with this column, I need to provide 10 values. So suppose you have a new column here, and then you will have 10 values for this particular column. But what if I only tried to pass to lose and then execute this program? You can see a garden center and hear the error is value later. That has lent off. Values does not match lent off index, so I have to provide 10 values to match my column and index ip So let me past and values there. Hey, you can see I have another 10 mill use. Let me execute this one one status executed. Let me bring mind if one here you can see I have added a new column. You can see I have actually passed a single value for 10 times and stuff that I could have used a single element and then multiplied by 10 times. That would be quite easier. Hey, you can see I righted a new column Also we could have used shape and her. So if I try to print by the F or not shape it eternal double would do. We lose. The 1st 1 is lent off our index and the 2nd 1 is let off our column so I can use my shape. And here I can take result for my position. Zero. So that would be then. Ah, Now I can actually use this one and pass here on execute this one. You can see it's still give me the same result. So that would work absolutely fine. If you can use our shape method and then utilise the force value off double that is size off index. I can also play with these, were lose and add an element with them. So if I want to update, I would be doing something similar that I move it list. And if I want to update my day, let me take my data frame. So with my day, I just want to add some name or variable after my do you stay after my Venice day? Let me try to implement that. So remember, I'm updating and I'm taking my previous value and then adding a new string. Along with that, you can see the result now. I have my day and then a string added to that. So that's how I can actually update my previous value. And I can also add new. We live with them. You can actually remove the day on you condo's 13 more things, and if you want to do specifically for a particular value, that means select with the in exposition off column and rows, and then passed a new value that you won't do a big that would work fine. Now, here we have talked about adding new columns on updating old column the second thing. I want to talk about adding new rules. So there is no defined method off how to add a neuro. The simplest way we can do is we can use travel. Smith heard. So take a simple example, traversing our particular example right now. So that means this will be turned into rules on this would be done in two columns. And then we'll be adding new column toe that so we will be adding column number 10 and then traversing back. That means our column would become rules and rules will become column. That means feel begetting our oldest back with a new row. So what we have done is we have took our data frame. We cannot add a new crew. So what? We did this. We travel start. I need a new column and travels to back. So our new column added, would be working as New Row. I think that might sound confusing, but let us toe that before doing that. Before doing that, let me clean this up and start with my traffic dot CSP. So this is our data frame. I want to add a new car last 10. So the first thing I need to do is I need to travel saccharine data dream So everything I would be doing is inside my DF two. That is my data frames again. And I would be storing my travel straight up from one. So this will be the result. I have 10 columns at this point of time. On these will be our rules. That is dead visitor. Be our country clicks Andy. Once again. Simplest step. Just add a new column on Remember her? I need to pass six values. The first value will be date. So that would be 11. The second really will be my visitor. The third World We will be my br The 4 20 will be my country 50 leaving my clicks and then we'll be my day One status done. Just execute this one. It may bring by new result. You can see I have added a new column. No, all afterwards. Just travelers this back and store that into my data from one. So all I have to do is just all right. My data from one and store the travels wizard off my data frame toe. And if I execute this one you can see that stone. So you can see this is the simplest and the easiest way to add a neuro. And also, you can try the Smith third toe update few values off a row. So you have to travelers do all the changes towers back. So that's the simplest way. So that's all for this lecture. I hope you understand about partners as well as stupid. And your book. Thank you for watching See you in the next one. 11. Thank You For Being Here!: Hey, guys, Welcome back. Glad you released this lecture. You reserve a pizza or maybe a short break. You just unlock a new set off skill by completing the schools. Thank you for choosing and believing me. If you like this course, don't forget to leave a review. Your review. Keep me motivated to work hard. A big lake just as relus add more lectures on a regular basis. Thank you for falling. See you in the next one.