Merken

Kung Fu at Dawn with Itertools

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
and this presentation is be that the on his side in reliability engineering and delivers and there's a good them and we that I did want and
this is not conform but it was super so I have use will make up for it later also have a lot of things to see if any of you disagrees breeding is going to happen and and will not how we
look over at at least in my right we're told these all the time we have to say for thinking in whatever I do think for example here we're looking over at the end and we are always told that's where they're doing these which we might be tempted to do when we come from other languages we say OK I'm going to generate all the indexes and I'm going to do stuff with the indexes accessing each 1 of the elements and even more so there was no we don't want to do this like even instead of using a range we could tried to increase the value of the index i have we don't do this so we know we have to use what I found for words which another language at this age for each and we know it that it that's going to give us a higher abstraction level which means we call this more readable leads to Europe so we like we have to think about what's going on we say OK move over these whatever it is that it works it's nice out so it's safer and this is important because we are not working with index of 1 how the think that's amiable like we just have to do that for example if we tried to work with index and how it could this is a off whenever forgot we we want the far and we tried to access the end of the last element it's not there when we use that for each state i from 4 this is not something that can happen and of course it's the only and were replaced we can use it for example with strings for each player the in the spring of whether it's the name of the variable we can access each 1 of the characters in the string we using sex we can look over the young although we don't know the order in which we are going to see that we can look over dictionaries for example here using items we can get the get the key and the value of each mappings and even with files we open the file and then we use the word lower over the final descriptor and we can move over each 1 of life and that's the when in the end we can use loop with anything that's itself and that's ended up we take it for granted not question what some it when we go to the box it turns out all the answers that are not only started flowing into the box and and it says OK only to not get capable of turning 1 element at a time blah-blah-blah what it means our class has to implement a methyl there down there or also get item focus on the 1st so OK we have to implement during these my method what what's this 1 this book on it says OK this method is going to be called when we need and and if so it should return and iterate OK so we know what we know we need to implement ITER and make it returning it so 1st of you at some point we will call either of the building and we will get the iterative it's so if we have list of numbers for example we can say OK agreement and on the right there on this it's there it's a mass of the least of and if we call it the bill and get the interior door yes it's not least iterator so the blind but now what's an intuitive Will it turns out that an iterator is something that conforms to the probably which means you have to implement 2 different so you the 1st employment title again and you have to return silver which makes sense but 1st it some look like but you have to do that thing so this is remember we're writing we are writing our own iterator and adults are right it makes sense in that case you can use the greater with the forward we face for an animal and states in which in a way we don't care we will build this we can follow instructions and then we have to implement and all the management of women next and next to the return the next element and when there are no limits left which should raise iteration I don't know what the 2nd sentence means it's something low-level and this was next thing thanks to knowledge of the 2 and so now can finally our can't see all work inter-rater and we are in in over a place set up in series of elements as the ITER is which which trying so OK and next is going to return the next element once we are no more elements we went far with index we're going to raise stop iteration date with it and we can see the ones that are in the world so I have stopped iteration now something important we noticed that when we work with it the way the next person to return the next 1 in but we can only use the next iterate so so if we try to call next directly only at least it's not going to work so to say OK no it's not an intuitive depending on the so we have to call it 1st eta and then we get the integrator and then we can call next as many times as we want until we hit this stop iteration iteration which means no more elements life and that's exactly what the for is going on with it's called it's using ITER it's getting and right there and then it stops going next forever and you it sees stop iteration so if we want to implement for a loop in pure Python for no reasonable we will have to something like that and that's basically what in low-level actual useful goes it's happening in the class who room not something nice we said OK you enjoyed on these monster there we wrote that racist iteration it has in the past 2 ways it's with an exception when there are no elements like but we haven't seen any exception when we work with my family for over we look over something we're to stay in section why because the for is actually listening for these stop iteration and that's sick and it is is to stop processing so it's actually going to be expecting a stop iteration in the in 1 of the next calls and when that happens it breaks now during nanoreactors area are a special type of Italy so that we all know how a normal function works we start in the function we do stuff and then at some point within each and we return from and the that's all use but sometimes we can think about it whatever we have to return from from our function has to be done once for example here we have things to simple function and it's it has a single exit point so we do something 1st line 2nd line and then we return a value we can have multiple single points this is 1 1 we can read from the functions in the in the 1st return used in a 2nd but once we hit 1 of the terms we haven't finished and we will never be if a function doesn't have the term that's a please not so actually functions are always return is something we don't say return something it's returning of known now how is that problem well it's not that for example to we want to work with a using numbers and what we want get even function with that that's going to give us a of it is numbers until the 1st meeting with right we the right the simple act the way orbit Python way using right which we passed clearly and it works with that could become a problem at some point we want to work with a lot of numbers because this function we said OK we have to return everything using time so if I want to some millions and millions those outside of the save numbers we can't do that because that's something defeating into so that's what we use generators we just generate our functions that are able to return values want which me is the state of the function is frozen and we wouldn't use which will used you and when we get to a deal that we return value and function phrases there until we call the following next 1 over over that's so in basically we will have 1 or more jails finds itself going to be normal function it's
going to be generator function and it's going to be it's going to we're trying to do it in a way which for short referred to us generate my so for example here simple generator using to using G which means we can call it up to to 3 times and it's going it's going to return value is only 1 of the last time there anonymous left so it's going to return as old iterator iterates iterations so in this case we say OK we want which all natural numbers OK I'm going to say that I'm going to do this I have found and was look it's it's never going to work but they don't care because only returning elements 1 1 in this way would keep calling these generators all the time and we the normal function during to try that if you try to find these people and can process because it's never going to work we can never return all natural numbers as far as I know what I mean so here we are I wasn't paying attention iterator object on which we call next that's similar thing we can and every generator is an iterator but not vice versa also and this is something greater Alex Martelli what it was before everything you can generator with the with with own an iterative class but generate also give you a basic framework basically all the states the people in the in state is already done for you frameworks there so if it's a single most of the time even for simple cases we can use a simple generated for extra points how how we measure a generator and we call when no attempt is we will we are generated numbers when they want so if we go away and it's going to say that there can we could call it would cost capacity to Italy's and then we could call and what's the parliament will listen for women to be knowing all the list in memory and then we can use so we can say OK I'm going to add a lot numbers 1 for each element in the generated so we have to to solve the director and in that way we can come to an end before estimation we use and restore a C away throwaway variable the signal we don't care about the actual money way time for some 5 minutes left I would want that were both is not inside and we have what we do have water stabilize thinking and the prime numbers and numbers and the way how we determine how you determine the fate a number is prime there are a lot of actually ways really mathematical ways but I like the that I'm going to do it by hand I want to try all possible member because prime number only have all have was only going to have to be the source but to and it's 1 itself OK I'm going to try all the other members and if there is at least 1 device or you're not try and otherwise you are applying so I'm going to do it this way it works now we know have to do that really and in the end we need independently said no no no you use right the right we can look elegantly over all the candidate might missing mandatory optimization although it's not strictly related to what we're seeing here we can we only have to check devices of the square there are a lot of groups I didn't understand them actually a really bad 600 flow again there was approved for humans there but basically assessed every non prime number will have any device noise on the square root for so OK that's a lot of don't pronounce so now you did your how how can we use of something remotely In the year factorization so the composing number into factors so for example in is 2 times 2 times 2 and symbols method again the trial division which means that we are going to try all the prime numbers and we are going to look at sissy OK can by number of ideas so did write my solution here I said OK I want what I want to get the 1st n prime numbers move come to it OK I'm going to be only in interlaced and I'm going to keep trying numbers and and the number of prime ideals then I put it the list and finally I will try it work again problem we're returning all the prime numbers and so on OK we're here so let's use the generator and in a way we the same that we don't use these memory in which we can get we can return the prime numbers we joined but now we are going to different things here and that's how cold can right because we are we are keeping track of how many numbers we have generated so far and what's the next number have to among books books and that's due to this kind because we are in the other people's pockets identical super simple keep it going it's going to make an iterator the returns number and the default we are going to come from 0 and default that these 1 In other words it's like range but we know actually we can call it keeps calling keep calling forever for example here OK next next next and we will get number and how is is usable well we can at least simplify are code a little later we can say OK for a number in it Interpol's count and that's never going to stop but still willing to think we're generating prime numbers and the same time we counting how many have generated so far so I'm going to do something OK I'm want to display in 2 different things 1st a generator of power prime numbers and then a function get crimes which is going to be seeing all the generator and it's going to say OK how many have returned so far these many OK example but we have not we stopped the but we can make it even better again we have written a function there for did before we can use a simple generate expression for probably maybe even better in this case we can say OK OK filter I'm going to feel all the numbers starting from 2 I mean going to take only is prime because that's what fields were going to the field was going to lazily 1 by 1 it's going to check the numbers everything we next and it's going to return the next thing that this condition filter by the way was heightened tools I feel there before but again that all history get priced now becomes this thing OK and counter and have released primes because then prime is going to be a it's going to be away from the friends I want and we don't count on when you about comment this thing is a common problem actually give me the 1st n elements of these intervals and it turns out we can use slice impatient because it's going to complain excellence when the signal generator it's not a subscript which makes sense because you're generating millions wondering what you're doing that horrible Lexus randomly on you can do that but you can use it to to a kind of tools is life which is basically like slice of patient about doing lastly we all frames which so for example if we have item pools counts which means all the numbers in the world and we say OK intervals is like as 5 take 5 it's only going to address the 1st 5 and then stops but we can use it not only with generators we can use it with for example with a brain and we are going to the 1st 3 letters or we can and the 1 that's usually can use steps for the while or we can start counting up from 0 from all right so if we want the 1st and the numbers we can say OK intervals is sliced crimes and as many numbers as many so let's with right or function now we have a k I have all the on going to loop over these thing is slices returning an angel and then and now that's OK we're being over the right and the only thing we do is given that's what you from was invented from from has what we it allows us to always have that the important part it allows allows us to delegate power of the work to a different generate change every time we call the next June found is going to last the 2nd generator OK in try next year in your value and it's going to return it so it's basically the same thing as we were doing before it's the same thing as doing for anything thing deal that thing we can do it with in a 2nd language you from so
here found using deal from food which means we're simply calling internal food and returning the on
so it's called found goes to fill and food yields an element and deals state into turn and it works I
can not only with generators we can assume that we've anything that's internal for example here are dealing from a string the given novels so we can rewrite our function as states we're simply OK we're taking the waste of primes and we're taking how many of the same name and it works for example in this case far and it works 18 minutes so far and I have not
answered the question we're actually we're not going to name these women want to give the 1st as prime numbers we want to get a series of prime numbers up to the square root that's what we said we have so not so we have to actually generate generator set up to a value that's the threshold within within the harmony with all the maximum value so that's OK I'm going to do it the naive way I'm going to have these crimes and dual function and I'm going to move over the primes at some point out some point I'm going to heat the limit and then it will stop if the value is less than the 1st hole and we'll deal with and it turns out this is also a common pattern these thing about were looping and the waves condition is no longer satisfied and that's take while I tools pick while is going to make a new territory that's going to return elements and it's going to stop when the conditions and all took that's usually seen with one function but it's not mandatory so for example here we we say OK you have numbers which is a lot numbers and I want to take numbers in wild land that x X slaves and 4 so I want to pick a number so as long as they are less than 4 so the 1st time we call next on the iterators it's going to say OK I got 1 because it's the 1st element is 1 is for we have so ideally they return their which I'm sorry the same thing isn't happening with 3 with the 2 with but not with 4 because Florida willing to this it is no longer going to satisfy satisfy the conditions so so it's going to stop iteration because there are no elements left again we don't have to use 1 functions if we have a function here which happens to be smaller than 10 we can say OK take while where the predicate the condition is this function and we're going to evolving it's for value so our crucial version of all the thing we needed is that I am dealing from take while where take while what's the conditioned OK that we are not sit there we happen the the threshold and what about the opposite we have it's dropped why don't why what's going to make an iterator returning again elements but it's and it's going to ignore all the elements that make it a condition true at some point the condition is not going to the true anymore and then we start up to the end and your returning elements so for example the period noring numbers as long as as they less than 4 so the 1st thing we call next what's the what's the dog while going it's like this 1 but 1 is not less than 4 so you drop the same thing with 2 same thing with rate at some point we wait for forests not less than 4 so we have to return and then we go off on the deal the range is over so my move things we can write this kid function to get a prime numbers within a range we can use to take while we that's going to return iterator and we can feed it we can pass it along to drop while and in that way we can generate we can generate all the prime numbers between start and stop and the so and we could specify different values of course and manifold we will generate everything from 2 to infinite but with could the specified all the values how is this useful well that was finally 1 of these things we have the algorithm for integer causation and we don't really care that we lines over we have to a little over all the prime numbers for each frame number we try to divide the number of the prime number is weak and divided the prime number is a factor we save it and we keep doing it recursively so military where we have a 3rd these 30 visible light to a case so is a factor and what's the quotient 15 so we start it recursively with 15 then we start with the a British 1st by memory it's not that is all we move on to the next and so on eventually we reach the base case if the and we will be over so here we are using primes and our mood function using it tools on his her and we can change by every time we find a factor we create new ways and we comparing it to the we got a call and well and we can see that it works not that we are actually going to using production of its now the unique common sometimes we have used UNIX command realistic flow tells us the use of its and you copy-and-paste without knowing what you're doing of In the servers and need is going to remove duplicate elements in summary included but only if they are together which means when you are starting and you go to I receive free no then you ask how do we remove duplicate lines in a file the tell you can sort and then divided to make all of these things sort that you right now OK and I want to write it myself when not so let's say we only work with strength so I have to do something like this I have to say OK I'm going to go over all the rewards this training and went to keep track of the result and everything is Senior later I have to say OK I reviewed the frame and the last thing I saw a it's defined I have a beef it's not ignore it so we'll have to do it there faster ways to save and simple way to do it and eventually returned recently result OK here we can say goodbye goodbye supercooled but it's also ha 1st I try struggled to find examples of made sense but this is the best advice so you have music and revise is going to group elements and that is going to make any joint or that's going to return every time we call next it's going to return it to come to hold the key and were and what the group well the root so in this part we when the value of the key changes the group objects themselves are each other things so here we have the string with repeating elements we say OK only what's groups and it tells you OK it's a goodbye thank you bye as soon as I was saying OK next groups and it's going to give me OK the 1st group which is that the 1st key and 1st grade and I said OK what's a king and it's says it's a and what's groups the neutral thank you again but well it's an interval so I would say girI keep going next until something happens and it turns out that can call it 2 times and it says OK you got it you got on and then the golden stop duration and like that so I know what mean as this is 1 of these cases where the box of improved a lot the old are hard to newcomers thank you and it turns out the could is what the group contains for example a and the group are the actual elements so let's go to the it's going to tell us OK Nietzsche's being because this group has a lot of the and the group itself is the because there was only 1 b and the same with the we have the case see because in this group we have what we like C and the group is the same because we have 3 things and this is right How could we used used to something used well for example here we can write it would find it looked for made it simpler this way we can say OK print became and the work and we can say OK 1st we solve a will that's a and you have to its so maybe I would say we have 3 OK that's useful because for example here we wanted to remove duplicate elements if they are together we can say OK I'm going to group by all the elements and every time a need a unified I find a new work I'm going to take the case I don't care about a group of
because I I want to remove duplicate elements so basically each key of each group is going to mark the beginning of a new set of distinct Carter and we can do it like that for reasoning for using a simple way something else the same column interview questions to combine the line a lot I want a compression algorithm I am going to take a string and then going to use the count so if I have 3 days I'm going to replace it with 3 how do we do it well if you don't know all the power of either tools generalized pain misery and politics and lost special because you don't you our support of your interview to come up with something like that you have to keep track of what the current through what's the number of times saying this last thing every 10 years start seeing in Europe you have to restore the contour you have not to forget that eventually you're going to exit the force that you still have something else in your hands so you have to obtain a demand good it turns out you can use tools and you can say OK I'm going to group elements and everything is fine in Europe and in the case of how many times have what's account OK I will account the groups how many elements wondering if think you do that you change to and the count of elements it's within the group and the compression algorithm now keep a elements in the group a that's still strengths and that's because by default by is using the quality so a is equal to A. because it is equal to the silicon right but it turns out the same way we sort for sorting we can use the key function with the beginning group by and we can say OK let's transform which element for we compare it and that's known as the p value for each element how is this useful OK I want to reply to respire when I want to say OK I have a serious series of water and they want Lewin grade to go together because they have all 4 elements save me and you know all of this is there we consider obtained when using hash table the extent of my talk is going to be default OK for each lettering went to count on refinements and I'm going to do that kinda dictionary and and I'm going to attend work OK but we can also lead the group it and say OK I'm going to sort the new ways life and key and I'm going to group all the on each group is a really going to have all the levels of like we could argue of a lot being willing to do that whether this the previous question was better and probably the only faster I will argue that this is clearer because it's basically itself meaning it's working things by a criterion in this case like Italy now my favorite mathematics run away and we have this function that I found online and we can use a known time to move build a polynomial that's sold mathematics and know and we can evaluate it we can call the function and well things but here I have to keep going it looks like this OK it's something I am going to say it's time versus really really important and we are of war and we're monitoring this thing and I have in supercooled payment trying to this and we spend we and 1 single 1 so we said OK how do we do this Have we wanted to read l and we have to add weight everybody is at some point we spend less than 3 seconds new CO and here the hand we're relaxed we know the answer right it's true because between 0 and 3 there are at least 3 seconds where we where below the threshold cyclicity let's say OK I only care at such an integer so we can evaluate only their so now the question is or if you prefer have at some point being In other words are there to Table there are there for 3 consecutive points with negative sign way the beautiful way it's like I know not the equality thing for the grouping I'm going to say OK I want to who values may whether they are negative or not and that's the key you need to OK article and 0 in this way every kind what's the key going to me well the keys intermediate key value for each element and so the cheese willing to be near the true or false which is going to say OK you were negative and not and who is going to have the actual values so if we look over if we consider the 1st group false because all the elements in this group according to these criteria are possibly so the condition is void team's falls and those are the 4 elements of the 2nd world records out it's negative that's a key and we have a list which suggests the condition was to the trigger an alarm the you can implement it without tools I would love to the something simple we want to alternate indefinitely between number between minus 1 and 1 if we are absolutely commerce how do we do it we quite a while to look and we the other thing is I got a minus 1 switch to a 1 and the other way around eligible being overseeing would be OK I'm going to multiply by minus 1 because someone told me that's going to be the opposite so it's simpler but still where probably at least the 1st front rows going to die for trying to do this because it's going to and so we have to use the pool versus and Watson pro-verse and well I was going show it to something and look right a generator ideas we can write a generator we say pairwise through that what went to it's never going to end up care because I'm going to be using the iterator assignment every time I call next winter is that next element but we have the controversy the forest this cycle cycle it's going to take an internal and it's going to return elements 1 by 1 and then it's going to start over so we're going to move endlessly over at this end of it the and this is nice we are keeping a copy of the returned elements which means if we if we were using a generator as the input the generator event was going to running out of numbers elements sorry but cycles saves a copy so we can keep using it for ever as we can see here and he was saying it generate the expression at some point it running out of staff fossil because we cycles overrated giving 1 4 9 1 4 9 all the time so if we tried to use G. again it says stop iteration you have nothing else but the cycle we find tools could still work now if we want to iterate over 2 more and more the travels how do we do it because let's say I want to go from 1 to 10 and they want to go down to 2 I'm doing that for every because I'm playing kernels based program I never going to launch my work it's uh I want to do the same thing that I want to cycle over this things over the 1st last what from 1 to 10 and then the 2nd but I visited claimed because cycle only takes 1 element and by extension how do we don't want to go over to define it so what do we do for example the want to 1 2 3 and then all the balance the this like do we have the right to different follows well we change chain is going to take all other things as input and it's going to make an iterative and is iterated consists of a single it's going to return elements from the 1st iterator events and then moved to the 2nd and so on so for example here we don't have to say OK let's change to different intervals in the 1st place and the 2nd layer and it works on an interim we can pass these along cycles more food and we're 5 minutes that's at
least slides again rolling dice if we want to rule if you don't use it as society of biases that that is to normalize it community combinations of all the women were not from high school that's because you see problem right so I'm going to do a nested for and then they tell you OK and you have 3 and you say OK well I will write the rate for a look at some point you have to generalized solution this is great hot for uh at 1st because OK how do we how do we do it well you can do it in different ways that you can use recursion in Newton's it OK for each element I'm going to combine it with all these other products create these I don't think we can prove the courts but you have a product and product is super simple product is going to make an iterator returning because he still part of all the input it so if you want to compute the product of something with itself can be used quickly so you for example here we want to roll I want to talk to them are all over the years we want to world to die we use repeated to we considered the 1st conference it's returning on those so 1 easy question is we're all for dice this commonly outcomes incoming outcomes are going to add up to 5 well simple I the use the product I am going to generate all the combinations we can and that they don't want mathematics and I'm going to feel the all the results to take all that satisfy the condition what's the condition that the sum of all these sites equals 5 and well it turns out the only 4 different visual and finally pixels with similar working with pixel and lots of them and this something we see a lot of and we have a constructor we have this in its function and we say OK row and column and the instructor is only saying OK rho equals rho con equals come and then we have the record because the mind method because we want to be able to print we see this alot but this is a perfect fit example where we can use named because named couple is these wonderful factory function in the collections model which is going to to read a new subclass of couple for which means if our class can be me and you know it's going to make our life which is still because we only have to say OK I'm going to create a new class called pixels which has 2 fields protocol and that's going to all the money on the hill and it's going to create a new class pixels and we've got object new class we can create new objects and we had we we we get all the stuff for free if we need functionality Wikinews inheritance we inherited from these class and we can have our own methods for example here the distance I want to be able to compute this and now all these was an excuse because they want to say OK I want to get all the neighbors if they have like so I want to be able to move up down left right to the 4 corners I want to get all the 1880 of like this I call I mean this intermediate level so I knew I had to use generate arraignment deals right so I'm going to do this and I'm going to deal with time and in going to return what is it they were just about until all the flights from nothing right so we can do this thing I'm going to instead of working with and audio smiling and going to use office I mean to say OK at all kinds of things going to move the 0 minus 1 or 1 in both axes so using that I can create the offsets and I can return all neighbors of course when we get a 0 and 0 as product that's the of the pixel itself where we are and where they are so we don't really have to use it we can north in all the other cases we can create the of the form so breaks for points that a class into instead of hard coding the class name there are same you pixels we can not do that and we can say OK types self have you ever seen that if I didn't itself I can CLS for example the use of any other name is going to be a new class it's so it's going to be the type of 4 class and then we can use it to to create the objects in the way that some point we remember last we have to track down these things and it works so we have covered a lot of stuff I didn't really I didn't actually believe it will be to uh it's a a lot of cool things that are very tight with France but still we have only scratch scratched the surface there are a lot of in the module enter even more important all these things but are also interested in what they are for you and all the building blocks in the tools module are inspired language like so we have been saying all right of tools is so cool when we actually we were doing functional programming so maybe it's something worth looking into if you haven't yet because that's what we were doing here and if there are any questions I will have be take pink 2 gave thank you very much without 1 meaning from 1 question yeah this I would wait so thank you very much the you see these constructs asset tradeoff between read EDTA on any grounds or something that all of you will make this is very nearly as and there's a trade-off between what between read OUT optical and with the data and so the really difficult because for some people to understand these they have to know all of these high-level constant understand what they mean and only you will understand what and here is thinking last nite about this quote about how somebody said annotation to remember the name 1 person said anything new parameter language lessons doesn't change the way to think it's worthless so these so at 1st it's surrounding the group line I agree it's a sobering communicating because what's happening here and at some point you start seeing the patterns and it turns out the spot contract constructs are having lot so I would agree that for newcomers from the outside this name them may not a lot of sense but once you change your mind set I think this is the problems that you simply find out what it's silly from framework have lines through only 2 so in some cases thank you OK thank you very
Quelle <Physik>
Punkt
Formale Sprache
Iteration
Schreiben <Datenverarbeitung>
Element <Mathematik>
Extrempunkt
Computeranimation
Übergang
Eins
Monster-Gruppe
Metropolitan area network
Datenmanagement
Gerade
Lineares Funktional
Abstraktionsebene
Gebäude <Mathematik>
Reihe
Ruhmasse
Systemaufruf
Ausnahmebehandlung
Generator <Informatik>
Verbandstheorie
Rechter Winkel
Automatische Indexierung
Garbentheorie
Ordnung <Mathematik>
Schlüsselverwaltung
Aggregatzustand
Zeichenkette
Quader
Klasse <Mathematik>
Zahlenbereich
Kombinatorische Gruppentheorie
Term
Loop
Spannweite <Stochastik>
Datentyp
Inverser Limes
Gammafunktion
Videospiel
Orbit <Mathematik>
Einfache Genauigkeit
Mailing-Liste
Elektronische Publikation
Fokalpunkt
Integral
Data Dictionary
Mapping <Computergraphik>
System F
Flächeninhalt
Wort <Informatik>
Normalvektor
Baum <Mathematik>
Punkt
Natürliche Zahl
Minimierung
Program Slicing
Formale Sprache
Gruppenkeim
Iteration
Element <Mathematik>
Zählen
Computeranimation
Metropolitan area network
Arithmetischer Ausdruck
Nichtunterscheidbarkeit
Wurzel <Mathematik>
Default
Inklusion <Mathematik>
Lineares Funktional
Primzahl
Ähnlichkeitsgeometrie
Quellcode
Teilbarkeit
Erzeugende
Generator <Informatik>
Datenfeld
Rechter Winkel
Konditionszahl
Festspeicher
Aggregatzustand
Stabilitätstheorie <Logik>
Rahmenproblem
Wasserdampftafel
Mathematisierung
Zahlenbereich
Geräusch
Framework <Informatik>
Code
Division
Loop
Spannweite <Stochastik>
Weg <Topologie>
Vererbungshierarchie
Gammafunktion
Leistung <Physik>
Schätzwert
Videospiel
Kanalkapazität
Mailing-Liste
Symboltabelle
Primideal
Datenfluss
Objekt <Kategorie>
Uniforme Struktur
Quadratzahl
Mereologie
Wort <Informatik>
Metropolitan area network
Lineares Funktional
Generator <Informatik>
Primideal
Element <Mathematik>
Baum <Mathematik>
Computeranimation
Aggregatzustand
Zeichenkette
Extrempunkt
p-Wert
Iteration
Zählen
Extrempunkt
Computeranimation
Gradient
Negative Zahl
Algorithmus
Mustersprache
Quellencodierung
Gerade
Schwellwertverfahren
Primzahl
Biprodukt
Bitrate
Ereignishorizont
Prädikat <Logik>
Menge
Forcing
Rechter Winkel
Konditionszahl
Festspeicher
Server
Cloud Computing
Ext-Funktor
Zeichenkette
Tabelle <Informatik>
Subtraktion
Wellenpaket
Wasserdampftafel
Mathematisierung
Fächer <Mathematik>
Weg <Topologie>
Spannweite <Stochastik>
Hash-Algorithmus
Maßerweiterung
Topologische Mannigfaltigkeit
Videospiel
Überlagerung <Mathematik>
Elektronische Publikation
Datenfluss
Data Dictionary
Summengleichung
Wort <Informatik>
Sigma-Algebra
Resultante
Unterring
Punkt
Hochdruck
Versionsverwaltung
Gruppenkeim
Snake <Bildverarbeitung>
Element <Mathematik>
Kernel <Informatik>
Metropolitan area network
Arithmetischer Ausdruck
Wurzel <Mathematik>
Default
Große Vereinheitlichung
Lineares Funktional
Physikalischer Effekt
Reihe
Systemaufruf
Ein-Ausgabe
Frequenz
Teilbarkeit
Verkettung <Informatik>
Ganze Zahl
Dualitätstheorie
Schlüsselverwaltung
Sichtbarkeitsverfahren
Gewicht <Mathematik>
Quader
Rahmenproblem
Wellenlehre
Stab
Zahlenbereich
Datensatz
Inverser Limes
Optimierung
Leistung <Physik>
Gammafunktion
Wald <Graphentheorie>
Mathematik
Zwei
Mailing-Liste
Primideal
Paarvergleich
Ausgleichsrechnung
Vorhersagbarkeit
Objekt <Kategorie>
System F
Quadratzahl
Differenzkern
Mereologie
Dreiecksfreier Graph
Informationssystem
Resultante
Gewichtete Summe
Punkt
Freeware
Formale Sprache
Gruppenkeim
Iteration
Element <Mathematik>
Computeranimation
Übergang
Metropolitan area network
Dämpfung
Perfekte Gruppe
Mustersprache
Maskierung <Informatik>
Gerade
Parametersystem
Lineares Funktional
Konstruktor <Informatik>
Gebäude <Mathematik>
p-Block
Bitrate
Biprodukt
Ein-Ausgabe
Rechenschieber
Arithmetisches Mittel
Generator <Informatik>
Datenfeld
Menge
Rechter Winkel
Konditionszahl
Fitnessfunktion
Telekommunikation
Web Site
Wort <Informatik>
Schaltnetz
Klasse <Mathematik>
Framework <Informatik>
Informationsmodellierung
Bildschirmmaske
Datensatz
Flächentheorie
Datentyp
Vererbungshierarchie
Passwort
Abstand
Videospiel
Pixel
Mathematik
Protokoll <Datenverarbeitungssystem>
Modul
Hill-Differentialgleichung
Office-Paket
Design by Contract
Objekt <Kategorie>
Mereologie
Faktor <Algebra>
Rekursive Funktion
Funktionale Programmiersprache

