1.10. Libraries/Packages¶
1.10.1. Popular, nay, essential packages¶
As the semester proceeds, you will surely need to learn (to some degree) the following packages. For each, you might note the most common and useful functions, and copy common “cookbook” uses of the packages which you can paste into new programs. (E.g. how to open a csv file.)
Note: I do not personally, nor do many programmers, commit to memory many functions of many packages. We simply know what can be done and when needed, we search (tab completion/google/stack overflow) for the command/recipe for that function.
Built-in packages:
ossysitertoolsredatetimecsvDatasci packages (Anaconda installs these for you!), note the aliases here aren’t strictly needed, but by convention, virtually everyone uses the shorter names
pandas as pd(pd is a short alias for pandas)seaborn as snsmatplotlib as mplstatsmodels.api as smmatplotlib.pyplot as pltnumpy as npsklearn
Web crawling
requests,requests_html,urllibtimeandtdqmbeautifulsoup4 as bs4html5libselenium
1.10.2. Installing libraries¶
The Anaconda distribution we installed also installed most of the key data science Python libraries/packages we will use throughout the semester. In the event you need to install a new package to add functionality to Python, e.g. seaborn (which you already have!), you can
Open Anaconda Prompt (Windows) or Terminal (Mac) or a code cell in Jupyter Lab
conda install seabornwill install SeabornIf
conda installdoesn’t work for a package, you can try topip installit. E.g.pip install seaborn
Some packages can’t be pip installed, but hopefully you won’t need to deal with that this semester, so I’m going to skip discussion of such package installs.