[SciPy-user] NumPy in Teaching

Travis Oliphant oliphant@ee.byu....
Wed Feb 28 17:15:11 CST 2007


David Warde-Farley wrote:

>On 28-Feb-07, at 5:31 PM, Travis Oliphant wrote:
>
>  
>
>>Students were given the option to use Python or MATLAB.  Most chose
>>MATLAB because it was installed on the computers they had access  
>>to.  It
>>is also the language used when other teachers teach the course.
>>
>>NumPy/SciPy was a complete replacement for MATLAB however.  I did  
>>all of
>>the labs using NumPy/SciPy and they worked fine.
>>    
>>
>
>Travis,
>
>Can I ask how you (or anyone else) deals with saving a "workspace"  
>when doing interactive numerical work in Python? I'd imagine this  
>might be important in an educational setting, and I'm remiss to still  
>be without an equivalent to Matlab's "save" (I understand the  
>difficulty in serializing a Python namespace though).
>  
>
You can save .mat files (which I've done in the past) by passing in a 
list of the names to save to the file to scipy's  scipy.io.savemat function.

I've also used scipy's scipy.io.save command with success in the past.   
The problem with pickling is the copying that occurs to a string before 
pickling can occur.   I think something a little more specialized to 
NumPy would be possible using the .tofile() method. 

There has been some nice work on SciPy's io functionality lately which 
includes using memory-mapping techniques.  It has not been completely 
documented yet, however.

-Travis



More information about the SciPy-user mailing list