Practical Machine Learning DeepLearning ,NLP with Python dhamodhar 03rd class April20 03rd
This, conference, will now be recorded. Okay. One. Second. It's. Still low. Okay. Whatever others everyone, can be able to hear me, or. Is it low. It's. Quite fine for, it's. Okay pop you, alright. You, countered, from, phone right. Yes. That's right okay. Is, it like I can, see two connections, one is from you another one caller zero and I don't see the name is it. Harry. Carter from two phones or the one from system another one from home. Yeah. I mean I'm looking at the screen right now on the flap. I'm, connected, from my phone. Another. We're supposed to join so I thought it is him okay. Okay. Is it still low. Edited. By now, alright. Yesterday. We discuss about the. Indexing, write, Python. NS. Starts from 0, to, n. Minus 1, let's. Take. Another example. I. Stick. The same example the one that we have taken a sturdy machine. Learning, right. Maybe. More. Species. As. I. Said before like Python and Isis starts, with, 0 right 0. 1. 2. 3. Sorry. Drink. Oh. I. Think. It's better to use, EXO. Machine-learning. Right eh. Let's. Start from here em. Let's. Take just Machine. Index. Starts with zero right, 1. 0 1 2 3 4. 5. & 6. Right. It's. Not just the postulates, even we have negative indexing, it starts with minus 1 from. Here -. 1 -, 2 - 3, -, 4, -, 5. -. 6, and. Minus. 7. Just. Like the way we have used like know, for, example X, be, equal to. Mission. XO. XO. Let's take, two. Is. Going to be seen right the. Same way we have negative indexing, to indicate now forget it see what. We have to do is. What. We here - five just. Mention X. X. -. Fire we're. Going to get the same result so it's. Not just the index. A positive. Indexes we hand need to indexing - but, it starts from the end with. -1 and the ends here, what. Is the length of this LDN. X, is what 7, so it's going to be like. -, 1 2. - y. M whereas, positive indexing, starts with 0 to. N. Minus 1, any. Questions, on this. No. Nothing clock would. Petrea, I think you, already. Know this. And this. One we have mystery test reading another. Thing is like if you want to you know, print. It in the reverse order we, have X M, ACH, ine right cuando in no printed. Like e n, I, H. See, a M. That is in reverse order what. You have to do is X. And. :. :, -, well I. Haven't. Discuss about this :, right. So exit, you. Have to mention the start index and. The. End index but. The. Problem with this method is and it's in this, is a purple and this is inner power the, upper bound is exclusive. Let. Me show you with an example let's. Take X, and you. Want to start with. Like M no you want to print only M ACH, you, have to start with 0, X. Or like, start index its 0, and then. It, may CH right so you need to end up with here, so, you need to mention 3 but, the problem is 3, is 3. And the upper bound is exclusive, so you have to add 1. That. Is cool. Only, then you will get em a CH otherwise, we, mentioned yet simply like 3, where. It's going to end, you. Will get only this part up to, here. Not. Completely. Right. And. Now. Nothing, is like if, the, inner bound that is the starting index to. Start from the. Start like from, 0 you, need not to mention 0, here you. Can simply omit it you. Can see what the same result. Right. What, I want on the same. Another. Thing is like if you want to let's take you. Want to get only en, e part, okay. Kartik. How. Can we get this only, any part with. This slicing. Start. Index, and. End. Index in, plus, plus, 1 right so how, do we get that only, any back or maybe. Irony. What. Is index of this. You. Can use as. Six. End, index is six and. You, start index is, okay. An index is six okay. Start. Indexing, or. Starting. This is for okay, see. I haven't got the concrete recent life I have just caught I in, as. I told before like, outer BA upper bound outer. Bound is exclusive. So. You need to add one, or, that, will become seventh. Okay. Nothing. Is if, you want to mention, the upper bound or the lock mean, this. One seven, now, you want to get till the end you, need not to mention the, upper bra you can simply omit it you've got the same result right. Yes. Okay. If you want, from scratch that is starting index from zero you can, omit that part if. Want to get till the end the upper bond no. You can compare to omit it let's, take you want to print the complete. Word. M, achi. Any you. Can simply write. You. Can write either like this or, else. We. Are starting from scratch right from zero so you can omit that back and, we. Are going to the end so you can omit that part too now. You can see you got machine. I haven't. Mentioned starting, base or I haven't mentioned their. End index also, right. Yes. Yeah. Any, questions on this or let's. Take another example. Maybe. But. Maybe. I need to minimize this. This. Is much better. We. Are. Young. Now, tell me how, can I get only this part and varn.
Let. Me mention this, X. Equal, to. Machine. Lon. Now. I need, only learn. What. Can I mention you tell. Me the start, and end MINIX. 8. :, that's it, age. :. Ok. Thats. It : it. Right. We, got 8 :, because this is 6 this is, 7 and. Starting. Index is inclusive, so, it. Starts, with 8 and yeah, we're going till the end so in, order to mention the purple right, yes. And. What. Inspired me no. Only. The mission pack. In. Sierra : 7. 0. :. 7. Ok. So space is also 1 character so you need to consider that if, at all you mentioned 8, so. It's going through the space 1 by 6 is also write. The. Next we, do like, : - Nick, :. Like. Minus. 6. Minus. 6. Yeah. My, NATO, innocence be difficult, to perceive it like we, need to start from your - 1 - 2 - 3 - 4 - 5 -. 6. So, minus 6 outer one that's closed also you get the same result. Right. Let. Me show this like. 7. 8, 9, 10. 11, 12. And. This. One is it's one start with minus 1 -. 2 -, 3. -. 4, -. 5 and, the. One is what. -. Six, -. Seven -. Eight. -, nine. -. Ten. -, eleven. -. Twelve. And. -, thirteen, what. He said was like. We. Can start from scratch and. He's. Going to stop here. The. Author won't disclose you, so. It's going to print only this part I. Think. And that that real reward, the point yes. Yes, yeah. This is. Going to start from zero that. Is this one but, it's going to end up to, here the. Outer bounds asking to do so it's going to stop here that. Is why we caught the Machine. The. Only this for we. Can do that one - another. Thing, if. At, all you want to know. Till. The end we. Can omit it we can omit the upper bound there is another way you, can use then. You. Got the same result right. So. Land or dynamically, calculates, the length of the string so what. Is Ln of X it, is 13 so you not to mention that in here. You. Can simply mention learn, the. Advantage, of using the length is, let's. Take I have a traitor now the part right, so. I need not to mean, if at all it is like this, so. It's going to get only the mission learn right. If. You need the complete sentence, I mean complete word. Or phrase. We. Can simply write like this it's called dynamical, calculate every time we change it and we're, going to get the result, okay. Any. Questions on this. Using. Length or, in. The bound or upper bound any. Confusion. Nothing. Is. This okay, let's. Move on to special characters in a string yesterday, I told you that a. String. Can. Be wrap it in double, course or single, course right let's. Take, motion. Darling and. In order to check the time what we have to do is five right what's a string and. We. Can use the single course also. Right. You're going to it is going to be the same I told. You that that, is there, is an exception, no, you, in, this method. Thing. Is like if at all you, want to mention missions, learning, right. If it is single course see, what happened it has been ended here let's. See what is going to but, we've got an ATAR I tuned the decoration, right less animated self. So. If you use the Apple course. No. Enter this. Is lipstick let's not in plain text we've, got the right result. Like. This is one exception that using, double portents in the course otherwise we. Can use either double or single school, to run on the same. Another. Question is how can we skip, the you, know this. Sort of characters. Let's. Take single. Quotes itself. It's. Not always possible to wrap. In. Double, course when, we have single quotes in know inside, that phrase so. In that case what we can do is we can use back syntax backslash. Here. You can see we call the right result right. Let's.
Take You want to print slash. Here let's lick ndar. Or. Else take. Another very book, you. Want to print slash a slash B. What. We want you, haven't got the expected result so you, know to escape this you can use. No. Double slash but. You have to use print know, why. Print. Is a function, of method, that helps means repeating right way. Most. Of the time we you know we can bluntly, no. Mention, the variable and can resolve and print the value but. It's, not always know. You. You may not get the expected result all the time. So. It's better to use print all the time at. Least, when you deliver the code to client. Okay. Any. Questions. No. Nothing. Let's. Take the same example X, and if you want to split into two like now. I need a list, something, like. Mission. And. Learning. As. Two elements, in the list so. In that case what we can do is we, can use split. Meta. See. We got the desert right the, machine, is. One of the elements in. This list and learning, became, another element. The. Problem with this let's take. Comma. Right. In. This case it is going to work it. Hasn't, it's. Because, by, default space. Is the nos, operator. Right. It's, not as long, as you have space here it's. Going to work T, you can see the same result, even. Without I haven't. Mentioned anything is, going to consider no. Space, as a separator, but. If we change it to comma or something, is for going to work so. We in that case you have to explicitly, mention. The, separator, here, I. Have mention comma right so you can see now the. Machine and the learn and the world learning, became, two, different elements in the nest. Right. Any. Questions. No. Nothing now, sometimes, what yeah sometimes, what happened here is like the, words are going to be separated, with comma. And space. Now. You can see the space been added here so. You need to be careful with that okay. I. Have, added comma and space. Let's. Take know, maybe it is not the right example. One. Two. Three. Four. Or. Five. Now. You can see what the end result if you. We. Simply mentioned, like comma. It. Has a space. To every. World. Except. The first one so.
You Need to be careful with, this operator. Whatever. We have reused. Can we use any trim function. Sin. Function. Yes. We can. So. What you mean to say is okay, trim we start okay. I'm. Going to see like comma. And. Then, strip. Right. Shape. Should work object, has no air okay. Maybe. Like. This and. Then. You need to write a for, loop. Maybe. Then. You. Can use this comprehension. We haven't got to that point, that. My. List I append. I. My. List. Yeah. We can do that but. It's. Better to use comma. Space. Right. Inside. Okay you, point is valid when we don't, have space in certain, case and we have space in another it. Says hi. Right. Exactly, yeah. Now you can then in in that case you can use this unless compression. Is much better we will, I will speak up with that later you, can. Write in one no. Just. One line. So. What is the append function does, the append function does prints, how. Happen just append, it to be. My. Little array yeah. To the list to the my lips okay. So. Whether you. Know. I haven't used I'm sorry oh, yeah. I forgot that thank. You and strip. Yeah we here we can use strip now, we call try it deserted. And. Yeah. Karthik. And Dattatreya have. You got the point. All. The time it's fine, this, method will work but. What if we have comma space in certain, cases and just. Comma in other cases. Right. So. In that case we need to write some. So, may not use like function. Within a function like can we not use like, split. Within our script function. Yes. Yes. We can but thing is this, has, not, accepted like. No, if we use strip I like, this this. Is through, going to throw a list right so. When we when. It when this part through. And. Stupid, no is going, to operate for the whole list not. To every, element of it so in that case we need to loop it. Okay. I mean, usually like in for example if I take like accelerate. For example so you can have a function, within, a function meaning like, you'll. Write like strip, and. Then within strip, you will have split, within those brackets you can have like split, right. So it'll be like X dot, trip. With. Bracket. Open, and then. Split. And then. You, know you write the statement, and then you close. Yeah. And in, that case we have to use lambda functions, don't. Speak about the. Same example, and. Okay. Okay got it okay. So, a very. Basic question I don't know if you addressed this before. Whether, a Python, is like more object-oriented. Or whether it's functional. Or is it both like and if, it is both like how do we determine like which functions, are like. Which. Ones are the functions, versus, which ones are object. Which. One of functions, we tuned objects, that initially. Python. Was not an object-oriented, language and. Therefore, it's been added. Okay. We. Don't use much of no. Oops concepts, in this and your question is like whether it's going to be, no.
Making, Procedure, is going to be a bit different from the, Oaks, right I mean in, whoops you just going to be more like Jason, Dahl so. My. Question is like my. Question is basically you. Know split, and the strip are, they, like methods, or are those like functions, this. Is how them you know like you, know this is method whenever we, use something like object. Dot. And. Some function, or some, method right. Right. Yes. This, is going to be a mentor you have to call this as matter. It's. Not just Python in any language you take so, if it is already taught something, is going to be matter, if. You simply. Mention like something. Functional. This. Is going to be function. Okay. In what. We do, we you know can we. Like. For example I have a list right. You, know how do I know that whatever operations. I mean, I'm going to make on that list then. I should use, an. Object to, make like, any modifications. Or whether I should use function. To make that modification, how. Would I know, how do I make that decision so. It. Is by practice, you will get it let's take my list and you want to know what are the obvious that it has you. Need to use. Dot and then tap. Because. They can I do a list of methods. Okay. Got it okay. Thing. Is like if you keep on practicing it's, not going to be B do you know difficult whether, it is going to be a function method. Or. Something. If it is a function, you have to write something like this my list right. If. R is um right right. Like, this it's always going to be some. Confusion even. Those, who have like three to four is experience, will get this question but, no, when you keep on practicing will get it and, out. To a. Language, like Python. Initially. It was not OOP. Space and let. Fall oops been added, so. Definitely. There is going to be some confusion. Okay. Yeah. And. A. Karthik. And a tabria any questions. Hello. No. Yeah. And I have indispensable, strip and I know completely, right let's take an example, say. Machine learning I. Have. Some, twelve bits right at the start and at the end if. You print, ads now sorry. That's now so, it's going to come up with the trial spaces, right they'll start and a then if you want to trim out the spaces, or, she have trains X dot strip. You. Can see that the. Trial space been completely, turned not. In between for example. When. We have space like this, strip, is not going to be helpful okay. It's, only at the start at the end. Let's. Take another example some. After. Stream after, stripping, it can still see some space right. So. It's not going to trim out in between the. Words so. Only in is going to look at only the start and the end part. Okay. And. The. Next one is Quan catenation, does take X. Mission. And. Why. Astray. We discussed about this right I think that. Adria. Asked this question how to and concatenate. Tour. Yes. Sir, extra space and why is this so in order to concatenate we have to use concretely, two operator which, is nothing but plus I. So. We know it has not added any space in space space is a character, so you can, write. Explicitly. Now. You can see a better way to see that. Output. Right. So. Plan is a quantity, to operator, in. Python so, we. Can add strings also so, in other language this you may get a mirror that, you. Know, is. Not the right operator. Or write operation, to. Eat all strings but. In Python is going to concatenate on. Getting with nothing but adding. Another. Thing I discussed yesterday is, yesterday, was. Like strings. Are immutable. All. Right let me discuss, about mutability, before before, we get into immutable, we.
Have Lists here right 1 2 3 4 5. So. Let's take if, you want to get only. The. Set three but, that is the. Third element what, we have to do what. Is index we have to use. Two. -. Right, so, let's take I want to know. If I ask in another board. Let's take some, chunks. Let's. See the result. So. That the, word three been, replaced, with junk. So. The ability to replace. A value, is nothing but mutable. Chip. Nothing. But the, ability to ability, to. Change or replace. Replace. The value. Sorry. Yeah. And let's. Take another example and, the same a machine learning. So. In order to get let's, take. Int. What we have to do, X. Plus. Take only the M the. First letter M, so. We can write it like M X of 0 right. If. You want to replace it, let's take. J. Ok. Some junk what. We got a CEO, of it does not support item assignment, so you can't, replace. A know, a, particular, letter. Using. This know this, method. Like you. Can get you can face the value but. You can't replace it. This, is what we call immutability. Strings, are, immutable. Right. The Karthik any. Questions on the area but. Nah. Nothing I. Think. Arvind knows this like what is meat build under what is immutability. Strings. Are by nature immutable, so you can you, can therefore, know, partly index and press the venue and replace it whereas. Miss are, mutable. Okay. Yeah. Any. Questions, like we have computed, special characters in a string and split. Strip, method some confrontation. And stings, on, strings. In your topology. If. You don't have any questions we'll can jump, to lists I. Hope. You don't have any questions, let's start another. List, so. You know how. To declare a list right so it has to be wrapped it in square. Brackets. What. About dictionary. Yesterday. We discussed about how to declare, a list, dish. Murray says. And tapas, hope, you remember it Cathy. Yes. In. Floor, bracket key value combination, I use key. Value paste right, yeah. Let's. Take an example. Zero. One. Is. Going to be something like this right, and. What.
Apple. Whittle, down, in, brackets, yeah. Appearances. And. What about sets. If. Say again, wagons but we do only with values. Just. Like the way you write. Elements, in list it's, going to be like that yeah, what. Is it what is it going to print. If. I'm. One. Two three four five. Yeah. Because cells are not. Going to entertain. Duplicates. Is going to remove. This. One let's take and let me explain, your shortcut, let's take we, have this one. Two three four five six. Six. Seven, seven, right. So. In order to remove list. I know it's going to entertain I mean I'm, going to entertain duplicates, it has not remove duplicates, right that. Case what we can do is to remove case. If at all you want to and you. Can, mention. Like, that set and. You. Can convert back to list. Let's. See what happens. What. We water it, has, remove duplicates, what, I did here is my. List is a list it. Has some duplicates, six-six, and seven-seven so. Six and seven has duplicates, I wrap. It in set, so, it's going to convert. -, to upset, let, me show you that my. List. So. It has converted to upset you can see that it is being wrapped little. Flower. Packet and you can observe that, duplicates. Six and seven has, been removed and if. You want to convert back mini what you need is removing. Duplicates. In a list right so you need to convert this back to, list. But. What. Am I doing here this going to be very handy method, to. Remove duplicates. In a list. Right. That is the lambda conscience right sure so. What we just did list, and set, the. Lambda function you were talking about, no. This is not a lambda function lambda, function, is a kind of user-defined function. Where we. Not to have a, functioning. We. Can I mean if at all we need to write only, in one line. We, can use nano functions. This. Is not a lambda function this. Is just I'm wrapping. It in moon and converting, it on set and I'm. Converting back I know. It. Will list using list method or. List function. This. Work on the function, okay. I think. The. Previous question was like how. Can I use a function. Within another function, right. Correct. Exactly yeah we. Can use it like this but it's not going to work in all the cases so, you know. If you want to define, and use it you find one use a different function this. Is better to use a lambda function. Okay. And. The. Next one is okay, length awfulest, so. Yeah. So. It's. A Christian set we have these three. Different functions like this so, do we have the light similar, benefits, for dictionary and, this, tuple also. Yes. We do have. But. There are some, issues with that. So. Topple. It works but, dish needs, we. Haven't provided any key value pair right so. Dicta. May not work. Basically. What. We have to remember is it has to be compatible yesterday, we. Discuss about X 23. And if. You convert this to, integer. It work but. What if we mention something like this. Going. To work yes so it has to be compatible and. There. Are ways to, come. Over it using zip method we'll discuss, that later, oh. Yeah. And we, need to provide it in the form of or no in, the form of like a list of tuples and, then we can convert, it into teach that. Yeah. In equations. And. Right. Now I have common. Elements on the, three four five six seven so in order to get the length of it you have in New Zealand right. Just, like the way we have used it for.
This. One a strength. Of the. Same method, that same function is going to work for at least one this is also even. It's going to work for tuples, do. We have any typos don't. Think. So. Let's, take a, topo. 1. 2. 3 4 5 and then, my. Top, is, going to work for, top. Off even dictionary, do. We have any dictionary. Don't. We. Have to study let's take we. 8:01. Check, the dictionary length of traditional. Ok. We. Have two elements. To set of elements to can set of key value pairs. And. Fetch, band is from you listen you know how to refer, I mean how to fetch. A particular. Value right from. Else you, have to use. Indexing. Let's. Take if. You want to get only the. Number three what. You have to rinse 2. If. You want to fetch from, 3 to 5, what, we have to do, say. Already explained this can. Someone tell me like. How to get that from. 3 to 5. It's. My, least 2. :, 2. :. 2. 3. 4. 5. Right. Because autobahn is there you know exclusive. So you have to add, one like. Perfect. This. Is what we call and this is we. Call this a splicing. So. When I call, it when I see a list, slicing, or something like it's going to be like this. And. What. You want to may know get. It in reverse order, I have. Lists. Like one two three four five six seven so or do, it how do I get it in reverse order. The. Colon, will fetch the values in an order that we have provided. We. Have we have to add another colon. Minus, one minus, one. Is, going to print in reverse order so there are better ways to do that but, for now this. Is also one of the veins to print, it in reverse order. Okay. And. Negative. In next thing I will it's immutable I have already expand this and negative. Indexing, just like the way for Strings list, also. Entertains. Negative indexing, what. We have here is one two three four five six seven and. One. Two three. Four. Five, six. Seven, so, index going to start with zero, one. Two, three four. Five, six, it's not just positive indexes. We. Have negative indexing, also it, will dissing starts with what. -. One right -. Yes. -. One. -. -. Something. Like this - three Sun, so on. So. It's going to end up like -. A, sixth, sorry, -, seven. Right. Let's. See an example so, how can I prevent, poor. Using. Negative indexing. Anyone. So. Only four. But it's basically, in, order to print fall so as, for positive, index concept. You. Need to follow use, now. Fillet. Minus X, minus. Four, yeah. Perfect, this, is minus. 1 minus 2 minus 3. And. Minus 4. Right. Yeah. The. Next, one is. Will sort of French I already. Explained this like using, length so, in some cases mistake. If, we explicitly mention. It like. Like. This. 7. Right you. Got all the values, if. I add something, a, pen. Happened, is a method. That helps in adding value, let's, take H and, what. We have here, we. Have 8. Being, added to the list now. If I use if you execute the same thing I am going to get only 1, to 7 I am NOT going to get the complete list, so. In order to avoid this form you. Can either complete, to omit it if I told you you're, fetching till the end or else, you can use kill n. Some. Case what we do is like we know know. We. Mentioned. Ok, something like this you can have 1 to 8 right I want. To get only. Till. Seven, so. In that case what we know what we usually do is -. - or, else, 1. 2 0, 1 2 3, 4 5, or 6 we. Can explicitly mention, like this. But. The problem, Methodist. Let's take I have added. Another. One. Okay. Let's take. Insert. I have. Added something like, 0. 1. 1. Yeah. Here I have added 11 if I exclude the same thing like here, what. We got 17 omitted so. There is a possibility that you may you know you will get you may get an expected, result so it's always better to use the length instead. Of explicitly mention, like this, okay. N. Equations. No. And. In soulless Turin is slicing we, did and reverse order and, they, were sort of what we did here is like. In. Order to print it in reverse order we can use :, : minus one right there's. A better way to do that. It's. Reverse. And. It's been reversed, complete, like it's. A positive value because it has chained the. List. Completely, if, you print my list, it's. No more going to be like, the previous one. Right. This, mean completely reverse so, you need to be a bit careful like, when we use reverse method so. It's going to you a positive result. It's. Going to affect the actual, list. Okay. Let's. Take another example let's. Take, 0. 5. 1. 3. 2. 2. And the 6. The. Season, no. Unsorted. Right, if, you want to sort it you, can you sort method. What. We call 0, 1 2 3 4 5 6 ok. By, default. Sort. Is reverse, equal, to false. Okay. It's going to print in ascending order.
When. When I say it was equal to false it is nothing but ascending, order. If. You want to sort it in descending. Order what you have to do is true. You. Will be ascending you not to mention that was equal to false you. Can cannot compare to omit it but. If you want it in reverse order, what. You have to do is reverse true. You. Can see it has been prayin sorted, but written the words order, right. Any. Questions. Printing. In Reverse. Sorting, it sorting, by nature it is ascending, order, and, if you want to get in descending, order you out explicitly, mention. The parameter, reverse. And for. That and the value should be true. Okay. Any. Questions have a question on reverse, can we use like the reverse and slicing. Slicing. Here. It's, going to be like this. Like. For example, you. Know the. Example. About that eight seven, six five four three two one eleven. Okay. Let's. Take an example okay let me write, it here okay. I have. List. Yeah. So. Now you, want to let's, say a print. You. Know one two three in Turtles. Like. Huh you know p-21. Okay. So. Yeah. So. For example like you know eight seven, six five four three two one. So, three is in, like, -. One - two - two - fourth, position, - fourth position is three -, third position, is 2 - 1 position, is I'm. Sorry - 2. Position, is 1 - 3 position, is 2 and minus 4 position is 3 so, I want to get 3 2 1 and then. Yeah. Those those three values. After. Sorting it like once it's been sorted. Yeah. In this case I guess we can sort it but let's. Say I'm not doing this sorting, I just want to go by. Positioning. Like. The index. They've. Got it, it's. Just sort in ascending order, and you, want to face the first real, elements. Which, are nothing but 1 2 3 if at all it is in ascending order. Yeah. I guess, we can do that but. But I want. To see it in like a different way I want, to see it like. So. For slicing you previously, mentioned a. Method, right I forgot, the. Name of it. First. You know when you were doing lighting. You. Present and show me like we have Jupiter notebook so. I am NOT getting the complete picture of what you are saying maybe. Yeah. I want I wanted I want to get that but I want to use the reverse and slicing, instead of starting. Now. You will send slicing, without. Without. Sudden I. Don't. Want to start because. I can have like characters, also right so. Like. This and you need slicing. Like this, right. Right yes, yeah. This. May. Not work. About. Any. Alternative. Okay. Basically, what you're trying to do is if it is an unsorted, manner, or. Like, you need you know some water like it was so whatever whatever the method you want applied and you, want to fetch only certain set of values. Correct. Exactly. Let. Me try to understand, so reverse is always like, is. It more, of an order, thing like ascending, or descending or. Reverse, is you, know it doesn't matter if it's not personal characters. It just reverses, the whole list it's. Going to reverse the whole is not going to sort it out, whereas. Salt is specifically. For to sorting. But. It has a parameter, in it that we can either, know print. In ascending, or descending order. Okay. Okay. Yeah. Reverse. In sort is bit different from the actual reverse, reverse is going to simply reverse the Vangelis. Whereas. Reverse, in, sort is you know for, as to print it in ascending or descending order that's, the purpose of. Okay. But. That was a question like. Yeah. My question is like you know reverse that you know. You got I think you got that so I want to like reverse it and then take only certain, values within. That list. Quite. Maybe. This. Right. On this. Record. Is a list right so this is a list and this is my list and. What. We can do I. Can't. We use a variable, to, store the, reverse. Order and we can pull out requests. Required, a indexes. After. My list, can. You use, the. Slicing. Operator here yeah. Me. To be reversed or it's, neatly sorted, and you. Need only a percocet, of Anton's, the. Spacer first. We need, to then.
Reverse It, no. It is not going to make any sense that's. What I'm saying. This. Point is different let's take you 1 2. 3. 2, when. We slice it we are going to get only elastic, 3 elements, is going to get only this one, yeah. Applying. Reverse doesn't make instance but what he need is like 1, 2 3. Maybe. Let me think about it and, get back to you right now I don't, see any way to get it but they should be away. Maybe. I will get out of bed and got back to you tomorrow. Ok, answer was written slack. The. Next one is list. In the worse order print every nth element of a list that, is one good I, think like - what is list okay. Let me sort. It. Yeah. We, have this. One and if you want to print only like. 1/3. Like. Every, ornate member what. We can do is mildest. :. :. From minus 1 what do we get in reverse order right. Yes. Yeah you have to use 2, by. Default is 1 so. It's going to print every, element. If. You mention to see, what happens you call, every, alternate, member 1 3 5, 7 11. You. Mentioned, three it's going to skip 2 bangles 1. Here. We have mentioned 3 right so it's going to print to bangles, and it's. Going to print the third element and it's going to skip the next 2 bad news and so on to print third element and it's, going to skip the next 2 values but we have we don't have any other number after 11, so it's going to print only 1 4, 7. Right. Any. Questions. Initially. Especially. When you are new to pythons, but bit confusion. Confusing. Like especially slicing. And this. Sort of methods. But if. You practice it you will get it. Right. Data, 3 and Kartik any questions, no. Confusion. Yeah. No. Lot yeah. And. Then. We, have, print, every nth element of listing ok, that we can do and new. Value to the end of the list ok in, order to add a value to the end of the list right now, we have 1 2 3 4 8. Right so, you know one to add, another. Element like, lipstick 12. We. Can use a pen and the element here. You can see so. Now. The question comes like, how can I insert our specific, value in between the. Append only adds at the end right. So. If you want to add like, 9, after, 8, what. We can do this you can use insert. Do you have to find the index of this so, one two three four eight so it's going to be. Eight. Elements oh seven, eight. So. Eight. Nine. So, the net now this, is the index and this is the element that you want to add, let's. See the research what. Happened, after. Eight we got nine happen. Is not going to work this way so. You can't add in between. You. Can only add at the end I think, those, are from other languages, you. May heard. Like push. Method right. Push. Method will add element, at the end. So. Similar to that, we. Don't have push in Python, we have a pen, so. In order to add per. Treatment a value in between like, in a pepper, clay index you, can use insert. Any. Questions. So. Line. Number, seven. Yeah. Yeah. Before, that actually can, you go for lettuce, it's also. I. Think it's. Ever. We can use it actually, actually. The least is a, one tooth my list has one two three four and so on so here. We are extracting only, one four seven right so. I was in, two three and five six so is, there any way to extract. Two three five six. Only. Two. Mice, so. What are the elements we launched. This. Is what you are expecting, but. At the end we have twelve that is no more. What. Do you want so, if. You want to start from two you need to mention the. Index here and then. What. You need so, every alternate of what Oh. Actually. My, question.
Was, Initially, I have, only one four seven right, so. Easy, way, to. Extract. The missing elements. Okay. Fine. So you mean to say okay. Let. Me let, me show you that, so. You have something, like my. List and if. You print like three we're, going to add one four seven eleven and you. Start, from two that, is starting, with index one you're. Going to get alternate -, right the. Only thing is it has printed. This. Way let, me execute, this okay you got alternating, values. So. One thing is you need to chain the starting index. Zero. Okay. No. You don't understand understood you his question like his question is we. Are printing, every alternate, of some numbers right so here, it is going to skip the two element. Let. Us take one if, you print one is, going to skip the next two values is going to print the third element. What. If you want only this, part like two or. No. Something, like five. In. The start index no. Sir actually, I was missing three here actually if you see here I. Have. One, for 11 1, for. 7. Here I want. Extra 2 3 5 6 also, the. Missing elements yeah. Alright. So, not. Keys. Okay. I got your question you mean to say that one, for a except, one for 7/11. You need remaining values and yes yes. Yes. Yes. Don't. Like this. Intercept. Intersect. Or what is that. Intercept. Intercept, or intercept or do you only not interested, in let's try means intersect. Just. Going, to work. No. I. Think. You should discover, why it's not open. Unless. Changeless, and support operator, distant, best. There. Should be a method, -, or something. Mystique. -. Exchange. Index insert. Pop remove. Rebels. Let's, cheat remove. It's. Going to. Affect. This right let's. Try this then. There. Should be some matter like Union, or intersect, that helps, you to get only the part that you want, I'm. Not getting the right method. Except, something okay. Accept, or accept, let, me try it. Python. List. Except. Say. A. Set. Of values. X. Index, all except one item, in. Any. Way. Which. Is without element, index, X. Fear. Isn't lamp I, know, this not. Except. List. Of elements. How. From a list by mind you how to remove multiple image from a list. Romantically. Remains let's try this. Now. Without this. Minute. Useless comprehension. Again. It will Allah but. There should be a method, like intersect. Or something. Intersect. Or accept. Something like that it. Is trying intersection. Intercept. Basically, gives, common, result if. Intersection. Works, I believe. This one also works. Know. Let's. Accept. A. Lustrum. Let's. Within one list from another list. Remove. Clear. Removal. Remove. Let's. Try this. Without. Robust, comprehension, is there any way. We. Need to use lambda functions, so. Set. T -, set B and. Can. I do, this. Let's. Try this. What. Result we get there's. A list right so, my. List, good. Work. Why. Am I not, getting. Let's. Take mildest. Store. It in my. List. One. My, list. -. My. List. 1. And. This is not working. Well. You don't have any list. And list. Ok. I'll get back to you on this I think there should be a way some, method like intersect. Or accept, or something like that that. Helps, you to do that job, I. Should. Be a method. If. We if we have a method, should show. It here. Okay. Let's try remove. -. One. No. In. That case we need to write. A for, loop for. X. In, my. List. 1. My. List. What. If you move. X. And. Then. My. List. The. Result right. Dattatreya. We, can write like this or else we can use list comprehension but, there is no direct method. That has. Not. Water for list but why it is showing. My. List don't have 9. Yeah. Arun, bodies question, this question is like how to remove. A set of elements, set. Off I mean our, list from, another list. It's. Going to be, what I did here is I stole dinner list, certain. A variable, I love, it and remote. Okay. But, this is a lengthy method there should be another way a much, simple. Way I, will. Discuss that later, I'll. Take that and I always. Let. Me do some R&D and get back to you there. Should be a way I'm not simple way than this, it's. Okay sir all, this yeah yeah. And remove. Element we already saw. That and, using. The remove so. What we do is list. Let's. Remove, you need to provide the element. Let's. Take. 12. You want to remove. You. Have to mention four. But. There, is another method. Pop-punk. Will remove the last element. Doesn't. Matter what okay. You, can see that nine has been removed if, I execute, it again, pop.
So. What do we get. So. Eight has many moves and you can see that it has returned, element, that it has removed. Okay. So it's up to you to use remove. Or pop based. On the requirement, see if you want to remove, a specific element you can use, remove. If. You want to remove the last element instead, of using it remove on providing, the element you can use pop okay. And let. Me tell you you don't have any push we have to use a pen. Any. Questions. Are. Mo element we have seen the moon on instinct, element yeah the. Moon on existing, element. We. May get error. With. No for example. My. List we have 1 2 3 5 6 9 my. Worst are removed, remove. Let's. Take 7 something. That it doesn't exist you'll get an error so, you need to make sure when you write a code that, remove may throw error if it does enhance that it, ok. They. Should, be, a. Ramone. On sticking may remove element using pop with a rate sorta, else we have used I, already, explained sort, and list in reverse order we already saw risk reverse. And min. Max and some methods. We. Have list, here right so we have what, is the minimum value. To. Low and you. Can use mean. Forget. Mean max. You can use max. Like. Some. You, can use some, to. Get the summation of all the values. Right. What. Is the what, is -2 + 3 5 5 + 5 10 10 + 6 16, that is what we got here. Any. Questions, I think. It's better to stop here, okay. Let me explain string okay if you have any questions let me know I will discuss about few other things which are not. Simple. Any. Questions till now. And stringless there is no such thing as string list so, the, one thing is, okay. It's. Our perception, like if we have, if. We have only strings. In it. We. Call it a string list but, politically. No, there is no such thing as string list. If. It has only strings, we call it a you should we call it a string list. Another. Thing is we have something called mixed list also boolean, list boolean. Real stairs and. We have only, boolean. Bankers. But. They do such thing as no. Boolean, based or string list list can contain any, kind of data type I mean, it, can be often a data type. So. It not be just integers, I, can. Have something, like. 11.5. Which is a float or, a. Letter, or a. String. Or. A. Complex, number like this 2 plus 3 J or, it, could be another list, also. So. Tell, me how can I get, element. 4 from this I. Need. To know. I need to get this, element, 4, how. Can I get it. Let. Stuff of mine, one color, okay. Minus one. Because. There's the last one, right okay. :. No. No no that. Is minus one only after that there are one more bracket, we're. Back a key you. Can use which, number four number four. Right yeah, all right this, is the way to fetch space, mainly if we have nested let's record as an Esther illness, it could be of any type as I said before it, can be integer, float, a string, it. Can be a complex number it can be, another. List or topple. Or set. Additionally. I. Don't, have a question on this sir, yeah like what is the logic, of using. This like minus one and three like so. Minus one I understand, that you're taking, the last element. Then. So. It, so the, moment you put minus one it automatically, stores, it into a list and, then. Your. Test there's. No going to store it in the ListView this is so families it's. Going to say. Yes. So it's just getting the last. Value. You, know basically, getting a list within a list like within, the nest nest, it's, a nested list right so then. You. Started, off with bracket. Right yeah. Again. You. Get it so what is that large like what exactly is it doing there, okay. I understand sir is getting eval. Yeah. Sure. So this is a list right so, this very. Element, itself are listed right here. Right. What did make -, if you mentioned - when we got a list right. So. If this is a list. Mystic. Right like. This if. It is a list if you, mention our, index. Mistake, 3 we. Get an element right I. Think. Okay, so. This is going to throw this if. You mention like this if you can able to fetch a partner element using this obviously, we. Can man we can get we can mention right here itself. Okay. Got it okay now, let's, take another list, okay. 2.5, 3.5. Now. If I want to fetch 3.5. What we can do how. Can you face the value. Net. Mass minus. Plus as usual. Minus 1 this, is the last element and, and. Then I. Need. I need 3.5. Just. 3.5 nothing, else. My. Answer is to face the last list, and then. Any. Guesses even for a strong it's fine. Again. My dad cream I guess. -. Three all right, is, it okay, - three. Okay. And then I need. Only three point and. Maybe. I had wrongly mentioned yeah let's. Take three point five right, okay. So. You can use one. Or minus, one another. Square bracket and, then one. Alright. So. When we have necessarily so obviously we have to use this. Sort of no, this. Is the metro that we have to follow. Okay. Of course. We can use loops. To. Get the value no to, the.
Required Value but, in this case in spite no we. Are at the basic level so, it's better to stick to this method. Okay. Any. Questions. In. Fact there is a better let, me tell you there is a better way to do this if. We want to fetch only a specific number, I mean a value, we. Can use a better, function, we can write a better function, and searches. And finds value and gets, it. But. We're. Still in the slicing. But very basic level of python. Is, slicing right I stick, to this method. So. Here. Yeah. Always. Shall, we enter the. Operation. Place -, these kind of symbols, and. Expressions will. Set the list I, didn't. Get your question so what do you mean my place -. So. Hello. And, here. You mentioned, complex. Number, 2 2. Plus 3 J likewise. I rented. It you plus 5 or anything any, kind of expression. Which. Gives a unit you value. You. Mean, like. This 2 plus 3 -. Yep yeah. Yes. Yes into, that right, expression you got fire right. Any. Questions, before. We, join. The, list, let's. Take I have. 1. 2. & 3. So. Earlier we have used something like if. We have something like this, we. Have seen how to split, it right. What. We do X. Dot split. And the. Separate is comma we quote it right so. You if you want to. No get, if. You have lists like this and if you want to get a result like this what. We can do is you can use join. The. Join is nothing but a, reverse, to opposite. To split method. You. Need to mention separator, first so, what, you want like you want a separate, with the comma or, any. Other like the space or underscore, whatever you, need to mention the separator, and, then, join. In. Join you, need to mention, the. List. -. What. We go you. Can see that we, got the required a search. All. Right join, is nothing but an, opposite, to the split method split methods press the values and use. It in the form and using, the form of list of, elements, whereas. Join, is going to join the elements in the list and throw. It as one thank, you. If. You want to mention like comma space you can mention it like you can see comma. Space. It's. Going to be a very handy method. Especially. In problems. Where there is a possibility that you need to join the. Elements of honest, ok. Any, questions on, the. Height of this, one-time. Up this one type, type after. Joining this yeah. It is going to be string string. Oh. STR. So. If you want to convert to leach then I can simply apply a list right. It. Doesn't make any sense of course you can convert it but. Doesn't make any sense. You. Want something like this right yeah. But. It doesn't make any sense right so you can see that. In. This case in resin mechanics is every letter B no. No. In, this case it doesn't make any sense I believe. Basically. We, was joined to store it in a variable. Again. Converting, back to list doesn't make instance and then too he, was going to have only one eye. The. Next one is. Is. It good to stop here or shall. We proceed. Or. Can we complete till here. You. Almost done. You're. Gonna take a different topic or are you there. Is going to be the same list and. Tomorrow we are going to discuss study, and depend the remaining. Ten structures. Others. Are okay yeah. Tomorrow. Most. Probably will complete. On. The Python fact. Alright. Okay. Let's stop here and tomorrow. Continue, the. Remaining part of list very. Few we have been remind and. We. Will discuss about the. Remaining date structures like dish study couple, sets and. Programming. Structures, like, programming. Concepts like for. If. Wine range. Right. And a. Few other things lambda, functions you are the different functions although most. Probably tomorrow or maybe day after tomorrow will complete Python. Yeah. As I said yesterday like, basics. Have to be boring, and it retakes exhaust you but, once, you start doing poisonous won't be very interesting, ok. Can. I make a suggestion like because. It's going to take another two to three days then. We like later, session, like maybe. Half of this past session we can probably, you. Know talk. About Python and then maybe. Half. Or maybe at least 25% of the session can we talk on the machine. Learning, fundamentals. We. Need now basics we, need to have basic knowledge before, we get into, projects. That. Is what, we. Need to is not just Python you need to be. Good at numpy. Pandas, matter principle, when I write some code use it you know with, these libraries. Know. Mostly, there will be some confusion right so when I when, I when. I when I show you some projects, I have to use scikit-learn I have to use friend as I have to use them back. Again. Question, arises what is combined, Bandar scikit-learn. At all right so. It's better, to go through this process. Like basics. First. Three weeks and then from 4 3 4 so you can enjoy like, you. Can see the machine learning. So. You're going to jump into projects. Directly like. Are we gonna have like some theory sessions or are, we going to start directly with project. Yeah. We're going to start with basic portraits and advanced voice and then internals. Ok. I'm, going to give a glance of what is machine learning before, we get into basic projects but in. Depth we're going to getting to.
That After, we compare advanced projects most, probably is going to be in the sixth week or fourth week. And. Nothing like I'm going know, in. Detail like usually, the, basics of Python, but if. You you know if when I say Python. Basics, or if you watch any video on Python basics it's not going to be an O in depth. So. We need these sort of details, or these, sort of explanation or this sort of exercises. Especially. Like. You know for, data analysis and machine learning. It's. Going to be helpful in longer run so. Maybe for, three weeks and then you will understand why I am I'm going in detail. Ok. Thick and that, Adria any questions or feedback. So. Fine sir. Yeah. Right for me too I can. Understand why you say straight the 75%, to basics and the 25%, the project's also. Going to be interesting, and definitely. Places will be boring, and dry. But. It, is better to go this way first three weeks less, no. Let's. Stick to this. Yeah. Any. Other questions I think. A few questions I need to answer right what is a one, by. Aravind. Another, one by Dattatreya so. Removing. A list. From, one another is right. Let's. Talk elements. From. One another list this is by Dattatreya. We. Have a method, but we need a better way right. Another. Thing another question, being asked by our I mean what is there what was there. Before, some split. Reverse. And. And. Split. So. You need. Good. That. You need both. These methods to be operated there and okay. You're, splitting something, like. No. In one line right we. Need to edit and. Most. Probably it is going to be lambda you, mean. Using. Lambda functions. Maybe. Tomorrow or day after tomorrow, discuss about that okay. Okay. Any. Feedback or, or questions, any feedback is absolutely, fine no. I stirred. Like 20% fires, and Santa possibly, absolutely. Fine so don't hesitate to you feedback or ask questions, you're. Pretty silly it's fine. Okay. It's. Not like, lecturer. And giving lecture between. Lecture to others, is, just sharing to others my. Experience, and things that I have, from last. Four years, sound. About that. Yeah. If, you don't have any questions feedback you can log off and. Session. Recording, will be shared by when cursor they, can, no. Ask. Him in, whatsapp, group, maybe. He need to do some editing and there. Will be some delay, getting. And. With those who don't in watched the, previous two videos please, to watch I. Mean. You have completed watching. Two videos right I. Have. Watch. It and any feedback wishes, let me know. Definitely. Yeah. Anything. Else before. We end up let me stop, the recording.
2020-04-07 21:33