Numerical Python question

David Mertz mertz at gnosis.cx
Sun Oct 12 04:06:59 EDT 2003


mcrider at bigfoot.com (2mc) wrote previously:
|Assume an array in Numerical Python, the contents of which are the
|daily open, high, low, and last prices of the DOW Jones Industrial
|Average for its entire history.

I'm not sure exactly where in the array the various highs and lows are
stored (different rows?).

But in general, an average is 'sum(highs)/len(highs)'.  The version of
'sum()' in Numeric will work a lot faster though... although it makes no
difference for 10 prices.  If you start worrying about a million prices,
you might see a significant boost using Numeric.

I have an intro article on Numerical Python forthcoming at IBM dW. But
the manual for Numeric is quite excellent to start with.  Still, the
package is probably overkill for the simple and small operations
mentioned.

Yours, David...

--
mertz@  | The specter of free information is haunting the `Net!  All the
gnosis  | powers of IP- and crypto-tyranny have entered into an unholy
.cx     | alliance...ideas have nothing to lose but their chains.  Unite
        | against "intellectual property" and anti-privacy regimes!
-------------------------------------------------------------------------






More information about the Python-list mailing list