Purpose of `numpy.log1p( )`?

The NumPy docs give a hint: For real-valued input, log1p is accurate also for x so small that 1 + x == 1 in floating-point accuracy. So for example let’s add a tiny non-zero number and 1.0. Rounding errors make it a 1.0. If we try to take the log of that incorrect sum, we get an incorrect result (compare to WolframAlpha): But if we use log1p(), we … Read more

How can I use numpy.correlate to do autocorrelation?

To answer your first question, numpy.correlate(a, v, mode) is performing the convolution of a with the reverse of v and giving the results clipped by the specified mode. The definition of convolution, C(t)=∑ -∞ < i < ∞ aivt+i where -∞ < t < ∞, allows for results from -∞ to ∞, but you obviously can’t store an infinitely long array. So it has to … Read more

load csv into 2D matrix with numpy for plotting

Pure numpy Check out the loadtxt documentation. You can also use python’s csv module: You will have to convert it to your favorite numeric type. I guess you can write the whole thing in one line: result = numpy.array(list(csv.reader(open(“test.csv”, “rb”), delimiter=”,”))).astype(“float”) Added Hint: You could also use pandas.io.parsers.read_csv and get the associated numpy array which can be faster.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)