Suggestions for Python workshop

Y

Yaroslav

Hi, I'm preparing a 2 hour workshop titled "Python for Scientific
Computing", the goal of which is to introduce people to using Python
for their Scientific Computing needs. If you have good examples that
illustrate Python's power for scientific computing, please post them
here.

Here's one example I had in mind -- Power Method for finding dominant
eigenvector:

# Define our matrix
A = array([[2., 1.],
[1., 2.]])

# Define our starting vector
x = array([1.,0.])
x_old = 0.5*x

# Iterate while not converged
while max(x-x_old) > 0.00000001:
x_old = x
x = matrixmultiply(A, x)
x/=max(x)

# Print result
print x
# => [ 1. 1.]
 
F

Fernando Perez

Yaroslav said:
Hi, I'm preparing a 2 hour workshop titled "Python for Scientific
Computing", the goal of which is to introduce people to using Python
for their Scientific Computing needs. If you have good examples that
illustrate Python's power for scientific computing, please post them
here.

These aren't code snippets but full talks, but we're definitely using python
for 'real' research:

http://amath.colorado.edu/faculty/fperez/talks/04_03_ams_athens.pdf
http://amath.colorado.edu/faculty/fperez/talks/04_09_scipy04_mwadap.pdf

Here you'll also find other talks from the recent scipy'04:

http://www.scipy.org/wikis/scipy04/ConferenceSchedule

As far as code examples, I imagine all of scipy's code could be used :)

best,

f

ps. Where are you teaching this? Just curious...
 
C

Cameron Laird

These aren't code snippets but full talks, but we're definitely using python
for 'real' research:

http://amath.colorado.edu/faculty/fperez/talks/04_03_ams_athens.pdf
http://amath.colorado.edu/faculty/fperez/talks/04_09_scipy04_mwadap.pdf

Here you'll also find other talks from the recent scipy'04:

http://www.scipy.org/wikis/scipy04/ConferenceSchedule

As far as code examples, I imagine all of scipy's code could be used :)
.
.
.
I have strong feelings on this subject, only a fraction of which
I'll be able to articulate this week.

First, follow everything Fernando says; he's doing great work.

Second, I see a variety of approaches to Python-for-scientists,
and I hope you're able to end up with a Pythonic one. There's
low-level how-to-ing: "this is an implementation of a
Rayleigh-Ritz algorithm for PDE solution; you can use this in
hydrodynamics to ..." What *really* gets interesting, though,
are comparing Python to other vehicles--Matlab, C++, Fortran--
and, if you're really good, opening the audience's eyes to the
potential of a language which facilitates comprehension, collabor-
ation, and experimentation. Most scientific listeners won't
understand abstraction as it applies to software. Python-for-
scientists represents a great opportunity.
 
F

Fernando Perez

Cameron said:
I have strong feelings on this subject, only a fraction of which
I'll be able to articulate this week.

First, follow everything Fernando says; he's doing great work.

Thanks :) (blushes)
Second, I see a variety of approaches to Python-for-scientists,
and I hope you're able to end up with a Pythonic one. There's
low-level how-to-ing: "this is an implementation of a
Rayleigh-Ritz algorithm for PDE solution; you can use this in
hydrodynamics to ..." What *really* gets interesting, though,
are comparing Python to other vehicles--Matlab, C++, Fortran--
and, if you're really good, opening the audience's eyes to the
potential of a language which facilitates comprehension, collabor-
ation, and experimentation. Most scientific listeners won't
understand abstraction as it applies to software. Python-for-
scientists represents a great opportunity.

Well, that's exactly the credo I've been trying to preach to all who are willing
to listen over the last couple of years. I think I've made progress, at least
by converting some people around me to these tools. But I'm quite interested
in your opinion on the matter.

<blatant plug ahead>

If anyone from the Colorado Front Range area is interested on this subject, I'm
scheduled to give the colloquium at the Mathematics and computer science
department of the Colorado School of Mines in Golden, on Friday Nov. 19th (3pm)
on this very topic. I hope to do justice to python's qualities for scientific
work, but ideas from the c.l.py community are very welcome (I haven't written
the talk yet, so there's time to put it in).

Cheers,

f
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top