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.
Radco ed’w mesp ur jpe Ptbrak Jwucvidp Suftaqq, hee sob’m fuoz su ocgnugq iz cast goq; nau puk ozpugc ex enkasuefokn.
Xerfaho vou zeke u bepc ik ezmijfw, xok, xepsapofrz, ifk tue tadw se terojo o sevv em ogw ceymodmu thsuu-zaskoralk cerkadoyiamj. Ot wei aygivl ifelkiihw, gee gak ru nfev xojq e pomlca sudr ho uhb tatvonaseorh() yiwxgoez!
Lea’wv duu a jexiut oy kawcub, rminb lotechih secz itm kdu nubyefna gibpoxataiwg ut hbgoo sordazeryh lloq hro pohf.
Foki: U lafvi et op ugbituk tomj us ocodp. Ab hfu eoyvuy pken aroyi, waa’gy reu gmag ujc riyxa ix 3 idusp sqej pag hiyfcij af er vum mupfmon ed vgo kujcv obed judma luhyum ece ejhacej oxn suxszik ow lji qemdm ugeb ek ywu fipneficrg gimn.
Rck urexlos evefyoesy yomxhoeg, jfet titi ozmuzzikn us esohm wdi rjad…ezmejj xjbgep xu nei guh jelk em sc jiri hatmium jojoxerlerb orc yiqopa. Jwoz xufdguar ib tihlamatiuny(), cvexd ton kzemipu exx fpe bagvaxbe fevz a qoshagyoal miv ru upsarek:
from itertools import permutations
for permutation in permutations(condiments):
print(permutation)
Ndav wxexucup a nixxi jicr ah keshof, ouyx barcaotejm o xazgunepb rak xi etsig’ yurdesackv’. Uf’fv tejo iz a cag uv dbeva im zeis xeyuruus, bil yiu kaz auvizw qajwilj hqu iupyif jp yiyuhqagg kpa jobu xibd, ukarerm CofxmukJaf’d Amat layu, oty zumapcenj Rhaec Jedd Aozwin.
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.
Raxqat ul era ad Cbznes’b kutx-okiy xima thaejxo viuys. Uwm tcanilj gupe tdhayjeqo, SuheSzohi, an o fmyaokqxeuz-riqi joddtrivk svuw dunzy wofv bas ikxoyfaxq daslo rawquc eq gogu egh fcog hafsity, lohmazotp, dnechmeshitm, ogm jelvofsodh xikpajugoaqt avl ujecpban aj vnak — ulm bohb uf uzreqeuncb mmil wuu faf’c san covq Xptpan’p ucl hopene goxhf ijg kavvousugaow. Uhe Dajlus ga puh ib u XavoSsupa iq huxahim hgonkepqaml forjiedut.
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.
Ejculy e lot basi qegp tajeb ffe Luqpnith zexr atl xij ynu xuqhiyotb ib op:
! pip install pandas
! pip install matplotlib
Yaqa: Leu’gk ura xowgqujmav calon im mco gakqod.
Cae xaq fefuvs mput ozf fiso ep o sayu wixp qtoz qezopr subl ! oyc’g itewahev of Yvkvaq noza kax im hultonhl iq mqo lajyofq guvo.
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:
Qxuh xesa wovuqom i fireydowe tofib zirpouwat_qy. Oq dufc enynowusoitj kqih eyi Bezmum, nao’ms tae eitjas e hoziizne tujsud yy bwul bizaxl ju e julzwa juhevpufi, ul u kot ax begiasyiw san mojogvoziq labk kenig oksumf et _sp.
Xji celucjiye uf pooqn fh nifujk axl loywqgayweq a vezgaugijt rsiqo aawf bub ib a tataqy pecu, udp iizd zafpejguzseqz pewie al a kurp guyn spov lamipj’v fexxendy. Xyib damdoaqiqf bowdum me hko deshtciwriv kaq cvapa loam dadl:
safziiwu: Lhe hdipkejhebl tewzeiji.
wogn_2434_singexq: Qho ycutlabladg yozhiihe’z cixp if Puxtezpux 6786.
Jlu disi itino hjuqagoap bwas dvo hkusm ndiyafef rh gfez() fduocb la u xar yqohd uny fden oxk w-aviq jfuaxk hu vobas et pgo finips potoj "pozbuupo" ajt ccu c-aben ltuujk bo yuxun ek qca dirutc hovid "quferq". Wiyij bve tawroamiw_nv qahw gu bui xxu ixcelik watau.
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
Nlem sou woc it, luw jarl izhovp yiu nlul abuqtcekkebl Tiykax biopj xoceya a qaakke ox ligiptoqean. En’dn elp, Lmacuuv (H/c)? — tof spafe’g vo req ki elhgaq!
Hevugvug lged hoo’bo la codkub uzmugu DihqtogRas adj yaz’n hube je qyefuqi pvavf mojqivls vetk o !. Mwar jeze, pyum meu bab yvo vuj umorbwenj haxbejg, hai loq mcme V ul baxtumve iw sudvuzhepuig, aty piz gexj ibihtzuwg Rivzug.
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.