-
Notifications
You must be signed in to change notification settings - Fork 4
/
part12.tex
232 lines (174 loc) · 7.76 KB
/
part12.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
\documentclass[english,serif,mathserif,xcolor=pdftex,dvipsnames,table]{beamer}
\usetheme[informal]{s3it}
\usepackage{s3it}
\title[Introduction]{%
Do not reinvent the wheel:
\\
A survey of useful Python packages
}
\author[S3IT]{%
S3IT: Services and Support for Science IT, \\
University of Zurich
}
\date{June~23--24, 2014}
\begin{document}
% title frame
\maketitle
\begin{frame}
\frametitle{There is more to Python than this\ldots}
The time and scope of this course is quite limited.
\+
Here is an (incomplete) list of Python features that you might
want to look up as you become more experienced in the language:
% XXX: mettere un link per ciascuna di queste!
\begin{itemize}
\item
\href{http://docs.python.org/2/tutorial/classes.html\#generators}{Generators}
% and
% \href{http://docs.python.org/2/tutorial/classes.html\#iterators}{Iterators}
\item \href{http://www.artima.com/weblogs/viewpost.jsp?thread=240808}{Decorators}
\item Class-level attributes, \href{http://stackoverflow.com/a/12179752/1808780}{classmethods, staticmethods}
\item Properties and accessors
\item \href{http://stackoverflow.com/a/6581949/459543}{Metaclasses}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{matplotlib: publication quality plotting library}
\href{http://matplotlib.org/}{matplotlib} ``is a python 2D plotting
library which produces publication quality figures in a variety of
hardcopy formats and interactive environments across
platforms. matplotlib can be used in python scripts, the python and
ipython shell (ala MATLAB® or Mathematica®), web application
servers, and six graphical user interface toolkits.''
\+
\begin{itemize}
\item[$\triangleright$] Tutorial: {\footnotesize\url{http://www.loria.fr/~rougier/teaching/matplotlib/}}
\item[$\triangleright$] Examples: {\footnotesize\url{http://matplotlib.org/1.2.1/gallery.html}}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{NumPy: linear algebra package}
\href{http://www.numpy.org/}{NumPy} is a package for linear algebra
and advanced mathematics in Python.
\+ It provides a \emph{fast} implementation of multidimensional
numerical arrays (C/FORTRAN like), vectors, matrices, tensors and
operations on them.
\+ \emph{Use it if:} you long for MATLAB core features.
\+
\begin{itemize}
\item[$\triangleright$] Reference: {\footnotesize\url{http://www.numpy.org/}}
\item[$\triangleright$] Examples: {\footnotesize\url{http://wiki.scipy.org/Numpy_Example_List}}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{SciPy: a toolbox for numerics}
``\href{http://www.scipy.org}{SciPy} is open-source software for
mathematics, science, and engineering. \emph{[\ldots]} The SciPy
library provides many user-friendly and efficient numerical routines
such as routines for numerical integration and optimization.''
\+ One of its main aim is to provide a reimplementation of the
MATLAB toolboxes.
\+ \emph{Use it if:} you long for MATLAB toolbox features.
\+
\begin{itemize}
\item[$\triangleright$] Tutorial: {\scriptsize\url{http://docs.scipy.org/doc/scipy/reference/tutorial/index.html}}
\item[$\triangleright$] Examples: {\scriptsize\url{http://nbviewer.ipython.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-3-Scipy.ipynb}}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Pandas: doing statistics in Python}
\href{http://pandas.pydata.org/}{Pandas} is a Python data analysis
library, that provides optimized routines for analyzing 2D, 3D, 4D
data.
\+ ``Pandas \emph{[\ldots]} enables you to carry out your entire
data analysis workflow in Python without having to switch to a more
domain specific language like R.''
\+ \emph{Use it if:} you need features from \emph{R}, \texttt{plyr},
\texttt{reshape2}.
\+
\begin{itemize}
\item[$\triangleright$] Manual: {\footnotesize\url{http://pandas.pydata.org/pandas-docs/stable/}}
\item[$\triangleright$] Examples: {\footnotesize (see Section 5 in the manual)}
\item[$\triangleright$] Tutorial: {\footnotesize (see Section 6 in the manual)}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{NLTK: Natural Language Processing}
\href{http://nltk.org/}{NLTK} \emph{(Natural Language ToolKit)} ``is
a leading platform for building Python programs to work with human
language data. It provides easy-to-use interfaces to over 50 corpora
and lexical resources such as WordNet, along with a suite of text
processing libraries for classification, tokenization, stemming,
tagging, parsing, and semantic reasoning.''
\+ This is considered one of the leading natural language parsing
libraries, not just for Python.
\begin{seealso}
\footnotesize
\begin{itemize}
\item[$\triangleright$] \href{http://okfnlabs.org/blog/2013/11/11/python-nlp.html}{Natural Language Processing using Python}
\item[$\triangleright$] \href{http://www.ibm.com/developerworks/linux/library/os-pythonnltk/index.html}{Explore Python, machine learning, and the NLTK library}
\item[$\triangleright$] \href{http://www.laurentluce.com/posts/twitter-sentiment-analysis-using-python-and-nltk/}{Twitter sentiment analysis using Python and NLTK}
\end{itemize}
\end{seealso}
\end{frame}
\begin{frame}
\frametitle{SQLAlchemy: portable access to databases}
\href{http://www.sqlalchemy.org/}{SQLAlchemy} is a Python library
that provides portable and powerful access to SQL databases, with a
natural Python syntax.
\+ \href{http://www.sqlalchemy.org/}{SQLAlchemy} frees you and your
code from knowing SQL syntax and the annoying little differences
among DBs: the same code would run witl SQLite, MySQL, PostgreSQL,
MS-SQL, Oracle, etc.
\end{frame}
\begin{frame}
\frametitle{PyCLI: writing command line applications}
The \href{https://pypi.python.org/pypi/pyCLI}{cli package} is a
framework for making simple, correct command line applications in
Python.
\+
With cli, you can quickly add standard command line parsing;
logging; unit and functional testing; and profiling to your CLI
apps.
\end{frame}
\begin{frame}
\frametitle{sh: a module to easily call external programs}
\href{http://amoffat.github.com/sh/}{sh} allows you to call any
program as if it were a function.
\+
It makes very easy to write \texttt{bash}-like scripts in Python.
\+
It supports optional arguments, pipes, I/O redirection, with a
trivial syntax.
\begin{seealso}
\footnotesize
\begin{itemize}
\item[$\triangleright$] Tutorial: \url{http://www.pythonforbeginners.com/systems-programming/how-to-use-sh-in-python/}
\item[$\triangleright$] Reference: \url{http://amoffat.github.io/sh/}
\end{itemize}
\end{seealso}
\end{frame}
\begin{frame}
\frametitle{virtualenv: a tool to create isolated Python environments}
\href{https://pypi.python.org/pypi/virtualenv}{virtualenv} is a very
useful tool to create, as \textit{regular user}, multiple,
indepentend environments and install a variety of Python packages in
them.
\begin{itemize}
\item environments are created and deleted easily (\texttt{rm -rf <directory>}
\item you can install the latest version of a package using
\texttt{pip install <package>}
\item you can have multiple, incompatible environments installed on
the machine and just use them one at a time.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Want more? Look into PyPI}
\href{http://pypi.python.org}{PyPI} is \emph{the} index of Python software packages.
\+ It currently indexes 41306 packages, so the choice is really vast.
\+ Almost all packages can be installed with a single command by
running \href{https://pypi.python.org/pypi/pip}{\texttt{pip install
\emph{packagename}}}.
\includegraphics[width=1\textwidth]{fig/pypi_screenshot.png}
\end{frame}
\end{document}