EuroSciPy 2017: Python (2/2)
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 43 | |
Author | ||
Contributors | ||
License | CC Attribution 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/38203 (DOI) | |
Publisher | ||
Release Date | ||
Language | ||
Production Place | Erlangen, Germany |
Content Metadata
Subject Area | |
Genre |
4
5
6
7
9
10
11
14
28
29
32
33
34
35
38
39
41
43
00:00
Default (computer science)Kernel (computing)Cellular automatonTerm (mathematics)Online helpData typeStatement (computer science)Letterpress printingControl flowFirefox <Programm>Equals signInterior (topology)Line (geometry)Computer fileBlock (periodic table)Element (mathematics)Line (geometry)Pairwise comparisonElement (mathematics)Electronic mailing listFormal languageSocial classSpacetimeBranch (computer science)Statement (computer science)Interior (topology)CASE <Informatik>BitOverhead (computing)Software testingError messageVariable (mathematics)Open setLaptopPoint (geometry)Control flowGame controllerPlanningKey (cryptography)CodeNumberMereologyMultiplication signWritingNetwork topologyLatent heatState of matterBit rateGame theoryRootWater vaporGoodness of fitHypermediaAreaRight angleData recoveryArmForcing (mathematics)VelocityThomas BayesView (database)Computer animation
09:58
Element (mathematics)Letterpress printingDefault (computer science)Kernel (computing)Cellular automatonFirefox <Programm>Control flowSimilarity (geometry)IntegerOnline helpFunction (mathematics)File formatRange (statistics)Exclusive orModule (mathematics)String (computer science)Block (periodic table)Line (geometry)Computer fileSubject indexingRange (statistics)Different (Kate Ryan album)String (computer science)LengthLine (geometry)Level (video gaming)Functional (mathematics)Context awarenessSet (mathematics)Electronic mailing listWordNumberElement (mathematics)Digital photographyKeyboard shortcutForm (programming)Content (media)SpacetimeRight angleChainOperator (mathematics)Multiplication signBitObject (grammar)Execution unitStatement (computer science)Scaling (geometry)Game theoryPhysical systemAreaSound effectInformationShared memorySemiconductor memoryLogic gateFamily1 (number)WeightIdentity managementCoalitionGoodness of fitThermodynamic equilibriumMathematicsCASE <Informatik>Arithmetic meanComputer wormUsabilityComputer animation
19:50
Letterpress printingRange (statistics)Online helpImplementationFunction (mathematics)Cellular automatonKernel (computing)Firefox <Programm>Control flowGUI widgetPrice indexBit rateIterationDefault (computer science)Module (mathematics)File formatElement (mathematics)Form (programming)Element (mathematics)IterationNumeral (linguistics)Subject indexingOnline helpLine (geometry)Variable (mathematics)BitElectric generatorElectronic mailing listFile formatString (computer science)ResultantRange (statistics)Functional (mathematics)Statement (computer science)Order (biology)Protein foldingMultiplication signInfinityOperator (mathematics)WritingQuicksortVisualization (computer graphics)Reverse engineeringFault-tolerant system1 (number)Row (database)Bit rateRight angleNumberState of matterAreaUniformer RaumShooting methodNatural numberSign (mathematics)Game theoryWeightCASE <Informatik>UsabilityAnalytic continuationReal numberCausalityWeb pageSpeech synthesisComputer animation
29:43
Kernel (computing)Term (mathematics)Control flowOnline helpPrice indexFunction (mathematics)Bit rateLetterpress printingFile formatSystem callMilitary operationPhilips CD-iStandard deviationProduct (business)Library (computing)Firefox <Programm>Electronic mailing listString (computer science)WordComputer animation
30:54
Function (mathematics)Military operationProduct (business)Library (computing)Standard deviationPhilips CD-iFile formatLetterpress printingKernel (computing)Cellular automatonControl flowStatement (computer science)Firefox <Programm>CountingInfinityModule (mathematics)Online helpRippingElectronic mailing listRange (statistics)Data dictionaryLine (geometry)Computer fileRouter (computing)InformationOperator (mathematics)Right angleWireless LANInstance (computer science)Online helpProduct (business)Query languageInternetworkingPlanningForm (programming)Musical ensembleMachine visionSelectivity (electronic)Bit rateSuite (music)Reverse engineeringExecution unitLogic gateSpacetimeHypermediaNumberCASE <Informatik>Multiplication signWindowNetwork topologyRow (database)Condition numberProcess (computing)Reading (process)Client (computing)Table (information)Utility softwareQuantum stateOrder (biology)Functional (mathematics)Message passingControl flowCodeIterationType theoryElectronic mailing listStatement (computer science)Formal languageBitLine (geometry)Element (mathematics)ResultantComplex (psychology)Object (grammar)Error messageMoment (mathematics)Pairwise comparisonLoop (music)Function (mathematics)Mathematical optimizationMetrePoint (geometry)Design by contractBlock (periodic table)Computer animation
39:14
Military operationStatement (computer science)Range (statistics)Kernel (computing)Firefox <Programm>Control flowLine (geometry)Computer fileTerm (mathematics)Drill commandsBitWave packetGame theoryCASE <Informatik>PlanningOffice suiteArithmetic meanGoodness of fitPrisoner's dilemmaLabour Party (Malta)ArmSelf-organizationRange (statistics)Bit rateMultiplication signTerm (mathematics)WordWage labourElectric generatorMixed realityRule of inferenceTouch typing1 (number)Shared memoryInternet forumNumberIdentity managementShift operatorComplex (psychology)Electronic mailing listElement (mathematics)QuicksortRight angleLine (geometry)Speech synthesisHeegaard splittingStatement (computer science)Nichtlineares GleichungssystemCausalityData compressionInfinityFunctional (mathematics)Loop (music)Module (mathematics)Data conversionReduction of orderLevel (video gaming)Parity (mathematics)Pairwise comparisonFormal languageCondition numberIterationMatrix (mathematics)ExpressionPoisson-KlammerView (database)Object (grammar)MultiplicationForm (programming)MathematicsComputer animation
46:41
Range (statistics)Statement (computer science)Data dictionaryKernel (computing)Cellular automatonFirefox <Programm>Control flowLine (geometry)Module (mathematics)Computer fileSystem callData typeMatrix (mathematics)Subject indexingForm (programming)Multiplication signSquare numberElectronic mailing listInterpreter (computing)Element (mathematics)Set (mathematics)String (computer science)Different (Kate Ryan album)Data dictionaryKey (cryptography)Poisson-KlammerNumberComplex (psychology)Line (geometry)Point (geometry)Bit rateUniformer RaumControl flowLogic gatePlanningResultantTable (information)Game theoryRule of inferenceView (database)Order (biology)CASE <Informatik>Basis <Mathematik>RoutingSeries (mathematics)OvalAreaComputer clusterMachine visionOcean currentComputer animation
54:07
Default (computer science)Interactive televisionData typeInformationLikelihood-ratio testKernel (computing)Control flowFirefox <Programm>Line (geometry)Module (mathematics)Computer fileSystem callTerm (mathematics)Range (statistics)GUI widgetStatement (computer science)Function (mathematics)Letterpress printingString (computer science)IntegerInclusion mapoutputParameter (computer programming)Game theoryGoodness of fitType theoryOrder (biology)Key (cryptography)Video gameSemiconductor memoryData dictionaryCASE <Informatik>MereologyFunctional (mathematics)Volume (thermodynamics)Form (programming)Parameter (computer programming)Revision controlWordStatement (computer science)Social classInstance (computer science)Data structureIntegerNumberNeuroinformatikDescriptive statisticsSpacetimeArithmetic meanString (computer science)Proper mapLimit (category theory)outputOdds ratio2 (number)Branch (computer science)Set (mathematics)WritingAreaBitAuthorizationFitness functionOperational amplifierPlanningRule of inferenceDemosceneEvent horizonOffice suiteComputer virusField (computer science)Multiplication signArmComputer animation
01:01:42
Default (computer science)Kernel (computing)Shape (magazine)Electronic mailing listString (computer science)IntegerData typeInteractive televisionInformationParameter (computer programming)Line (geometry)Module (mathematics)Function (mathematics)Variable (mathematics)Cellular automatonGUI widgetStatement (computer science)Functional (mathematics)Type theoryAttribute grammarObject (grammar)ImplementationMachine visionBoundary value problemMultiplication signComputer animation
01:03:03
Line (geometry)Shape (magazine)Parameter (computer programming)String (computer science)Electronic mailing listIntegerOnline helpKernel (computing)Cellular automatonGUI widgetStatement (computer science)Function (mathematics)Letterpress printingPredictabilityRule of inferenceParameter (computer programming)Computer programmingLabour Party (Malta)Moment (mathematics)Computer animation
01:04:18
String (computer science)IntegerFunction (mathematics)Firefox <Programm>Default (computer science)Kernel (computing)System callParameter (computer programming)Online helpElectronic mailing listLine (geometry)Computer fileGUI widgetModule (mathematics)Variable (mathematics)Logic gateBit rateNumberArrow of timeFunctional (mathematics)Neighbourhood (graph theory)Default (computer science)Multiplication signParameter (computer programming)Different (Kate Ryan album)IntegerVariable (mathematics)Revision controlProcess (computing)CodeLine (geometry)System callProduct (business)Instance (computer science)Goodness of fitRow (database)Form (programming)Reading (process)CASE <Informatik>Electronic mailing listGame theoryMetropolitan area networkDemosceneMusical ensembleWordLabour Party (Malta)BitComputer configurationMathematicsTerm (mathematics)Key (cryptography)Computer animation
01:09:23
IntegerVariable (mathematics)Parameter (computer programming)Function (mathematics)Sound effectSystem callKernel (computing)Default (computer science)Computer fileFirefox <Programm>outputData dictionaryString (computer science)Cellular automatonModule (mathematics)Line (geometry)Key (cryptography)GUI widgetParameter (computer programming)Default (computer science)Order (biology)Functional (mathematics)Level (video gaming)CASE <Informatik>Point (geometry)Multiplication signPattern languageDifferent (Kate Ryan album)State of matterIntegerVolumenvisualisierung1 (number)Operator (mathematics)HTTP cookieMereologyInstance (computer science)InternetworkingImplementationCondition numberGroup actionMusical ensembleTheoryFactory (trading post)PlanningCategory of beingBit rateMountain passGoodness of fitSineForm (programming)Computer wormEvoluteHypermediaBitConfidence intervalKey (cryptography)Game theoryMathematicsMedical imagingMetreComputer animation
01:18:08
Default (computer science)Parameter (computer programming)DistanceFirefox <Programm>Musical ensembleExecution unitForm (programming)Object (grammar)Type theoryTerm (mathematics)Parameter (computer programming)Default (computer science)Pattern languageFunctional (mathematics)Virtual machineBitContent (media)PRINCE2Instance (computer science)RootComputer animation
01:19:19
Default (computer science)Kernel (computing)Cellular automatonParameter (computer programming)DistanceFirefox <Programm>Line (geometry)Computer fileVariable (mathematics)File formatLetterpress printingHausdorff dimensionFunction (mathematics)Ring (mathematics)Annihilator (ring theory)DistancePoint (geometry)Different (Kate Ryan album)MereologyParameter (computer programming)Key (cryptography)Line (geometry)WordPattern languageVariable (mathematics)Element (mathematics)Dimensional analysisNumberSystem callFunctional (mathematics)Position operatorComputer configurationCASE <Informatik>Software testingQuery languageCondition numberRange (statistics)Order (biology)Physical lawLevel (video gaming)Goodness of fitRight angleMoment (mathematics)Event horizonCategory of beingSocial classComputer animation
01:24:06
Letterpress printingFile formatIntegerVariable (mathematics)Function (mathematics)Parameter (computer programming)Default (computer science)GUI widgetCellular automatonDistanceHausdorff dimensionFirefox <Programm>LaptopKeyboard shortcutoutputTerm (mathematics)System callObject (grammar)Shape (magazine)String (computer science)Line (geometry)Electronic mailing listCodeStandard deviationType theoryControl flowOnline helpOpen setData typeOperations researchPhysical systemLibrary (computing)Directory servicePattern languageComputer fileDigital filterType theoryWordMathematicsParameter (computer programming)Computer filePosition operatorCASE <Informatik>Instance (computer science)Functional (mathematics)IntegerLaptopLibrary (computing)Streaming mediaObject (grammar)Electronic mailing listPlastikkarteModule (mathematics)Data managementLogical constantSoftware testingWeb pageDistanceImplementationoutputSummierbarkeitDifferent (Kate Ryan album)ArmStandard deviationSquare numberOpen setOperator (mathematics)CodeRootMultiplication signNumberResultantPoint (geometry)VideoconferencingPhysical systemControl flowAreaUsabilityUniverse (mathematics)Computer virusFamilyRevision controlCommutatorDegree (graph theory)Digital photographyIdentity managementAngleTime zoneCondition numberRule of inferenceWater vaporLattice (order)Computer animation
01:32:47
Maß <Mathematik>Computer animationLecture/Conference
Transcript: English(auto-generated)
00:05
Okay, so we can open everything up. Before that, I thought I made the questions. So, who wants that this piece go faster? This is just to know for me if I can... Or it was fine, and it was not...
00:22
Okay. So then we have six notebooks to see at home. I didn't plan to make them anywhere, but there are more stuff that are coming afterwards. So I did not plan to have time to do the second one and the third one. Maybe not until the end, but I hope to activate the third one and break part of the third one.
00:43
And then the rest is maybe more complex, so you can get the solution here. So we start with points of basic type, which are really codes, integers, and all those type. So now we will see whatever follow you, what they call the control code, that we will manipulate those.
01:02
We can follow if, else, and this is the syntax. Because Python is a bit specific on those, compared to other languages. So, you must know how to transfer from another language. So we start with... So, the if, else statement.
01:23
And... An important thing, if you come from... So if you come from Matlab, it looks like it might be the same, I don't remember. Maybe I remember. Is it indentated like that? No? Okay, so you understand.
01:42
So, in Python, what's important is always, the indentation is very important. So it's how you organize your code. So you have if statement, whatever is inside the code, will be intended of four characters, or two characters, that's very simple characters. And when you go back, is that you get outside of the statement.
02:00
So this is something which you have to get used to. And get used are so hard to read it. So, first we have to read locally the if, else, and if, any from the statement. Which are the following to make a comparison to go in one branch to another one. So how to do that? So we can detect two variables.
02:23
So it's a and b. Which is equal to a. One and two. So, yeah. You can make it and then read it before. But you can inline which are several variables. Where one will be, like here, a two will be, in fact, inside the same variables.
02:41
Sometimes that's savings of space. Or when you enter it, you don't know. And now I would like to make some comparisons. So if I could try to catch if a is equal to b. And with an inline, I finish my statement with two points,
03:00
saying that that was my first if statement. I'm going back, and now I keep an inline, and I will be able to put what I want inside my if to be equally. When this is equal to b. So if a is equal to b, I want to explain.
03:24
And to make the case that this is useful, so we have a which is more than b. So I could make an if statement. If a is the interior of b.
03:41
Please. a is the interior of b. And then lowercase, whatever.
04:05
Let's see if it is. My a and b were there. So what I want, I want to do this branch and this. So you can add the if, the if, and the ifs, and then put the ifs. So I don't think that there is any branch.
04:21
It's looking like it's all in overhead. The only thing that is maybe a bit more tricky is how you try to do that. So if you forget, because it's always good to know, I think, if you forget the two points, you have the syntax error. So if he tell you something about that,
04:42
you can tell him what happened. What test can I tell you? Yes. So let's say I want to be a boy.
05:02
So if a is the interior of b, so this shouldn't work, because I have a different indent.
05:24
It will tell me that this, okay, indentation error, unexpected indent, is finding that here I have a space more than the new 94. I don't know what to do and to which. Where is it belonging to? And it's sending it.
05:41
So I think maybe it's a good error that you can get when you mess up, when you write it. And when you show those, you can think about indent is just an alignment. Syntax is because you've proven a certain point. And sometimes when you get the errors, don't only check the line that you have,
06:00
but also the line before. Sometimes it is like you've proven the line before and it's telling you this line is wrong, but I've written the one before that you've proven something. So that's what they're doing. So here, in the number key to a different local, we will change the value of a and b to see that we exactly have
06:20
different parts of the tree. But, I mean, that's obvious. So now I have an exercise. So we saw ready with list, for instance, that's the empty list. And now the exercise is using a if, trying to get that the list
06:43
is empty or not empty. So we saw if a is equal to that, I would like to write something, if, something with a, and think this is empty. Or if, not a, so that's not, that's if. So that can be true or it can be false.
07:04
I'm trying to bring something and check which statement we are going to check actually that the list is empty or not. You can write a couple of things to me and see what you can come up with.
07:48
That's quite a good question. So that's, what would be, which language do you use to do it? Okay, how do you do it in Russian?
08:00
Do you use other point size or size? Okay, so I think in my class we will do something which typically you would do that. Is it only for zero? Okay, so if it is equal to zero, then see if I can get something or not.
08:24
Okay, so empty. Okay, so I write that. Okay, I write this. I can check the size. We saw that it was a container. I can check how many elements I have. If my list, I check nine of eight.
08:44
It's not zero. It is zero. So equally for zero, we take it, the name is empty. That's the way that you would write it in my lab in C++ array is not the way that you would write it
09:01
usually in Python. Because the way that you would write it, an empty list will actually, when you put it in the if here, if A, it will return you a false. Because empty is like nothing inside
09:20
so it will be false. So if A is not A, sorry. So if A will be true, it will be false. So if I want to trigger this statement, I need to trigger the true and false. So this, because maybe I didn't trigger the true and false.
09:40
So if I am not true, it's false. That's kind of obvious. So if I take that, if A is false, I can use if not A and this will work.
10:04
So if A is actually an empty list, it will execute this statement. So if I am an empty list, we are going to write the equal equal zero and the length. The only thing that we are trying to do is take the if not A and you will know. So I mean, in that case,
10:20
this is how we are checking. So this is a kind of, if you read a lot of code, I mean, if you write a lot of code, if you see this, you will be more usually see this than to see the equal equal zero. So if you are just to show you the difference between when you come from a map that you do something, in fact, you write it in that way
10:40
and you can just do that. Is it just a matter of style? It's a matter of style. Because I am not doing the same. I know only. I know at the lower end, it's the operation of this one. So you release, that's fine anyway.
11:02
Okay? And this also means that you don't have a little definition for the map so they don't draw a zero. So it's just like, do you know what I mean? No. Because you can say it's nothing like A. Because it has to be not A.
11:25
I mean, the only thing here is to check that A is empty. So it's a list and it's empty. So you really want to write that because you know that A is a list. Okay, I mean, if I write it in that way, the context then that I want to check
11:41
that the list is empty or not. The word context, I know this is a list and the way to write that it is empty and that I want to do something with half n values, I will do it in that way. So then, in a similar manner,
12:06
let's try to write it in a frightening way that if I have A is equal to zero, how do you write the each and every
12:20
so that I can indicate it? Write it if A is equal to zero, I would write it again, if not equal. So, if I do that,
12:46
check B is not K,
13:01
so it's zero. So it's equal to the same. So I could have write if A is equal to zero, but usually it's the same. We don't see it before we try to write it in that way. So now I will take the structure and summarize what we want, which is, you have some set that triggers force, and you have a couple of objects
13:20
that are doing this, which is an empty list. So I will press the list of the units that are doing this. So, zero, force, and number one which is number. So this one is the number if I
13:41
in X, so I anticipate all the photos, but what I'm trying to do here is to take a photo on each element, and I'm going to take this statement just to show you that actually you trigger that, or Y in X, if Y,
14:01
not, if not Y, means the same as force. Okay? So for the four elements that were in the same list, that were those one,
14:24
if not Y, will always be the key thing. So when you say if not Y, don't, I mean, think about what Y is, because it could be one of those. Okay? So it's something to know, I mean, if you read some code, don't take a shortcut thinking that it's just only equal to zero
14:41
because it could be none, it could be force, it could be energy, so be careful about the context. So it's something that could be overall. So it's what I just explained here. So, let's start with the form now.
15:00
I just gave an example briefly of what it's doing, but I will give more information, I mean, we can check that. So, let's copy paste this process here. So the syntax is a similar way, but we are for the index,
15:20
instead of the variable, where we want to add some values, and then we have the in, which is a container, you will pick up the content of this list and pass it to the i and you order all those elements. Okay, that's the second point, I need that, and then
15:41
you can do something. So instead of doing this, it's bringing the value 1, 2, 3, 4, because it will pick the length over the length and take each element. So, now I have an index size, and you can write inside your command line
16:01
at range it will give you a love string and for the one that comes from my channel, it will be in space. And the range tells you some information, this is similar to the slice, where you can give some numbers, and my idea is to try to reproduce
16:22
this thing here. Instead of using a list, try to use the line function. So, you have the edge here, and you can try to write the first segment, and instead of writing the list you write the list, generate the list, it will match.
16:42
And then you can print, so you can print the whole HTML like we do for example like this one.
17:08
So, for my list here, if I have a string what is the guess?
17:21
So, it's a container, each number is in the space inside my chain on the right. For the string, I said that my array is the characters in each So, if I have a string, I will print
17:44
each time one character, because I will iterate over each of the of the of the items, because what I'm doing is in each sense does that make sense?
18:00
I don't know if it is numbers in the list I don't know. I mean 1, 2, a, 3 Ah, it will work in the same way So, if I have this
18:22
So, it will work in the same way because it will iterate that's an element, that's an element that's an element So, it will print 1, 2, a, 4 So, how interesting is this? It is printing 1, 2, a
18:45
a, a, a, a on each line How do you iterate? 1, 2? 2, a Because this is the container So, it will print my full container So, it's going to do that
19:02
Ok, so it will print all this, and because the string reads more complicated maybe some way it seems not like it will Then I will put something else I need a bit more here
19:20
I mean, that's the container So, that's the list So, when I go to that, it's in fact in the full list and in the full list So, with the string it's the same It's not printing it for you So, going back to the range I don't think it is more difficult
19:40
than the size So, what we can do is for i in the range The dot we're seeing that you can put either the start or the beginning the start and the step So, let's start by the start I would like to go until 4
20:01
But we need an infinity So, we need i and then I can print i and this is creating values and we can iterate over and the same way you can print stuff like
20:22
0 and say 10 and I want 2 values I need to do by step So, the range function is very useful for that One that you pass to numpy you have over function with your operators ready to work with them by the end
20:55
So, we saw before the container
21:01
So, now my question is How would you do it? So, you remember we had something that we're seeing something like months and we have 3 values inside It's a very
21:25
Ok How would you iterate on that? The same way than before? Great Why is it different? It seems that it's working for a string It seems that it's working for a list
21:41
Why is it not responsible? So, we can try So, when we iterate with an S or maybe it's an ES For months In months So, it's very useful We can continue
22:00
We can bring every value that you went back So, you mean that any container you have always the same way of moving over So, you can use In You don't have to Like, usually what you do in MacLab or in C is to create an array with the index And then you will go and pick up the
22:22
elements created to the index Ok? I mean that's the common way So, in Python you can already when you have an array, you can already unpack the values directly and go inside like this and inside like that and get here in the value We call it index Ok? So sometimes it is
22:41
all that sort of array and not how to do it I mean, the writing is easier to read Then, if really you need an index You have this function which is put in the array So, you can need it for some reason And somehow it's taking
23:01
the following Is an iterator for index So So, when you create, when you want to over the months for instance, in the tougher which you will be interested in that so to know what are the corresponding index where you are Maybe you want to do something in and you want to assign
23:22
So, I don't want only to know which element, but I saw an index To do that, you can use the function you write So, what would be the index and what would be the months And I can use enumerate over the months
23:42
So, you will return me two variables That was my tougher So, that's each element of my tougher And enumerate will return back an index Ok? So, if I print IDX
24:02
Let's make one line to index Once And I explain format a lot Ok, format is a nice way of
24:22
creating a string and instead to Here I will replace what I put inside with the value of the line So, you see I will put index and months And what will happen is that the value for my iteration here
24:40
index will be put and the first one and this one will be add the second one So, if you want to insert for any rhythms is not a good order you can also specify the order that you want So, here I want my second variable the index one and here I want the first variable
25:01
to be an index zero So, you can reverse And now I have things which are on the same line So, I have my index of my folds is the same time as my months
25:21
Ok? So, only when it's at zero is not the most of the generation Ok? So, that's not super useful What we would like is not to, we could write index plus one but we are better than that So, what we can use
25:41
is the zip function So, that is the zip It's working a bit the same way I mean, the syntax is the same way than the enumerate So, actually, we will put zip and then we will give
26:01
iterators combined to containers I mean, these work with containers So, we could add a list here and a second list And then, if you read the what zip will do is to try to take an element of each every time and use it
26:21
So, if I have two lists with three elements I will take the two first elements the two second elements, the two third elements Ok? So, now there is less science Now, let's spend more is to write a form using zip unpacking to list
26:40
one, or whatever iterable it is Where in the first iterable I will have the months and in the second one I will have the numerator so, one to three So, you create two things and then you unpack or use zip and then you can print the statement
27:00
these months is index one Ok? We have something which is not in what do I say Because I'm giving you the help Now, you have to read some how So, it's easy to read You can write, just continue the pace before the idea of the solution
27:21
and we give an iterable here
28:09
So, here what we tell you is to give two iterables and then we unpack them to variables Ok? So, the way that should do that So, first let's create
28:21
a really nice variables then I can create this one which is three Ok? I can put this index and the months and now I will use my
28:42
zip and give my two iterables Ok? So, the first one will be months index and the one will be months
29:10
and now I can print the results Ok? So, that's really mean that I can give two lists or two
29:21
iterables, ok? So, two lists two tuples, one list, one tuples a string, whatever and then I can unpack with this and, good I mean, start to make things with them, ok? So, now I say that I took the first element of the first thing we generate and then we say that this goes from
29:41
one to another Ok? What if I have a list which is longer than the other one what do you think that fighting will do? Is it raising the algorithm? Is it going on the longest one?
30:01
Is it going on the smallest one? What do you predict? What makes sense for you? One is more One is more? Yeah, that seems to be true So, I think that was the next question Yeah
30:21
No, that was yeah. So, instead I have that I have two tuples, and I have more in months strings than in the months indices, ok? So, I will see I try to see what I'm thinking I need to check I only keep values, so it means that it took the three first values in command
30:40
and it just discarded the handling, ok? So, be careful when you see things that you think that you do something, but actually you didn't finish the job, so give a word that that's one of the behaviors that you cannot have, so always breathe a lot Then, just for information, you have another thing which is interesting
31:00
in the in the summary query which is E.T.O.U.S and can allow you to the same as E.T.O.U.S, you can make some operations. So, for instance one is products, in this one example but if you want to check more you can check the help of E.T.O.U.S
31:21
I need to see more things where you better go in there and check the full list, ok? But, the idea that you have function, so instance
31:41
the product one which allow you to try and let me try and the products
32:01
allow you to take my first list take my second list take the first element and try with all the elements of the second one take the second element and try with all the elements of the second one so you can make the products of the two lists, ok? So sometimes we want to understand what is more complex iterators or iteration-wise
32:21
of combining two lists or more lists So, if you need any of those, you can go and check if this is available in E.T.O.U.S because E.T.O.U.S will allow you to inside the product to make those kind of operations which are a bit more complex, ok? So, that is just to move back to E.T.O.U.S. So, the product
32:44
allow you to look over some stuff and why you have so like in E.O.U.U.S language we have the Y, ok? So, that's something that you probably have saw in E.T.O.U.S statement is the low one
33:01
you check that the variable is bigger smaller, or you make like a statement of comparators and then you make operations which is in E.T.O.U.S, ok? So, in that case we iterate over N until the N is greater than 10
33:22
after that we break our our our if we want to continue to for some meters so it doesn't matter, it's just really straight the break statement but this thing is only the same as before so you should do it as before
33:42
like this one, but I want to show that you can actually use the break at any point, I mean you have an optimization contract and you want to stop the iteration at some point because you have some contract with the iteration number or something like that you can make a check with the if
34:01
and say you have to break when this is true, if we break the Y in that case I have the Y because Y2 will just keep in the loop and I can break it at that time so if you change that's working very important, breaking then this
34:24
so we have Y we have break, and then these two which is going to continue and pass it just allows you to do straight what what is your guess about continue? what will happen if I need to do this thing then? I mean
34:41
it's mainly confusing what continue will do and what pass will do what could be the difference? Do you have any idea? So here I just check that if it's an odd or even normal case so what could happen in that case?
35:02
Do you have any clue? So continue will just not execute what is afterwards it will come here and it will come back to the next iteration pass is just something that
35:21
let's pass okay so if you check here I have only this statement so here the x pass is useless to illustrate that you can sometimes just pass pass is just making pass continue, it's just skipping
35:40
the right iterations okay no, it's what I said, you don't need pass here you just in some case if you see pass pass is just to let pass I mean it's to know that the difference between continue and pass you could explain that continue or you know for some reason
36:02
just continue the code but that's also the case there's a code and this is pass but here in that case what you click right you want to do that did I understand right that continue moves to the next iteration and pass let's continue to the next iteration so pass is essentially no it does nothing at all
36:23
it's just because there has to be something in the in the there has to be something in the code block so if you say if something is some condition colon then there has to be an indented block below that and if you are not actually doing anything there then you can just
36:41
say pass and it's it's sometimes actually used as a form of documentation so you can say if this condition applies then actually do nothing so you say pass else do something else right?
37:00
just for as a marker saying I've seen this case and I explicitly say do nothing so specifically in this case but I would have tried only this because the x pass is really less so that would be the same result
37:21
pass is definitely extremely rarely used it's more object oriented and somewhere you don't want to implement a function but you don't want it to break and somewhere you say okay you'd like to implement that but for the moment you don't write an error so you pass this function
37:40
because it does nothing but I want that it doesn't break the code of people so you could have an empty function let this pass and then for example it doesn't break that's the type of thing that I'm doing that doesn't break so then next we saw the list
38:00
we saw a fork so sometimes there is something we write in Python that we can do is to create a list in one line so it's called list of functions so let's first take this example this current number which is I have an empty list okay and now we saw that we can
38:22
loop over so we loop from 0 to 9 and then I can append each value inside A so we write in this this is not working it works in IPython but in
38:42
Python you have to do something because you have to keep the loop together and the A is separate so yeah A is going to do that so for I and then and now I have a list where I put
39:08
those things so it took somehow three like outputs to create a list with numbers and a nice way of doing it is to compact it
39:21
so you could write in this way and this way is known as these compressions so you can usually I mean it's distinct the syntax is distinct because you have square brackets of the list okay and inside you will have the way
39:41
that you create it here so how you read it is I want to put an element I in this list and the element I responds to each element of I in the range of A so in one line I can create the same list and you will find that there are much more
40:01
lists in Python than the one where you create an empty list and add the element inside okay so now we saw that we can do that for for the right of value but we can even go further because in some way when you read this
40:21
it's like if you read English and if I want to imagine I want to make a form in which compared to before I want to take only the odd numbers for the element in every range
40:42
so I can do this then I can do my form then I can make a change that the module is one zero in this one I want to
41:01
continue to skip it otherwise I want to make that append the value of I I have to go to post68 okay, so now I add two lines more
41:22
with the list conversion you can also include this when you create a list so if I go back here I could say I did what I want I want each I for I in range of this but only if I is equal to respect this
41:40
is here, okay so I do that write something in this way so I will put only I when this is not true so if not I zero two, okay, it's true and this is what I expect so we can add statement
42:02
in that way you can change the same things but in a compact way okay and when you are used to this you will find English speaking things is it a metapersonal preference or is it
42:21
a sort of to do it in one line because it becomes less readable it's a Python equation you can read a bit about these conversions I mean the first one I read apparently is the guy in Python that said it was nicer than using some functions
42:42
in somewhere it's avoiding sometimes to find a map to reduce feature function between the middle and when you are used to it it's much easier to read but it's good at knowing you need to be used to it and also you shouldn't because you can go into infinity
43:01
and put a lot of stuff so I know if it's maybe my own rules but if this compression takes more than three lines is that very easy to make a this compression? but that's my personal opinion so generally speaking the append way, the loop with the append up there is very uncommon
43:21
so you would almost never write this in Python unless the loop is actually more complex than what we have there. Something like this would always be spelled as a this comprehension and even if the this comprehension is a bit more complex it can make it more readable again by splitting it over multiple lines so you don't have to write everything in
43:42
one line even that one that we have here with the for and the if sometimes you would say 80 quotes list of i then next line for i in range 10 next line if not so you can write this line
44:01
you can put this statement on the right and then put the other statement on the other one, so it's over three lines and you see that the first one will be making iterations and the second one will make a comparison to know what it is. So when you are used to it you spot it much easier than doing here in some way
44:21
again again we need to create something that is used over time and when you see a lot of them in here it seems more natural but in other words you have to know the language so maybe that seems more natural right away
44:40
how many? i are different from three yeah you want to send this person to a condition so if not in the right hand i just run so
45:00
so so you can ask and then your if statement is like if you were writing your own if inside object so it's inside so you can absolutely get the full view of the right one general
45:21
remark regarding readability so for this conventions the way you set them if you keep them in one line across multiple lines always depends on the complexity of the whole thing and where the complexity actually is in the statement so sometimes the
45:42
items that you collect in the list have a very complex expression in that case they would probably merit their own line and you would have the four in the next line so if you are not collecting i's but items is something you can function for something so very complex expression here
46:02
then that would be its own line and then next time you would say four items in the right hand cause the idea of the statement this one is really like you get so the splitting is kind of i think when you get used to it
46:21
it's like setting that which is similar to that it's by seeing how people do it in that sense and some way that starts you already want so now we just delete the list
46:41
and how you would do that so you remember that you have the dictionary and the dictionary was something that somehow the key and the value and that you were given key 1
47:05
value 1 key 2 value 2 so we saw that the list you can put square brackets and numbers on the side and for the dictionary
47:20
we are doing it in that way there is a way of creating the dictionary in the same way i'd like to do this as an example here maybe try doing two or three minutes in what you would write try to do the same similar thing down here
47:40
and try to create the dictionary for instance with with the months so you have a list with the months as a string, the months as an index and then you want to write so that you can write the form with i's so we can add this and then you will try to create the dictionary
48:02
in that way so just here you saw the list with the square brackets the dictionary is a really curly bracket and now you can actually do the sense and the dictionary that you have the key and the value so you can find it in two minutes try to make the dictionary complex the dictionary complex
48:23
so now you can actually start it
48:51
the idea is to create the dictionary with this as the key and this as the value and you try to find that doing a one line convention dictionary
49:01
and try to see how you will do that first
50:16
when you try to execute something in Greece, when you start a new search
50:21
you will get the solution maybe no? already? you try the syntax
50:46
as for the list we start with the syntax which is kind of dictionary-wise so we know that how we should have the curly brackets then what we know is that here
51:01
you get each element what makes sense is you get every element so what we can create we have at some point the month string month index x and we want to look over that
51:23
so for x because we are working with the dictionary for the key because I want to use the key and for the index whatever so when we do that we look over and take a look at the two elements
51:41
and find them in the key dictionary and we saw before that we already created the key and the value so somehow why not use the solution somehow that makes sense to you to try to use the other key and I got an index
52:01
that worked with the key and the value and in some way it seems natural but the first time I had to do it so in that way it's taking two values and iterating the dictionary
52:21
so the same way that you create the list, you have a way to create the text, you have a way to create the dictionary each of them are maybe stuck that depends on the interpretations but you can do it in that way does it cook? or do you have any question about
52:40
the last few instances? yep so you can also do for a set but it seems that this is the same then for the list I will pass I will just do it for you
53:02
so the same way what is tricky is that the set and the dictionary are actually curly brackets so what makes the difference is that here we have a key and we have a value the set to just have the values inside so if I do that
53:22
and I check the time that's the set if I put a key and a value it can be a dictionary so that means that a method is a key value so go back to your set
53:41
okay that's about sorting sorting dictionary so usually when you print them you shouldn't be ordered in Python are you using Python or are you using
54:01
Python or Python so the only thing that you want to do in Python is to type I mean actually you want to use the order you think that when you use keys
54:23
you should type what I have here it will be generated very much and you will create it doesn't have to be when you print them it doesn't have to be activated and when you type Python, Python will use people's life values in order when you think
54:40
Python is when you print it it re-orders the key and it will be generated and if I'm not wrong in Python 6 now it is re-ordered and Python doesn't do it Python doesn't do it because Python doesn't
55:01
the dictionary shouldn't are not ordered it's like the same they are not ordered so the dictionary is set so for the sense the way to create is set so in this one you can do the same way that
55:24
you can do the ORs in branch ok that is we create second branches with numbers inside in some way usually you want maybe to repeat
55:41
write a set of already known things write the other way instead of trying to create a lot of numbers and you want to use branches whatever you can have you can do it it's known as the the most known is the disconversion
56:02
so that is the support for this one so after all we can go in definitions and functions ok so in this
56:20
so after all any question about whatever we saw in the second part here or it seems to be over here or just let them run oh it's fine ok so the first the third approach is about creating the functions returning values and we only need that
56:41
so here is again to show what is the item so to create a function you just have to use that name of the functions the parameters that you want to assign then I need that
57:00
you have to need that things like what's the form say that volume and functions and then you can start so based on here I would like x so this what I did is that I just write the function which is doing this so now I can call it
57:20
if I look over here and write something it will be to get the word that's great the thing that you really want to do if you want to do some work and then you give it back
57:40
to like the another version so what you would like is instance name use a written statement so in this case define make a double just a variable
58:02
from here to my class x but what I interesting is to double or somewhere so it means that each type of thing is inside so now for that
58:20
one has to be defined you can make numbers and here you just pass an integer and then just pass and you see that it's like really two structures because it is not a type so it takes so that this is important for you to write the computations you can explain something as input
58:42
seeing that the item is not the item maybe it can work whatever you need but it doesn't work so I would be interested to see maybe now usually what we do when we make this is that the human has so much more in the data
59:03
and to make the computations you write the computations using three of those and then you would start to write a small description to make sense
59:25
of the input then you can have a long description so it's not a standard it's a standard
59:40
it's a non-binary so you create that which is very short so you have more space than only one so you can make long descriptions here and eventually what you do is that you will
01:00:00
explain what are the input parameters of your functions. So in that case, my function was x. And I already mentioned the type, which I explained later. So I expected it. But you see, it's only in the documentation. So it doesn't mean that you cannot pass the string.
01:00:22
Let me just tell you, this is what we're doing. So you really state x, and then you the descriptions of x. And also, it is common that you state when the function is returning, for instance, like a pattern, which will be a need.
01:00:44
Of course, I'm telling you. And otherwise, it's okay. It's all right. So that might not be appropriate. It's not easy. So, yeah. Don't use that one, because that one is also the third type.
01:01:01
And it's especially important to speak. But I'm doing fast. So use proper words. Not like me. And then to finish the last thing, what you do is that you finish by these three things. So I actually am doing two of them. And this is possible if you are a nice leader, and not quite on the concept. It will be nicely rounded, like the implementations
01:01:20
in green or in the other colors, or as you know, like that in the limitations. And I will show you after that why it is useful. So let me just put it here.
01:01:46
So it's another function. What are you using? You get a short line, a more detailed one, the parameters, the return statements, and then what my function is actually doing. And the nice thing of it is that if you do now,
01:02:04
my function here was called Frank. So if I do L for Frank, whatever I wrote there is what is written when you type L. So it means that somehow your function must have saw an object where you have
01:02:23
forgotten attributes which store these things. So whenever you put some of the implementations, this is stored with the functions. So whenever you need it, you will be aware of it. People can write the implementation, because people can say it comes from the Python command line or whatever.
01:02:41
And then when you implement it, you know that those are important. So that's how you make the implementation. So I found the time, but I think that is important. Michael was mentioning that there are different ways to spell out the parameters, for example.
01:03:01
So there are different formats, how you write it. Here, I said that I was using non-parameter. So if you can check, you have the Google world doing it, which I know is non-parameter. That's why I did this one. But then you have different world, how you will organize the parameters.
01:03:20
So what we did now is enable the parameters to point to the time. And so always, you put something like you say, parameter, and then you spread the parameters and add the new one, or the Python one.
01:03:40
And we have different way of doing those. Because then when you make automated implementations, the one has two different rules. I mean, you need a movie that's integrated to make it make good predictions. That's what you have to be kind of like. So the important thing is that you are, when you program these people, you
01:04:00
should be all the same, the same way. OK? And use the same things. I've already done quite a lot, because I made it really well, but it's just personal. I'm really impressed with what you did. OK, so we saw that when we do these things, that makes it double. And so that actually you can, nothing is against you.
01:04:26
So you can put an integer, but it will work also for a string. Or sometimes. And nothing is forbidden to do it.
01:04:42
OK? So it's not important. OK? I want to change the existing function. How can I go back to it in i Python? In i Python, arrow. Yeah, but then I always get one line.
01:05:00
How can I get into the function? Not in i Python. If you go up, now I am up. So if you are in i Python, you can go in Python. You can say the Python concept. So for instance, here I could, in i Python. If I inside the Python, I have only one line.
01:05:21
Or why maybe it's all version of i Python? I think that's the reason why it's there. But that's why you should always use i Python, not in this list. But because you have more tools. Because usually you run inside an integer. So you don't have to do that. So now what I want is that try to call megabytes
01:05:43
without anything inside. So let's call the function. Okay, so like that. And our first one is trying to get into these things.
01:06:00
It tells you, okay, you miss parameters. And what will it tell you? Which one? It's called x. So this is easy. Because maybe we want it to know by default, like we want it to double some numbers. So it's what is required with different values. And so I could define my function
01:06:24
such that x will be by default 10. Like this. When you tell me, you don't tell me what it should be, it will be this number. So return x times 2.
01:06:44
And if I place, it will be 20. That's good. So like this, you can have some different parameters. So now I have a process. So what I will ask you to do is to create a big X value.
01:07:03
Put an integer inside. Then you will define the functions which take x is equal to big X as arguments. Make something with it. So take the dollar, for instance. And then you will try to do that again. Say that big X is equal to another number.
01:07:20
And try to call this function with the different parameters. And try to understand what the code shines against. I mean, if you try to do those steps, what to obtain at the end.
01:08:05
First thing that I want is to affect big X. And now I want to create a function with different parameters. So let's go for that one. And X will be equal to big X. So by default, I expect that it will be big X.
01:08:24
And then I will return to make that's how to do it. X times two. So now if I make the dollar,
01:08:42
the thing is becoming 20. Which is the dollar. So maybe what I want is to now change the different parameters. And I want that this is only. So like this one I will make the dollars. I pay that to the product. The brain is that this is still 20.
01:09:04
Because why do you make this time? The first thing that you call is you define this function with this big X. And you use the big X that you just did before. But if you want that this is updated, you need to recall this function. Otherwise, you just update this variable.
01:09:21
So you put a new thing inside especially then because of the functions. So that's not true. So you have to be careful in which order this happens. So if you need, here you need to redefine this. And in that case.
01:09:50
So this is something we have to watch out for. The second concept is the number one. I have a question. I'm going to draw it.
01:10:04
Because you already, somehow you start, you start the stage and the stage before. So now you do an operation of big X but you see that you're using
01:10:21
supreme states when you're different. So now if I rerun my function with big X, then I expect that I'll be different than the other. So I can just say redefine it. That way. And now that we're
01:10:42
working with the first one. So let's say big X is not an integer but a huge data bank. It looks stored somewhere in my render. So you can think of default arguments as kind of an assignment at the time where you define the function.
01:11:02
Before it defines, the default argument is defined at that point and kept together with the function itself. So there is no way of deleting that. So if I want to keep that function, I want to get rid of whatever I put there as default. I can't do that. Because you don't want to have
01:11:21
default in that case. The default is null and then the first time I throw you, I pass through this. Or I let it load it somewhere. But you don't want one issue because the default is usually in it. Or that the default is usually in it. Normally the default argument is a bit different.
01:11:41
The most common default argument is actually null. And you will see why this is important in the second culture. So the second one is so that you can have mutable and immutable parameters.
01:12:01
So one other culture is that if you pass as a default something which is mutable, which that can have. So for instance, let's create the functions to which they can iterate. So add this.
01:12:30
And the default value I want is to add a and to add...
01:12:45
So that's my argument. Well that's fine for me. It's fine too because I called cookie for cookie too.
01:13:02
Okay. Thanks. And now I want to use I want to use I want to use I want to use I want to use I want to use You probably want to use two as an integer and not two as a string.
01:13:22
So both should be right. So now what we do is
01:13:40
I first want to change and then add this one and then we want to return this part.
01:14:00
Okay? So the way it is now is that if I call this function with no argument what I expect is that when I call I will get a is equal to b is equal to three. Okay? Because I want my default that my default is sharing and then I will just add Okay. That's great.
01:14:22
This is working. The point is that if I read it in the end it's still increasing the values. Okay? Because seeing that my default every time the thing that I am doing
01:14:40
has been changed in text and I just keep going and increasing it. So as an argument you can never pass the default parameters the default parameters which is the default because you will change it inside afterwards if you use the default So one way of doing
01:15:03
is actually to use none I know if it's the way that and then you can check that if the part is none
01:15:21
and then you can return the value that you want
01:15:56
Okay. So like this in my case every time that
01:16:01
I will check, so first I will check here if it's none then I will return this one and this one will never change because every time I will just return these things Okay? So you can check afterwards. So one way to control the default if you want to use the default argument is to add it inside
01:16:26
And that's actually the default Can you just? No, sorry. Can you go back to the example No, that one. Yes, right there the function. That's actually the more common way to do it because what you see is, so the difference is you have to
01:16:41
return some value there and what you're doing there is you say if I actually receive the default argument meaning if I did not receive from my folder then I use this value there, this dictionary there and my arts building so it's signed to arts and then you continue and you function with all
01:17:03
the, I mean there I just return something like double my dictionary but literally what you get is that you fix the argument and then the coin of the function, so for instance here, this is what makes double it. So the coin of the function is always the same and it's always executed The only thing that you do is that you assign
01:17:21
a default argument inside the functions if it's not a default argument so I need to shorten before but the proper way is usually going this way it's a very common pattern yeah, that's what you'll see a lot What kind of arts can I pass to this function now?
01:17:40
How does it function or what arguments I can pass to it? I mean it depends on the implementation of what the function is doing so you can pass anything right here we say add to this so somehow you should pass a date because we add something to the dictionary so it's quite similar if you want, when it's not inside the documentations
01:18:01
what you should pass and what would be the default I don't have the internet I don't have the internet but if you use machine learning recycling term so you will see that some parameters when you pass an update that are not the default you pass a note and it's the same note, but if you change the
01:18:23
the default will be this type of classifier and it will be created inside the functions and it will use this, but if you check the string, the argument is equal to not because the classifier itself is a mutable object so you will see this pattern there it will go inside the documentations
01:18:43
from what I know this is how it's done so then you expand parameters so now that you can add parameters
01:19:01
which are the dates which you absolutely have to give the values and some that you already have the default values and why is it useful is because for instance you can get this function here so max I import the square roots and I can define a function which will take x
01:19:22
x, y, z and I say this is I want to compute the distance between the points and what I have here is the y of the point a of the first point and this is the y of the second point and this is the point 1 and point 2
01:19:42
and this is the x and y and this is the x and y and the idea is that I won't confuse the the distance so the distance in that way you take the first part of the
01:20:01
difference minus the second part of the difference x is the right strength so let's make this
01:20:29
so now if I need to to understand this because z has the parameters here I can I don't have to specify it
01:20:40
it can be repeated by 0 and then we have only x and y but maybe you are interested to actually call x in this value and z and you don't want to specify this one so a way that you can do that is one way is to do 0
01:21:01
or another way is to by name you can specify the name of the variable and then you can specify the value so like this x will be defined as this one and y because y was at some difference but in this you know that
01:21:22
I put two things here but this one will not go inside so y is not going in z because I specified it even if you pass the three the three of them I personally write x equal to this y equal to that and that's equal to the other thing so like this gets documented on the same part
01:21:41
absolutely so having the name of the this is very good apart of there is some function that you know that anyway but at least it tells you what argument you are pressing and this is more clear and it's three cases where it has a flag variable
01:22:01
so it has the call function and it has true so there is entirely unclear what this true is doing and then what I always do is I write argument name equals true so that you can see what option is being passed in there and what does it mean and we are going to the .q query
01:22:21
I have already a first look of what this thing is doing so I'm rerouting as a test then so we saw that we can have several arguments we face and there were arguments we bought I mean where was the q word and in Python we have something
01:22:41
which you can uh but all the arguments which are positionals like this means star arts and all the arguments which we put later with the labels will be fact inside the condition which is q word arts ok, so if I just give an example if I take this
01:23:01
variable art here I can check that the first art, which is this line and we pick only the value of what has been star art so it's a pattern with the name of the variable
01:23:20
and then the lower one where q word, it means that we put the name and the labels and this would be written as a dictionary where we have the key that corresponds to the name of the variables and the value that corresponds to the value of variables so in some way that could be useful you have probably can be complicated
01:23:42
but this is useful when for instance, here I show that I have points which was x, y, z which means that I want to compute these points in four dimensions or in five dimensions or in six dimensions I could use a few other elements and you pass me the number of points that you want and then I will do over the q word
01:24:02
and let's compute the distance so let's complete an example because we have only five minutes solutions so I was saying to recompute the
01:24:22
distance function using this so if you check here what I'm doing is that I'm checking the arguments here and I'm making the sum of taking each argument in arms to compute the differences
01:24:41
and the square the square and then I also want the q word values and just taking the value of it and making the same operations and making everything the sums and then taking the square root so like this what you are going to do is to get
01:25:04
any value that you want so x, y, z and then after z is a and you get something like that and it's still working and you can add as much points that you want so the q word value for this flexibility but you have to be careful
01:25:21
because you need somehow the documentation could be up so if you don't implement it people don't know what you are inside also another thing is that when you establish in the arts you establish in the arts, you cannot say something like x equal to ten five, then say nothing and then zeta equals two once you start putting the
01:25:42
the keywords, you have to oh, ok, so what you cannot do that exactly, because what compares is position words and they are the position and they mean something whatever comes afterwards, they have the name
01:26:00
and something and if I put, I put it on top and the one of the words is linked to nothing so it's considered as a keyword and not as an art so all the art at the beginning of the functions and the keyword comes afterwards and the keyword is defined as the name of the word equals something
01:26:22
ok so if you try to run this it will tell you something position or argument or else keyword or argument exactly, well, you put an argument after the keywords ok, so so so yeah, last example
01:26:44
and then last time we almost mentioned it in some way let's see so I discuss in fact which is here
01:27:04
and somehow we find a, b and c so a will be an integer which is immutable and then there are two lists where they are immutable and we pass those to a function and then we so x will be
01:27:22
10 to 3 we append a new value inside the list and we change the list itself to 99 and then we print the value of the result one inside the function and then we write the function here and we print the initial values and see if
01:27:41
they are being modified or not ok, and if you run that we obtain that, so it shows that we check the numbers 23 here, which have been affected here it didn't change the value of the original value of a
01:28:01
so we change x inside, but it didn't change a and then for a mutable one so for instance this list where we append it a new value inside so which is this one you have to be careful because
01:28:20
when you get outside the original b values have been changed so when you pass an argument to a function that you do something on it be careful because if you pass a mutable argument it will be changed ok, so that's the takeaway of what's happening in the function why? If you pass a mutable argument
01:28:41
it will not change it ok, so if, don't, be sure that when you want to pass an argument that you change it, it's because you really want or that you want to change a mutable argument and you need to know what you are doing, ok so the big thing is that when is the mutable that you change inside the
01:29:01
functions, if you not change the one that was passed outside otherwise if it's a mutable then I think that's a lot of talk because I will finish quickly this one but global argument never uses but in case I finish
01:29:23
you can do that so I think this here so for instance you define x outside and then set x to a y you can define when you write global x, you say that you will use the x that was
01:29:40
defined outside and you will change this one ok, so then here I make an assignment and you will see that when I set x the x that was outside was changed and if you don't do that the question is the x was not changed afterwards, ok
01:30:02
but I'm not sure that you should use global whenever you can the log stream already saw it and the function has objects, I already mentioned it when we use it like for instance the log stream that actually you have
01:30:21
you put inside the object instead of the dimensions, so it's the type of thing like it's a functional object that's the function ok you see that five movements if you want or something like that
01:30:41
where you have the most so we should be able to read the same cards and how to implement modules and create modules input outputs is how to read a file and
01:31:01
saving to a file and those type of things so it's reading open and those things it's not really complicated and it wasn't like for me to read about it so you can read it and it's easy to understand and then I would like to go through that in a very interesting way
01:31:21
there is a standard library Python doesn't come only with form, code and those type of things we already saw that you have to get those constants and it comes with a bunch of standard library when it's in Python we have them with you and you have a lot of stuff
01:31:42
inside which are useful so we have OS that allows you to manage path, for instance in the face of the path or in the input when you make a test where you know those things you have stuff that allows you to search some
01:32:02
items in the world or to try to find some specific files you know that and those type of things so if you search for some library you would have a bunch of things that are really useful when you are in Python to learn when you are in Python without the need of being in the third party
01:32:20
or even through the week usually when you want to have a new feature you check and it's already in Python so always check this program and remember what you have inside you can actually go through the notebooks and they have a problem during this week or something we are around otherwise they can open an issue
01:32:42
so you can go to the notebook alongside your sci-fi tutorial page so yes you can go to from there so whatever you need thank you
Recommendations
Series of 43 media
Series of 9 media