Metadaten

Formale Metadaten

Titel Kung Fu at Dawn with Itertools
Serientitel EuroPython 2016
Teil 18
Anzahl der Teile 169
Autor Terrón, Víctor
Lizenz CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
DOI 10.5446/21239
Herausgeber EuroPython
Erscheinungsjahr 2016
Sprache Englisch

Technische Metadaten

Dauer 43:27

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Víctor Terrón - Kung Fu at Dawn with Itertools The itertools module is one of the cornerstones of advanced programming in Python. This talk offers practical advice about iterator algebra that can be put into practice immediately. Discovering the itertools module means taking the veil from our eyes, and once we use functions such as repeat, takewhile, dropwhile or product, there is no return — it is impossible to come back to the world of the mere mortals, where solutions are more complex and need more memory. ----- The itertools module is one of the cornerstones of advanced programming in Python. Part of the standard library, it provides an iterator algebra that allows us to elegantly chain abstractions, enabling solutions that are both simpler and more memory efficient. The goal of this talk is to offer practical advice and clear lessons that can be immediately put into practice. Illustrating it with numerous examples, attendees will leave having assimilated at least several concepts that will improve their code undeniably and irremediably. Emphasis will be on showing specific cases where a traditional solution can be overhauled over and over with functions from the itertools module. Let’s say, for example, that we want to alternate indefinitely between two values: -1 and 1. The novice would use a variable, updating its value at each step, and the average user would maybe opt for an endless generator. Both are worthy and honorable solutions, but they pale before the mastery of the martial artist who only needs itertools.cycle. Because that is the nature of the itertools module: once the veil falls from our eyes and we come across functions such as repeat, takewhile, dropwhile or product, there is no return. In this talk we will learn to identify when they can be used, accomplishing with a single line of code what for the mere mortals takes much more effort.

Ähnliche Filme

Loading...