[SciPy-user] Problem with arange
Fernando Perez
fperez at colorado.edu
Thu Nov 6 13:53:02 EST 2003
Travis Oliphant wrote:
>
> Francesc Alted wrote:
>
>>A Dijous 06 Novembre 2003 07:49, Fernando Perez va escriure:
>>
>>
>>>def frange(xini,xfin=None,delta=None,**kw):
>>> """frange([start,] stop[, step, keywords]) -> list of floats
>>>
>>> Return a Numeric array() containing a progression of floats. Similar
>>>to arange(), but defaults to a closed interval.
>>
>>
>
> Apparently most are unfamiliar with SciPy's linspace and r_[]
> functionality (I never use arange)
>
> a = r[-1:1:100j] gives 100 points between -1 and 1
> a = linspace(-1,1,100) # endpoint defaults to 1
Well, I actually wrote this code long before I was aware even of scipy :)
But you're right, I didn't know about those. Still, my little frange is
useful when I don't want to load all of scipy but just need Numeric + a few
simple utilities for plotting or testing things.
Thanks for the pointer, though. As time goes by, I'm converting more and more
of my daily use to scipy...
Best,
f
More information about the SciPy-User
mailing list