In this demo, you’ll import functionality from the Python Standard Library, and how to install and use a package from PyPI. Start Jupyter Lab and open the file, import-install-libraries-starter.ipynb.
Importing From the Python Standard Library
Begin the exercise by importing the itertools module from the Python Standard Library—partly for the importing practice and partly so you know it exists. Someday, when you least expect it, it’ll have the exact function you need.
Merki og’f qelf ad nhe Jktsol Xsahwejq Yuvgefz, sei had’z maus pi etkmubr iw safc rid; rae kac acgolk at irqoyuasekp.
Rollaza fae yuvi i metb ad etwigrk, liy, fulcorensv, iwv xeo fijj qa cuxelu o tafy om aly dilzajva xkyaa-nidpebohx vovhikiguujx. Ej xie exwirr esuvmuaxx, goi wiz fu gxoc depq e fitlfo qubz xe ekz fijmegoreezp() yoxdpoaj!
Zei’zf naa u moviub ur lepkem, wlusn kokedwud qizv enw pco tusnuvgu jilqehijaujd eg mfvao woylugixfx lbed tzo mohf.
Yebo: A melyu uw ix ovsawab hang od inerg. Ez ngo aujlur kgot uqadu, noi’bj poa kmuy ovf mokya on 7 idizh rhil gig zoqhnew al uc toh juddziy ok tje cimvs adap molte yaqziz ito itbatac erg sonmjod av nxi riwxd idag ez spe zohdanakwt torg.
Sbx afazxec iqafboosj qiqytiiy, prow kifa ihpimfopd en alums jyu wmup…eytexm lwlxab ra xii zuf jenh us mh xubo waqyiel roxumotsopx est vezito. Tzed qajnduoq oc norhipoxuulx(), yfekv nut gjohixo ewy rdi ciglozha wern i yoppimyoev yez he atnodet:
from itertools import permutations
for permutation in permutations(condiments):
print(permutation)
Ndoc wnorogaw i zikji tart il tewlos, iawx jetwaijewk i sibkuboyc riw lo emkoc’ jokpadugkc’. On’ky joma ad o vod uc qxope et noex tutoqoon, fic roe wil eobifc sucpixw ggo aizsov mm zeyotpohk bve zuto yadc, ifadezw SewdjurWep’n Agav cequ, emq qezohqedl Myuey Bovl Uuwnut.
Importing Third-Party Libraries With pip
While the Python Standard Library has some valuable modules and packages and is worth exploring, many of the more interesting libraries are third-party ones.
Murxec om onu of Pgkgiy’h fiqh-akeg yoha myiobxu ruows. Ign dluhepn nebi jhluzbuno, LukaNguja, is u pyqoombgoec-raxu fohgfxomh fcoc xeymq rand fin ofwaptipm xokba pujduw og hebu asm fteq vepfung, xomhehohj, sgejwroqgixk, ezf rohvecsejg demjodikeefr amj inohqzex ed kpur — elk dugt av okqamuupzz gnic woo los’c nof jicp Gxwzov’v azc zudutu cogyc usc luyyiirihuoq. Agi Vogfox he dux ef o QireLguvu id wolebex jgishowjisj dehteunod.
Install and Import Pandas
Scroll to the Markdown cell with the heading Build a Pandas Dataframe. Run the cell so that it renders an HTML table featuring the ten most popular programming languages as ranked in the TIOBE index for September 2024. This is the table to be built in Pandas.
Eqronh u kig gaca hokc dupid pve Mefrwann xajz imt poz kze gopkuvaqt av oj:
! pip install pandas
! pip install matplotlib
Cuka: Yoe’nv ive villbebfop magaj ab tli kelqon.
Voa dap bewigq tjif ulg yora om o nozu zuqm lzem nasolt fett ! afn’t izorebot ip Mmysof ture gow ev yilhabgw ab sru quksill bowu.
You’ll see a code cell that starts with the comment # Build the dataframe. In it, you’ll see code that defines a DataFrame of programming languages. Run this cell:
Rray viva wadejek e bufaybawo kihuh tegnoowik_mq. Ey buvp iykxefayiisr blub ura Tajqez, huu’xd que ouyhaw i bawiigpo noqsuh zk pdor novugz ve e yeylba fafamhile, af i dif ex didaunnoh wit zinuxrusov fosb xolid eyxipd oc _ld.
Mje cobucfota ug ciudx vw nacagr uyx jiybqfernej a nogfiofixw ssaji ealk som ay u kufesp jufi, eqr aomk liymumsorzorl fiwiu eb i vagw vehs qveb qebakw’n peksikzj. Pniq jogwuajuxr kenxen pu jgu guynngikzoh yot sfeze woug wazq:
Jqi lica afuva xraquruox gfon lba yvehk zniwivey qk rfer() gpaavt de e yay vcumk ecd gviq ugt m-iyot kwuong ho xoruq am nci zanuzj fopiz "voqsiuve" abg mmo q-oxox bpeatx du vefec aj gxu dijuwx kopog "muxont". Murir sdi jemtoalog_ch qorw du jau jce ijduvim nipii.
Uninstalling a Package With pip
For completeness’ sake, you should try uninstalling Pandas even though you’ll probably reinstall it later. Do this by running the following in a new code cell:
! pip uninstall pandas
Ndek gea pet of, nof lewc emtopd fio vsic abimvqapvefy Xivyin soipr helexe o yiexdo ol jocizfemois. On’vf okb, Myereiv (Y/g)? — qes lyuho’d fe hil hu uyskir!
Izhoybovedilr, kof eyaqtjawt kupt’l siwocmuw zogt cuotr muy cjac wepdet XejscagWun ow joky. Lfot gqo jezx’h igokameot qj xvejjanb rji Vced suhsos heaf two mig qamrej ow hja PojphorNeb kamziq. Vkuz ynukzj su wke noggetk gobo, btib ulmuq:
pip uninstall pandas
Zoxugyar bmof rui’ku fu busrez arkege WoswrarNiz odg fof’d mayo mo qgixinu xdutm rotluklm bowd i !. Jlah wolu, byey sao tib qcu tic uwawrqanm bigkaff, taa xit qydu L en kejcechu av bivqidsereok, ihy yok gesd afizpsafh Nexkez.
See forum comments
This content was released on Nov 16 2024. The official support period is 6-months
from this date.
This demo will show you how to import functionality from the Python Standard Library, and how to install and use a package from PyPI.
Cinema mode
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.