55 < head >
66 < meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
77
8- < title > Intro to Numpy — numpy</ title >
8+ < title > Intro to Numpy / Scipy — numpy</ title >
99
1010 < link rel ="stylesheet " href ="_static/basic.css " type ="text/css " />
1111 < link rel ="stylesheet " href ="_static/styles.css " type ="text/css " />
4545
4646
4747
48- < article class ="slide level-1 " id ="intro-to-numpy ">
48+ < article class ="slide level-1 " id ="intro-to-numpy-scipy ">
4949
50- < h1 > Intro to Numpy</ h1 >
50+ < h1 > Intro to Numpy / Scipy </ h1 >
5151
52+ < ul class ="simple ">
53+ < li > Chris Barker</ li >
54+ </ ul >
55+ < p > (April 29, 2014)</ p >
5256
5357
5458
5559
5660</ article >
57- < article class ="slide level-2 " id ="numpy ">
61+ < article class ="slide level-2 " id ="scipy ">
5862
59- < h2 > numpy </ h2 >
63+ < h2 > Scipy </ h2 >
6064
61- < p > numpy</ p >
62- < p > Not just for lots of numbers!
63- (but it's great for that!)</ p >
64- < p > < a class ="reference external " href ="http://www.numpy.org/ "> http://www.numpy.org/</ a > }</ p >
65+ < p > The scipy "Stack" is a collection of core packages used for scientific / numerical computing.</ p >
66+ < p > < a class ="reference external " href ="http://www.scipy.org/stackspec.html "> http://www.scipy.org/stackspec.html</ a > </ p >
67+ < p > Many other domain-specific packages area available:</ p >
68+ < blockquote >
69+ < div > Core "stack" is what most people will want, regardless of domain.</ div > </ blockquote >
6570
6671
6772
6873
6974</ article >
70- < article class ="slide level-2 " id ="what-is-numpy ">
75+ < article class ="slide level-2 " id ="what-s-in-the-scipy-stack ">
7176
72- < h2 > what is numpy ?</ h2 >
77+ < h2 > What's in the scipy stack ?</ h2 >
7378
74- < p > An N-Dimensional array object}</ p >
79+ < ul class ="simple ">
80+ < li > Python (< a class ="reference external " href ="http://www.python.org "> http://www.python.org</ a > )</ li >
81+ < li > NumPy (< a class ="reference external " href ="http://www.numpy.org "> http://www.numpy.org</ a > )</ li >
82+ < li > SciPy library (< a class ="reference external " href ="http://www.scipy.org "> http://www.scipy.org</ a > )</ li >
83+ < li > Matplotlib (< a class ="reference external " href ="http://matplotlib.org/ "> http://matplotlib.org/</ a > )</ li >
84+ < li > IPython (< a class ="reference external " href ="http://ipython.org/ "> http://ipython.org/</ a > )</ li >
85+ < li > nose (< a class ="reference external " href ="https://nose.readthedocs.org "> https://nose.readthedocs.org</ a > )</ li >
86+ < li > pandas (< a class ="reference external " href ="http://pandas.pydata.org/ "> http://pandas.pydata.org/</ a > )</ li >
87+ < li > Sympy (< a class ="reference external " href ="http://sympy.org/ "> http://sympy.org/</ a > )</ li >
88+ </ ul >
89+
90+
91+
92+
93+ </ article >
94+ < article class ="slide level-2 " id ="numpy ">
95+
96+ < h2 > numpy</ h2 >
97+
98+ < p > numpy is the core package that the rest of the scipy stack is built on. Mostly what I'll talk about here.</ p >
99+ < p > Not just for lots of numbers!
100+ (but it's great for that!)</ p >
101+ < p > < a class ="reference external " href ="http://www.numpy.org/ "> http://www.numpy.org/</ a > </ p >
102+ < p > An N-Dimensional array object</ p >
75103< p > A whole pile of tools for operations on/with that object.</ p >
76104
77105
@@ -160,7 +188,7 @@ <h2>What is an nd array?</h2>
160188</ li >
161189</ ul >
162190</ div > </ blockquote >
163- < p > demos : < tt class ="docutils literal "> < span class ="pre "> memory.py </ span > </ tt > and < tt class =" docutils literal " > < span class =" pre " > structure.py </ span > </ tt > </ p >
191+ < p > demo : < tt class ="docutils literal "> < span class ="pre "> mem_struct.ipynb </ span > </ tt > </ p >
164192
165193
166194
@@ -196,11 +224,7 @@ <h2>Built-in Data Types</h2>
196224</ dd >
197225</ dl >
198226</ li >
199- < li > < dl class ="first docutils ">
200- < dt > Bool</ dt >
201- < dd > < p class ="first last "> 8 bit</ p >
202- </ dd >
203- </ dl >
227+ < li > < p class ="first "> Bool -- 8 bit</ p >
204228</ li >
205229< li > < dl class ="first docutils ">
206230< dt > Python Object</ dt >
@@ -210,21 +234,21 @@ <h2>Built-in Data Types</h2>
210234</ li >
211235</ ul >
212236</ div > </ blockquote >
213- < p > demo: < tt class ="docutils literal "> < span class ="pre "> object.py </ span > </ tt > } </ p >
237+ < p > demo: < tt class ="docutils literal "> < span class ="pre "> object.ipnb </ span > </ tt > </ p >
214238
215239
216240
217241
218242</ article >
219- < article class ="slide level-2 " id ="compund -dtypes ">
243+ < article class ="slide level-2 " id ="compound -dtypes ">
220244
221- < h2 > Compund dtypes</ h2 >
245+ < h2 > Compound dtypes</ h2 >
222246
223247< blockquote >
224248< div > < ul >
225249< li > < dl class ="first docutils ">
226250< dt > Can define any combination of other types</ dt >
227- < dd > < p class ="first last "> Still Homogenous : Array of structs.</ p >
251+ < dd > < p class ="first last "> Still Homogeneous : Array of structs.</ p >
228252</ dd >
229253</ dl >
230254</ li >
@@ -246,15 +270,24 @@ <h2>Compund dtypes</h2>
246270
247271< h2 > Array Constructors:</ h2 >
248272
249- < p > From scratch:</ p >
250- < p > < tt class ="docutils literal "> < span class ="pre "> ones(),</ span > < span class ="pre "> zeros(),</ span > < span class ="pre "> empty(),</ span > < span class ="pre "> arange(),</ span > < span class ="pre "> linspace(),</ span > < span class ="pre "> logspace()</ span > </ tt > </ p >
251- < p > ( Default dtype: < tt class ="docutils literal "> < span class ="pre "> np.float64</ span > </ tt > )</ p >
252- < p > From sequences:</ p >
253- < p > < tt class ="docutils literal "> < span class ="pre "> array(),</ span > < span class ="pre "> asarray()</ span > </ tt > </ p >
254- < p > ( Build from any sequence )</ p >
255- < blockquote >
256- < div > From binary data:</ div > </ blockquote >
257- < p > < tt class ="docutils literal "> < span class ="pre "> fromstring(),</ span > < span class ="pre "> frombuffer(),</ span > < span class ="pre "> fromfile()</ span > </ tt > </ p >
273+ < dl class ="docutils ">
274+ < dt > From scratch:</ dt >
275+ < dd > < ul class ="first simple ">
276+ < li > < tt class ="docutils literal "> < span class ="pre "> ones(),</ span > < span class ="pre "> zeros(),</ span > < span class ="pre "> empty(),</ span > < span class ="pre "> arange(),</ span > < span class ="pre "> linspace(),</ span > < span class ="pre "> logspace()</ span > </ tt > </ li >
277+ </ ul >
278+ < p class ="last "> ( Default dtype: < tt class ="docutils literal "> < span class ="pre "> np.float64</ span > </ tt > )</ p >
279+ </ dd >
280+ < dt > From sequences:</ dt >
281+ < dd > < ul class ="first last simple ">
282+ < li > < tt class ="docutils literal "> < span class ="pre "> array(),</ span > < span class ="pre "> asarray()</ span > </ tt > ( Build from any sequence )</ li >
283+ </ ul >
284+ </ dd >
285+ < dt > From binary data:</ dt >
286+ < dd > < ul class ="first last simple ">
287+ < li > < tt class ="docutils literal "> < span class ="pre "> fromstring(),</ span > < span class ="pre "> frombuffer(),</ span > < span class ="pre "> fromfile()</ span > </ tt > </ li >
288+ </ ul >
289+ </ dd >
290+ </ dl >
258291< p > Assorted linear algebra standards:</ p >
259292< p > < tt class ="docutils literal "> < span class ="pre "> eye(),</ span > < span class ="pre "> diag()</ span > </ tt > , etc.</ p >
260293< p > demo: < tt class ="docutils literal "> < span class ="pre "> constructors.py</ span > </ tt > </ p >
@@ -333,18 +366,44 @@ <h2>Working with compiled code</h2>
333366
334367
335368</ article >
336- < article class ="slide level-2 " id ="numpy-persistance ">
369+ < article class ="slide level-2 " id ="text-file-i-o ">
370+
371+ < h2 > Text File I/O</ h2 >
372+
373+ < p > Loading from text (CSV, etc):</ p >
374+ < blockquote >
375+ < div > < ul class ="simple ">
376+ < li > < tt class ="docutils literal "> < span class ="pre "> np.loadtxt</ span > </ tt > </ li >
377+ < li > < tt class ="docutils literal "> < span class ="pre "> np.genfromtxt</ span > </ tt > ( a few more features )</ li >
378+ </ ul >
379+ </ div > </ blockquote >
380+ < p > Saving as text (CSV):</ p >
381+ < blockquote >
382+ < div > < ul class ="simple ">
383+ < li > < tt class ="docutils literal "> < span class ="pre "> np.savetxt()</ span > </ tt > </ li >
384+ </ ul >
385+ </ div > </ blockquote >
386+
387+
388+
389+
390+ </ article >
391+ < article class ="slide level-2 " id ="numpy-persistence ">
337392
338- < h2 > numpy persistance :</ h2 >
393+ < h2 > Numpy Persistence :</ h2 >
339394
340- < p > < tt class ="docutils literal "> < span class ="pre "> .tofile()</ span > < span class ="pre "> /</ span > < span class ="pre "> fromfile()</ span > </ tt > </ p >
395+ < p > < tt class ="docutils literal "> < span class ="pre "> np .tofile()</ span > < span class ="pre "> /</ span > < span class ="pre "> np. fromfile()</ span > </ tt > </ p >
341396< blockquote >
342397< div > -- Just the raw bytes, no metadata</ div > </ blockquote >
343398< p > pickle</ p >
344- < p > < tt class ="docutils literal "> < span class ="pre "> savez()</ span > </ tt > -- numpy zip format</ p >
399+ < p > < tt class ="docutils literal "> < span class ="pre "> np. savez()</ span > </ tt > -- numpy zip format</ p >
345400< p > Compact: binary dump plus metadata</ p >
346- < p > netcdf</ p >
347401< dl class ="docutils ">
402+ < dt > netcdf</ dt >
403+ < dd > < ul class ="first last simple ">
404+ < li > NetCDF4</ li >
405+ </ ul >
406+ </ dd >
348407< dt > Hdf</ dt >
349408< dd > < ul class ="first last simple ">
350409< li > Pyhdf</ li >
0 commit comments