numerical-methods

Is there special significance to 16331239353195370.0?

Is there special significance to 16331239353195370.0? Question: Using import numpy as np I’ve noticed that np.tan(np.pi/2) gives the number in the title and not np.inf 16331239353195370.0 I’m curious about this number. Is it related to some system machine precision parameter? Could I have calculated it from something? (I’m thinking along the lines of something similar …

Total answers: 1

Why does math.pow result in ValueError: math domain error?

Why does math.pow result in ValueError: math domain error? Question: Here is the code: exp = 1.79 def calc(t): return pow(t – 1, exp) The input values of t range from 0 to 1 (e.g. 0.04). This code throws a “math domain exception,” but I’m not sure why. How can I solve this? Asked By: …

Total answers: 3

python: least-squares estimation?

python: least-squares estimation? Question: I know how to implement least-squares with elementary matrix decomposition and other operations, but how can I do it in Python? (I’ve never tried to use matrices in Python) (clarification edit to satisfy the shoot-first-and-ask-questions-later -1’er) I was looking for help to find out how to use numerical programming in Python. …

Total answers: 3

How can I use numpy.correlate to do autocorrelation?

How can I use numpy.correlate to do autocorrelation? Question: I need to do auto-correlation of a set of numbers, which as I understand it is just the correlation of the set with itself. I’ve tried it using numpy’s correlate function, but I don’t believe the result, as it almost always gives a vector where the …

Total answers: 14