Archive

Archive for August, 2011

We Feel Fine

August 16, 2011 Leave a comment

We Feel Fine / by Jonathan Harris and Sep Kamvar.

Just found a very interesting website. People say that right now the facebook and twitter is the most “noisy” country — millions of users make them even comparable to a real country. But, still we have limited understanding of these kingdoms, and of course their people. Are people happy there, or sad? How much they reflect the true feels of people living in the real world, and through what kind symbols we can identify their mood?

 

 

Categories: Data Mining, Visualization

Use numpy.fromfunction to avoid for-loop

August 1, 2011 Leave a comment

Using numpy.fromfunction to avoid for-loop over a matrix. Does it look like the ‘map’ function 🙂

An example of computing the quantized perturbed cat map:

from numpy import *
def quantum_cat_numeric(N,kappa):
    alpha = 2.0*pi/N
    mat_fn = lambda k,l: alpha*(k*k-k*l+l*l)
    phi = fromfunction(mat_fn,(N,N))+(kappa/alpha)*sin(alpha*arange(N))
    return (1.0/sqrt(N))*exp(1j*phi)

Another way to optimize the speed could be to use the Scipy.weave inline c-code, and code this loop using c/c++.

Categories: Programming, Python

Nice quotes

August 1, 2011 1 comment

The voyage of discovery is not in seeking new landscapes but in having new eyes.

— Marcel Proust

Discovery is seeing what everyone else has seen and thinking what no one else has thought.

— Albert Szent-Gyorgi

via Beyond the Basics — NumPy

Categories: Quotes Tags: