Занятие 7. Анализируем данные и строим графики
"WEBVTTKind: captionsLanguage: enfriends, hello everyone, welcome to thefriends, hello everyone, welcome to thefriends, hello everyone, welcome to theintroductory machine learning course myintroductory machine learning course myintroductory machine learning course myname is Dmitry Makarov and today we have thename is Dmitry Makarov and today we have thename is Dmitry Makarov and today we have theseventh lesson in the seventh lesson weseventh lesson in the seventh lesson weseventh lesson in the seventh lesson wewill start talking about data analysis inwill start talking about data analysis inwill start talking about data analysis inparticular we will talk about those librariesparticular we will talk about those librariesparticular we will talk about those librariesthat exist in Python forthat exist in Python forthat exist in Python fordata analysis in addition to this we will talkdata analysis in addition to this we will talkdata analysis in addition to this we will talkabout specific library about theabout specific library about theabout specific library about thepandas library and the matplotlib library, and sopandas library and the matplotlib library, and sopandas library and the matplotlib library, and soPython consists of the basic functionalityPython consists of the basic functionalityPython consists of the basic functionalitythat we have studied so far, that is,that we have studied so far, that is,that we have studied so far, that is,these are variables, these are string values,these are variables, these are string values,these are variables, these are string values,numeric valuesnumeric valuesnumeric valuesin the list, dictionaries, conditions, cycles, everything thatin the list, dictionaries, conditions, cycles, everything thatin the list, dictionaries, conditions, cycles, everything thatwe have studied so far, this functionalitywe have studied so far, this functionalitywe have studied so far, this functionalityallows you to solve a wide variety ofallows you to solve a wide variety ofallows you to solve a wide variety ofproblems At the same time, Python also hasproblems At the same time, Python also hasproblems At the same time, Python also hasadditional libraries thatadditional libraries thatadditional libraries thatallow you to solve more specific problems; theyallow you to solve more specific problems; theyallow you to solve more specific problems; theycan help create websites, helpcan help create websites, helpcan help create websites, helpcreate games, applications, but in ourcreate games, applications, but in ourcreate games, applications, but in ourcase they will help analyzecase they will help analyzecase they will help analyzedata, anddata, anddata, andwe will get to know two of these libraries today, inwe will get to know two of these libraries today, inwe will get to know two of these libraries today, inparticular, this one again library pandasparticular, this one again library pandasparticular, this one again library pandasgame library matplotlibgame library matplotlibgame library matplotlibthey allow you to analyze data inthey allow you to analyze data inthey allow you to analyze data intabular form and build graphstabular form and build graphstabular form and build graphsaccordingly, in addition, there isaccordingly, in addition, there isaccordingly, in addition, there isa library for us that helps us worka library for us that helps us worka library for us that helps us workwith matrices and there are libraries thatwith matrices and there are libraries thatwith matrices and there are libraries thathelp build models, this library ishelp build models, this library ishelp build models, this library issocket learn keros and tensorflow we willsocket learn keros and tensorflow we willsocket learn keros and tensorflow we willstudy these libraries as westudy these libraries as westudy these libraries as wedive into machine learningdive into machine learningdive into machine learningWell, now let's see how weWell, now let's see how weWell, now let's see how wecan work with tabular data incan work with tabular data incan work with tabular data inPython and immediately go to the code andPython and immediately go to the code andPython and immediately go to the code andsee what we can do insee what we can do insee what we can do inparticular in order to work with theparticular in order to work with theparticular in order to work with thepandas library we need data, sopandas library we need data, sopandas library we need data, soI have already loaded the data which is in theI have already loaded the data which is in theI have already loaded the data which is in theform of a dictionary in fact, we areform of a dictionary in fact, we areform of a dictionary in fact, we arealready familiar with this data, we know it from thealready familiar with this data, we know it from thealready familiar with this data, we know it from thesecond lesson where we talked about creditsecond lesson where we talked about creditsecond lesson where we talked about creditscoring about borrowers, and in fact,scoring about borrowers, and in fact,scoring about borrowers, and in fact,you have already seen this data, let meyou have already seen this data, let meyou have already seen this data, let meshow it to you in tabular form, thisshow it to you in tabular form, thisshow it to you in tabular form, thisdata is the data of Ivan Ivanovich Ivandata is the data of Ivan Ivanovich Ivandata is the data of Ivan Ivanovich IvanPetrovich, but this picture and pythons and I don’tPetrovich, but this picture and pythons and I don’tPetrovich, but this picture and pythons and I don’tunderstand, we need to bring it into someunderstand, we need to bring it into someunderstand, we need to bring it into someformat understandable to python, we are currently familiarformat understandable to python, we are currently familiarformat understandable to python, we are currently familiarwith the format of the Pythonwith the format of the Pythonwith the format of the Pythondictionary and exactly in this formatdictionary and exactly in this formatdictionary and exactly in this formatthis data variable ddb is created,this data variable ddb is created,this data variable ddb is created,that is, a banking database, let me remind youthat is, a banking database, let me remind youthat is, a banking database, let me remind youthat in variables it is better givethat in variables it is better givethat in variables it is better givemeaningful namesmeaningful namesmeaningful nameswritten columns columns written in the form ofwritten columns columns written in the form ofwritten columns columns written in the form ofkeys of this dictionary in particular name ofkeys of this dictionary in particular name ofkeys of this dictionary in particular name ofexperience salary credit score and outcomeexperience salary credit score and outcomeexperience salary credit score and outcomethey designate the columns of our table inthey designate the columns of our table inthey designate the columns of our table inwhich the borrower was age length of service incomewhich the borrower was age length of service incomewhich the borrower was age length of service incomecredit points and the fact of repayment of thecredit points and the fact of repayment of thecredit points and the fact of repayment of theloan or not repayment and,loan or not repayment and,loan or not repayment and,accordingly, the values are theaccordingly, the values are theaccordingly, the values are therows with the first element the valuerows with the first element the valuerows with the first element the valueis the first line and the second element theis the first line and the second element theis the first line and the second element thevalue is the second line the value itselfvalue is the second line the value itselfvalue is the second line the value itselfhas the form of a concrete list then there ishas the form of a concrete list then there ishas the form of a concrete list then there isnothing new for you here it is a dictionarynothing new for you here it is a dictionarynothing new for you here it is a dictionarywith built-in lists aswith built-in lists aswith built-in lists asvalues great here nothingvalues great here nothingvalues great here nothingnew yet but we need to work with thenew yet but we need to work with thenew yet but we need to work with thepandas library for this thispandas library for this thispandas library for this thislibrary needs to be importedlibrary needs to be importedlibrary needs to be importedimporting a library is very simple, weimporting a library is very simple, weimporting a library is very simple, wewrite import, then we write the name of thewrite import, then we write the name of thewrite import, then we write the name of thepandas library, then we write anpandas library, then we write anpandas library, then we write analias or shortened name for it, italias or shortened name for it, italias or shortened name for it, itcan’t always be anything, but for thecan’t always be anything, but for thecan’t always be anything, but for themost common librariesmost common librariesmost common librariesthere are established aliases and wethere are established aliases and wethere are established aliases and wewill use them because everyonewill use them because everyonewill use them because everyoneuses them, you will find them onuses them, you will find them onuses them, you will find them onreference sites in the literature thisreference sites in the literature thisreference sites in the literature thisindustry standard we willindustry standard we willindustry standard we willuse it we will import thisuse it we will import thisuse it we will import thislibrary by running the cell after thatlibrary by running the cell after thatlibrary by running the cell after thatwe can start working withwe can start working withwe can start working withour library before that beforeour library before that beforeour library before that beforewe start building our table before orwe start building our table before orwe start building our table before orhow correctly or how we will sayhow correctly or how we will sayhow correctly or how we will saydataframe is so specialdataframe is so specialdataframe is so specialdata structure in the pandas library, wedata structure in the pandas library, wedata structure in the pandas library, wefirst need to import or load our dictionaryfirst need to import or load our dictionaryfirst need to import or load our dictionaryinto the computer’s memory in orderinto the computer’s memory in orderinto the computer’s memory in orderto work with it later, and so the gtkto work with it later, and so the gtkto work with it later, and so the gtkis loaded, the dictionary is loaded, we are ready tois loaded, the dictionary is loaded, we are ready tois loaded, the dictionary is loaded, we are ready tocreate a table, in order to createcreate a table, in order to createcreate a table, in order to createsuch a table or dataframe, wesuch a table or dataframe, wesuch a table or dataframe, wefirst need to create a variable, sofirst need to create a variable, sofirst need to create a variable, sowe create a variable and then takewe create a variable and then takewe create a variable and then takethis object, this data structure from thethis object, this data structure from thethis object, this data structure from thepandas library, we refer to the pandas librarypandas library, we refer to the pandas librarypandas library, we refer to the pandas libraryby its abbreviated name,by its abbreviated name,by its abbreviated name,that is, under the name pedi, then wethat is, under the name pedi, then wethat is, under the name pedi, then wewrite a datewrite a datewrite a dateframe andframe andframe andto the dataframe object we pass thisto the dataframe object we pass thisto the dataframe object we pass thisvariable that we created before,variable that we created before,variable that we created before,that is, our dictionarythat is, our dictionarythat is, our dictionarywe can copy it and paste it herewe can copy it and paste it herewe can copy it and paste it hereso we have our structure ready, our codeso we have our structure ready, our codeso we have our structure ready, our codein order to create a table, runin order to create a table, runin order to create a table, runthis cell andthis cell andthis cell andlet's see what we gotlet's see what we gotlet's see what we gotfor this we will need to callfor this we will need to callfor this we will need to callthis dataframe on the screen, great wethis dataframe on the screen, great wethis dataframe on the screen, great wesee that Python was able to createsee that Python was able to createsee that Python was able to createa table for us Now what can we do with thisa table for us Now what can we do with thisa table for us Now what can we do with thistable? Why is it needed at all,table? Why is it needed at all,table? Why is it needed at all,but besides the fact that we can visuallybut besides the fact that we can visuallybut besides the fact that we can visuallyassess what data we have and inassess what data we have and inassess what data we have and inwhat form it is presented, we canwhat form it is presented, we canwhat form it is presented, we cancollect some statistics and that is,collect some statistics and that is,collect some statistics and that is,somehow describe this data in more detailsomehow describe this data in more detailsomehow describe this data in more detailWe will talk about descriptive statistics withWe will talk about descriptive statistics withWe will talk about descriptive statistics withyou in the next lesson, but for now,you in the next lesson, but for now,you in the next lesson, but for now,just give me an example, I will show you whatjust give me an example, I will show you whatjust give me an example, I will show you whatyou can do, you can, for example, make a sliceyou can do, you can, for example, make a sliceyou can do, you can, for example, make a sliceby one column, that is, make aby one column, that is, make aby one column, that is, make afilter by one column and lookfilter by one column and lookfilter by one column and lookonly at the data of this column, well, for example,only at the data of this column, well, for example,only at the data of this column, well, for example,let it be the income column, select inlet it be the income column, select inlet it be the income column, select inprompt, this is the column and weprompt, this is the column and weprompt, this is the column and welaunch the cell beautifully, we seelaunch the cell beautifully, we seelaunch the cell beautifully, we seeonly the data of this column, and Pythononly the data of this column, and Pythononly the data of this column, and Pythonalso tells us what type of dataalso tells us what type of dataalso tells us what type of datais written in this column, we see thatis written in this column, we see thatis written in this column, we see thatinteger values are written in this column,integer values are written in this column,integer values are written in this column,int means interior, what else can beint means interior, what else can beint means interior, what else can bedone to this column, you can apply thedone to this column, you can apply thedone to this column, you can apply themethod well for example, we want to calculate themethod well for example, we want to calculate themethod well for example, we want to calculate theaverage value of income, theaverage value of income, theaverage value of income, thearithmetic mean, that is, we need to add uparithmetic mean, that is, we need to add uparithmetic mean, that is, we need to add upall the income values and divide by theirall the income values and divide by theirall the income values and divide by theirnumber; for this there is a specialnumber; for this there is a specialnumber; for this there is a specialmethod called meme becausemethod called meme becausemethod called meme becausein English the arithmetic averagein English the arithmetic averagein English the arithmetic averagewill be main and accordingly we canwill be main and accordingly we canwill be main and accordingly we canrun thisrun thisrun thisthis method and it really works for usthis method and it really works for usthis method and it really works for uswill consider that the average income is 75 plus 95will consider that the average income is 75 plus 95will consider that the average income is 75 plus 95divided by 2 will be 85 great,divided by 2 will be 85 great,divided by 2 will be 85 great,probably at this point we can put the pandas libraryprobably at this point we can put the pandas libraryprobably at this point we can put the pandas libraryaside and see how we canaside and see how we canaside and see how we canbuild graphs using thebuild graphs using thebuild graphs using thematplotlib library, the matplotlib librarymatplotlib library, the matplotlib librarymatplotlib library, the matplotlib libraryallows you to display data in graphicalallows you to display data in graphicalallows you to display data in graphicalform, in order to do this we willform, in order to do this we willform, in order to do this we willimmediately go to the tab here I haveimmediately go to the tab here I haveimmediately go to the tab here I havealready prepared the data that we willalready prepared the data that we willalready prepared the data that we willdisplay on the screen so as not to wastedisplay on the screen so as not to wastedisplay on the screen so as not to wastetime on this, we will load this data in order totime on this, we will load this data in order totime on this, we will load this data in order touse theuse theuse thematplotlib library, we need to import it in the same way,matplotlib library, we need to import it in the same way,matplotlib library, we need to import it in the same way,to be more specific, we need ato be more specific, we need ato be more specific, we need aspecific module, that is, librariesspecific module, that is, librariesspecific module, that is, librariesconsist of modules and we needconsist of modules and we needconsist of modules and we needa specific one the module of this librarya specific one the module of this librarya specific one the module of this librarywhich we will import, wewhich we will import, wewhich we will import, wewrite import in exactly the same way, then we writewrite import in exactly the same way, then we writewrite import in exactly the same way, then we writematplotlib, there is already a hint and wematplotlib, there is already a hint and wematplotlib, there is already a hint and weneed a module called pie fruitneed a module called pie fruitneed a module called pie fruitand here Python, or rather google call from us, isand here Python, or rather google call from us, isand here Python, or rather google call from us, isalready prompted that we canalready prompted that we canalready prompted that we canimport from you with the abbreviation youimport from you with the abbreviation youimport from you with the abbreviation yousee that we let’s abbreviate it with the letters plc,see that we let’s abbreviate it with the letters plc,see that we let’s abbreviate it with the letters plc,you’ll agree that it’s much more convenient thanyou’ll agree that it’s much more convenient thanyou’ll agree that it’s much more convenient thanwriting matplotlib every time. good fruit,writing matplotlib every time. good fruit,writing matplotlib every time. good fruit,great, now we import thisgreat, now we import thisgreat, now we import thislibrary, we have it imported withlibrary, we have it imported withlibrary, we have it imported withthe data we have, and now let’sthe data we have, and now let’sthe data we have, and now let’sbuild the simplest graph, let’sbuild the simplest graph, let’sbuild the simplest graph, let’sassume that we have income on the x-axis, theassume that we have income on the x-axis, theassume that we have income on the x-axis, thehorizontal axis, and thehorizontal axis, and thehorizontal axis, and thelevel of happiness on the y-axis,level of happiness on the y-axis,level of happiness on the y-axis,let’s look at the dependence of the level of happinesslet’s look at the dependence of the level of happinesslet’s look at the dependence of the level of happinesson income and if at all this is a dependencyon income and if at all this is a dependencyon income and if at all this is a dependencyfor this we need to build afor this we need to build afor this we need to build acurve the curve can be built using thecurve the curve can be built using thecurve the curve can be built using thefruit functions we will call it for this we need tofruit functions we will call it for this we need tofruit functions we will call it for this we need tofirst call the matplotlib library itsfirst call the matplotlib library itsfirst call the matplotlib library itsmodule pai fruit after that we mustmodule pai fruit after that we mustmodule pai fruit after that we mustcall our function, call thecall our function, call thecall our function, call thefruit function andfruit function andfruit function andthen pass two arguments to it anthen pass two arguments to it anthen pass two arguments to it anargument along the x-axis and an argument along the y-axis,argument along the x-axis and an argument along the y-axis,argument along the x-axis and an argument along the y-axis,this is actually not at all difficult, wethis is actually not at all difficult, wethis is actually not at all difficult, wewrite x, y and in fact everything iswrite x, y and in fact everything iswrite x, y and in fact everything isready, our graph is ready, let's see whatready, our graph is ready, let's see whatready, our graph is ready, let's see whatwe got, I put awe got, I put awe got, I put alittle more space forlittle more space forlittle more space forour graph,this is what we got This isthis is what we got This isthis is what we got This isthe graph we have, obviously some kind ofthe graph we have, obviously some kind ofthe graph we have, obviously some kind ofdependence is visible: the higher thedependence is visible: the higher thedependence is visible: the higher theincome, the higher the level of happiness, but as youincome, the higher the level of happiness, but as youincome, the higher the level of happiness, but as youand I will learn in subsequent courses,and I will learn in subsequent courses,and I will learn in subsequent courses,what we see on the screen is called awhat we see on the screen is called awhat we see on the screen is called apositive correlation, that is, wepositive correlation, that is, wepositive correlation, that is, wesee that one of the indicatorssee that one of the indicatorssee that one of the indicatorschanges in the same the direction inchanges in the same the direction inchanges in the same the direction inwhich the other changes, that is,which the other changes, that is,which the other changes, that is,income increases, the level of happiness increases, but such aincome increases, the level of happiness increases, but such aincome increases, the level of happiness increases, but such acorrelation does not mean that there iscorrelation does not mean that there iscorrelation does not mean that there isa cause-and-effect relationship of sucha cause-and-effect relationship of sucha cause-and-effect relationship of suchcorrelations, in fact, a lotcorrelations, in fact, a lotcorrelations, in fact, a lotcan be found; a correlation between the cleanliness ofcan be found; a correlation between the cleanliness ofcan be found; a correlation between the cleanliness ofcrane flights and precipitation in Antarctica; suchcrane flights and precipitation in Antarctica; suchcrane flights and precipitation in Antarctica; sucha dependence also exists; it can bea dependence also exists; it can bea dependence also exists; it can befound, but causality it isfound, but causality it isfound, but causality it isvery difficult to establish an investigative connection here, and there arevery difficult to establish an investigative connection here, and there arevery difficult to establish an investigative connection here, and there areentire sites that demonstrateentire sites that demonstrateentire sites that demonstratesuch a funny correlation betweensuch a funny correlation betweensuch a funny correlation betweenevents that in factevents that in factevents that in facthave no cause-and-effect relationship.have no cause-and-effect relationship.have no cause-and-effect relationship.I told you all this so that youI told you all this so that youI told you all this so that youremember that correlation or dependenceremember that correlation or dependenceremember that correlation or dependencedoes not mean a cause-and-effect relationshipdoes not mean a cause-and-effect relationshipdoes not mean a cause-and-effect relationshipthis is a very important fact for mathematics forthis is a very important fact for mathematics forthis is a very important fact for mathematics forstatistics, which we willstatistics, which we willstatistics, which we willstudy next time, well,study next time, well,study next time, well,let’s go back to ourlet’s go back to ourlet’s go back to ourgraph and try to improve it a little, it’sgraph and try to improve it a little, it’sgraph and try to improve it a little, it’snot very clear yet thatnot very clear yet thatnot very clear yet thatany graph is drawn on it, it’s veryany graph is drawn on it, it’s veryany graph is drawn on it, it’s veryuseful to provide explanations and let’suseful to provide explanations and let’suseful to provide explanations and let’sgive such explanations first of all,give such explanations first of all,give such explanations first of all,let's set the title for this, we againlet's set the title for this, we againlet's set the title for this, we againcall the matplotlib library through thecall the matplotlib library through thecall the matplotlib library through theplt abbreviation and write the title, that is, theplt abbreviation and write the title, that is, theplt abbreviation and write the title, that is, thetitle and then in quotes becausetitle and then in quotes becausetitle and then in quotes becausethis line we set the actualthis line we set the actualthis line we set the actualtitle that we want, for example, let'stitle that we want, for example, let'stitle that we want, for example, let'swrite the level of income and happiness great,write the level of income and happiness great,write the level of income and happiness great,we have a title, let's Let's seewe have a title, let's Let's seewe have a title, let's Let's seewhat we have donewhat we have donewhat we have doneperfectly, we have a title forperfectly, we have a title forperfectly, we have a title forour graph in exactly the same way, weour graph in exactly the same way, weour graph in exactly the same way, wecan display labels for our axes, forcan display labels for our axes, forcan display labels for our axes, forthis we will also call thethis we will also call thethis we will also call thematplotlib library and write x label, that is, thematplotlib library and write x label, that is, thematplotlib library and write x label, that is, thelabel for the x axis and here alsolabel for the x axis and here alsolabel for the x axis and here alsoin quotes we will write what we want herein quotes we will write what we want herein quotes we will write what we want hereindicate on the x-axis, we have deferred income,indicate on the x-axis, we have deferred income,indicate on the x-axis, we have deferred income,great, and let’s do it right away, Igreat, and let’s do it right away, Igreat, and let’s do it right away, Ithink you already understand what I’m getting at,think you already understand what I’m getting at,think you already understand what I’m getting at,let’s put a label on the y-axis for this,let’s put a label on the y-axis for this,let’s put a label on the y-axis for this,here we’ll write the level of happiness, great,here we’ll write the level of happiness, great,here we’ll write the level of happiness, great,let’s now re-execute thislet’s now re-execute thislet’s now re-execute thiscell and see what we gotcell and see what we gotcell and see what we gotas we see, we have captions for bothas we see, we have captions for bothas we see, we have captions for bothaxes and the title of our graph is veryaxes and the title of our graph is veryaxes and the title of our graph is veryconvenient, in fact, that’s all I wanted toconvenient, in fact, that’s all I wanted toconvenient, in fact, that’s all I wanted totell you about the pandas andtell you about the pandas andtell you about the pandas andmatplotlib libraries for today, I think thematplotlib libraries for today, I think thematplotlib libraries for today, I think theonly point that Ionly point that Ionly point that Iwanted to consider with you is thewanted to consider with you is thewanted to consider with you is theprint and functions The thing was that you can do exactly theprint and functions The thing was that you can do exactly theprint and functions The thing was that you can do exactly thesame thing as we put print and writesame thing as we put print and writesame thing as we put print and writesomething inside that we want to display on the screen, justsomething inside that we want to display on the screen, justsomething inside that we want to display on the screen, justas you can display it with thisas you can display it with thisas you can display it with thiscommand, what we previously designedcommand, what we previously designedcommand, what we previously designedas a graph, let’s runas a graph, let’s runas a graph, let’s runthis cell again and we see that we nowthis cell again and we see that we nowthis cell again and we see that we nowhave the same graph, but you alreadyhave the same graph, but you alreadyhave the same graph, but you alreadyunderstand, it’s obvious that the graph canunderstand, it’s obvious that the graph canunderstand, it’s obvious that the graph canat least be displayed in google to the lobbyat least be displayed in google to the lobbyat least be displayed in google to the lobbywithout this command without a stick. show, why arewithout this command without a stick. show, why arewithout this command without a stick. show, why arethey needed? I’ll say more about the print command,they needed? I’ll say more about the print command,they needed? I’ll say more about the print command,with which we displayed somewith which we displayed somewith which we displayed someoperations, the result of some operations on theoperations, the result of some operations on theoperations, the result of some operations on thescreen, it’s actually not needed either,screen, it’s actually not needed either,screen, it’s actually not needed either,let’s see, I’m now thinking oflet’s see, I’m now thinking oflet’s see, I’m now thinking ofsome very simple command without thesome very simple command without thesome very simple command without theprint function, well, let’s say I want toprint function, well, let’s say I want toprint function, well, let’s say I want toadd 7 and 7 I will execute this code and youadd 7 and 7 I will execute this code and youadd 7 and 7 I will execute this code and yousee that python also executes thissee that python also executes thissee that python also executes thiscode and displays the result without thecode and displays the result without thecode and displays the result without theprint command, you are asked why the print command is needed,print command, you are asked why the print command is needed,print command, you are asked why the print command is needed,in fact there are severalin fact there are severalin fact there are severalaspects today we will look at one ofaspects today we will look at one ofaspects today we will look at one ofthem, it also concerns the pelti command. show andthem, it also concerns the pelti command. show andthem, it also concerns the pelti command. show andprint commands, that is, both of these commandsprint commands, that is, both of these commandsprint commands, that is, both of these commandsdisplay something on the screen until the firstdisplay something on the screen until the firstdisplay something on the screen until the firstcommand displays graphics 2 displays whatcommand displays graphics 2 displays whatcommand displays graphics 2 displays whatyou pass inside as anyou pass inside as anyou pass inside as anargument, let's look at anotherargument, let's look at anotherargument, let's look at anotherexample if Iexample if Iexample if Iput the following operation in the same cell, forput the following operation in the same cell, forput the following operation in the same cell, forexample 12 plus 4 we should alreadyexample 12 plus 4 we should alreadyexample 12 plus 4 we should alreadyget the result 14 and 16 let'sget the result 14 and 16 let'sget the result 14 and 16 let'ssee what the result will be thesee what the result will be thesee what the result will be theresult will be only 16 why soresult will be only 16 why soresult will be only 16 why sowhen we do not explicitly indicate that we want towhen we do not explicitly indicate that we want towhen we do not explicitly indicate that we want todisplay something on the screen Python insidedisplay something on the screen Python insidedisplay something on the screen Python insideone cell displays only the lastone cell displays only the lastone cell displays only the lastoperation in order to display insideoperation in order to display insideoperation in order to display insideone cells both operations both sums weone cells both operations both sums weone cells both operations both sums weneed to put two functions print twoneed to put two functions print twoneed to put two functions print twocommands print writer that is, in thecommands print writer that is, in thecommands print writer that is, in thefirst line of our cell we write print andfirst line of our cell we write print andfirst line of our cell we write print andin the second line of our cell we alsoin the second line of our cell we alsoin the second line of our cell we alsowrite print and now by executing this codewrite print and now by executing this codewrite print and now by executing this codewe will get two sums exactly as wewe will get two sums exactly as wewe will get two sums exactly as wewanted exactly the same thing actuallywanted exactly the same thing actuallywanted exactly the same thing actuallyhappens with the show function if we enterhappens with the show function if we enterhappens with the show function if we entertwo graphs without the sing tee command. show, thentwo graphs without the sing tee command. show, thentwo graphs without the sing tee command. show, thenthey will be output to 1 in the samethey will be output to 1 in the samethey will be output to 1 in the samespace on the samespace on the samespace on the samecoordinate plane, let's seecoordinate plane, let's seecoordinate plane, let's seehow it will be, now I'll addhow it will be, now I'll addhow it will be, now I'll addanother cell andanother cell andanother cell andhere I'll add the code that Ihere I'll add the code that Ihere I'll add the code that Iprepared in advance, I'll output anotherprepared in advance, I'll output anotherprepared in advance, I'll output anothercommand, another function, sing ty . fruit Icommand, another function, sing ty . fruit Icommand, another function, sing ty . fruit I’ll put it here then we’ll put it here then we’ll put it here then wecan ignore this cell here I’ll putcan ignore this cell here I’ll putcan ignore this cell here I’ll putanother function fruit with data, well, this isanother function fruit with data, well, this isanother function fruit with data, well, this issome completely different datasome completely different datasome completely different datajust for an example and I’ll remove thejust for an example and I’ll remove thejust for an example and I’ll remove thecommand drink. I'll take it, let's use acommand drink. I'll take it, let's use acommand drink. I'll take it, let's use acomment for a change,comment for a change,comment for a change,what you enter in the comments orwhat you enter in the comments orwhat you enter in the comments orwhat you close with a comment iswhat you close with a comment iswhat you close with a comment isignored by Python. This is also one of theignored by Python. This is also one of theignored by Python. This is also one of theways to stop using it without erasing the code.ways to stop using it without erasing the code.ways to stop using it without erasing the code.Sometimes this is useful if you areSometimes this is useful if you areSometimes this is useful if you aretesting several versions of the code, thentesting several versions of the code, thentesting several versions of the code, thenyou can close the code in comments andyou can close the code in comments andyou can close the code in comments andsee what happens if it turns out thatsee what happens if it turns out thatsee what happens if it turns out thatyou are unhappy with the result, then you canyou are unhappy with the result, then you canyou are unhappy with the result, then you canremove this comment and then the coderemove this comment and then the coderemove this comment and then the codewill appear again, so let's execute this codewill appear again, so let's execute this codewill appear again, so let's execute this codeand you really see that the graphsand you really see that the graphsand you really see that the graphsappeared on the same basket of thatappeared on the same basket of thatappeared on the same basket of thatplane, yes, we see them side by side nowplane, yes, we see them side by side nowplane, yes, we see them side by side nowif we put Yalta. went next toif we put Yalta. went next toif we put Yalta. went next toeach of these graphs, let me noweach of these graphs, let me noweach of these graphs, let me nowdelete these signatures because then itdelete these signatures because then itdelete these signatures because then itwill be unclear what they refer to andwill be unclear what they refer to andwill be unclear what they refer to andput pelti. show for each of ourput pelti. show for each of ourput pelti. show for each of ourfunctions is the fruit and so I enter andfunctions is the fruit and so I enter andfunctions is the fruit and so I enter andrun this cell and you see thatrun this cell and you see thatrun this cell and you see thatwe have two graphs because with thewe have two graphs because with thewe have two graphs because with thehelp of the show command we explicitly toldhelp of the show command we explicitly toldhelp of the show command we explicitly toldPython that we want to see two graphsPython that we want to see two graphsPython that we want to see two graphsexactly the same as you and I saw thisexactly the same as you and I saw thisexactly the same as you and I saw thisusing the print command or made it clear tousing the print command or made it clear tousing the print command or made it clear toPython using the print command that’sPython using the print command that’sPython using the print command that’sall, thank you very much for your attention in theall, thank you very much for your attention in theall, thank you very much for your attention in thenext lesson we will continue tonext lesson we will continue tonext lesson we will continue tostudy data we will continue to studystudy data we will continue to studystudy data we will continue to studystatistics but at a much morestatistics but at a much morestatistics but at a much moreformal level because we areformal level because we areformal level because we arestarting a section on mathematics all thestarting a section on mathematics all thestarting a section on mathematics all thebest\n"