[Tutor] The exec command and namespaces

2012-08-10 Thread Jaidev Deshpande
Hi, Supposed I have a string containing a python script and I exec that script. Is there a way to keep track of the variables that this exec() command creates? Say, >>> s = 'for i in range(10):\n\tprint i\n\n' >>> exec(s) 0 1 2 3 4 5 6 7 8 9 Is there a way to ascertain that the variable 'i' wa

[Tutor] Importing functions in IPython

2012-01-22 Thread Jaidev Deshpande
Dear List, Suppose I have a function myfunc() in a module called mymodule.py As usual, I import this function in IPython with In[1]: from mymodule import myfunc Now if I find that there is something wrong with myfunc, I can open mymodule.py with a suitable editor and make the required changes.

[Tutor] Cython vs Python-C API

2011-11-14 Thread Jaidev Deshpande
Hi I need to perform cubic spline interpolation over a range of points, and I have written the code for the same in C and in Python. The interpolation is part of a bigger project. I want to front end for the project to be Python. Ideally I want Python only to deal with data visualization and i/o,

[Tutor] Using Python to send signals to the USB port

2011-08-17 Thread Jaidev Deshpande
Hi Is there some way I can use Python to send data through a USB port and control the data in real-time? (For instance, I can make a sinusoidal wave of a given specification, and visualize it using NumPy / Matplotlib. How can I send the digitized form of this array through a USB port, and then co

[Tutor] PCA on sparse matrices, tolerance of eigenvalues

2011-02-23 Thread Jaidev Deshpande
Dear all, I tried using the 'scipy.sparse.eigs' tool for performing principal component analysis on a matrix which is roughly 80% sparse. First of all, is that a good way to go about it? Second, the operation failed when the function failed to converge on accurate eigenvalues. I noticed the 'tol

[Tutor] reading large text file as numpy array

2011-02-22 Thread Jaidev Deshpande
Dear All I have a large text file with more than 50k lines and about 784 floats in each line. How can I read the whole file as a single numpy array? Also, is it possible to save a session (like in MATLAB) and reload it later? thanks ___ Tutor maillist

[Tutor] Backpropagation Learning in Python

2011-02-13 Thread Jaidev Deshpande
Dear All Please suggest a link to tutorials for backpropagation and other neural network training algorithms through Python. Any other commentary is welcome, as I am new to both Python and Neural Networks. ___ Tutor maillist - Tutor@python.org To unsu

[Tutor] Python vs. MATLAB

2010-12-06 Thread Jaidev Deshpande
Dear all What advantages does Python have over MATLAB as a programming language, (not the computing environment of MATLAB)? Also, wikipedia says Python is an interpreted language, what does that mean? ___ Tutor maillist - Tutor@python.org To unsubscri