All Samples(6995) | Call(6445) | Derive(0) | Import(550)
arange([start,] stop[, step,], dtype=None)
Return evenly spaced values within a given interval.
Values are generated within the half-open interval ``[start, stop)``
(in other words, the interval including `start` but excluding `stop`).
For integer arguments the function is equivalent to the Python built-in
`range <http://docs.python.org/lib/built-in-funcs.html>`_ function,
but returns a ndarray rather than a list.
Parameters
----------
start : number, optional
Start of interval. The interval includes this value. The default
start value is 0.
stop : number
End of interval. The interval does not include this value.
step : number, optional
Spacing between values. For any output `out`, this is the distance
between two adjacent values, ``out[i+1] - out[i]``. The default
step size is 1. If `step` is specified, `start` must also be given.
dtype : dtype
The type of the output array. If `dtype` is not given, infer the data
type from the other input arguments.
Returns
-------
out : ndarray
Array of evenly spaced values.
For floating point arguments, the length of the result is
``ceil((stop - start)/step)``. Because of floating point overflow,
this rule may result in the last element of `out` being greater
than `stop`.
See Also
--------
linspace : Evenly spaced numbers with careful handling of endpoints.
ogrid: Arrays of evenly spaced numbers in N-dimensions
mgrid: Grid-shaped arrays of evenly spaced numbers in N-dimensions
Examples
--------
>>> np.arange(3)
array([0, 1, 2])
>>> np.arange(3.0)
array([ 0., 1., 2.])
>>> np.arange(3,7)
array([3, 4, 5, 6])
>>> np.arange(3,7,2)
array([3, 5])src/p/y/pydy-HEAD/examples/rollingdisc/plot_rollingdisc.py pydy(Download)
#!/usr/bin/env python import rollingdisc_lib as rd from scipy.integrate import odeint from numpy import array, arange, zeros, roots, sin, cos, tan, pi, complex import matplotlib.pyplot as plt # Dimensions of a quarter
def plot_eval():
#### Eigenvalue plot #####
u2 = arange(-30, 30.01, 0.01, dtype=complex)
n = len(u1)
eval = zeros((n,3), dtype=complex)
for i, u in enumerate(u1):
eval[i] = rd.evals(u, (g, r))
ti = 0.0 ts = 0.001 tf = 1.0 t = arange(ti, tf+ts, ts) n = len(t) # Integrate the differential equations x = odeint(rd.eoms, xi, t, args=(params,))
src/o/b/obspy-HEAD/misc/examples/generate_seismogram.py obspy(Download)
nw=6./f/dt
nw=2*np.floor(nw/2)+1
nc=np.floor(nw/2)
i=np.arange(1,nw,dtype='float64')
alpha=(nc-i+1)*f*dt*np.pi
beta=alpha**2
return (1.0-beta*2.0)*np.exp(-beta)
plt.plot(wavelet)
plt.title("Ricker Wavelet")
plt.subplot(312)
plt.stem(np.arange(N),greenfct,markerfmt='.',basefmt='b-')
plt.title("Greens Function")
plt.ylim(-1.5,1.5)
plt.subplot(313)
src/m/a/matplotlib-HEAD/matplotlib/examples/pylab_examples/mri_with_eeg.py matplotlib(Download)
print 'loading eeg', eegfile
data = np.fromstring(file(eegfile, 'rb').read(), float)
data.shape = numSamples, numRows
t = 10.0 * np.arange(numSamples, dtype=float)/numSamples
ticklocs = []
ax = subplot(212)
xlim(0,10)
xticks(np.arange(10))
src/m/a/matplotlib-HEAD/examples/pylab_examples/mri_with_eeg.py matplotlib(Download)
print 'loading eeg', eegfile
data = np.fromstring(file(eegfile, 'rb').read(), float)
data.shape = numSamples, numRows
t = 10.0 * np.arange(numSamples, dtype=float)/numSamples
ticklocs = []
ax = subplot(212)
xlim(0,10)
xticks(np.arange(10))
src/m/a/Matplotlib--JJ-s-dev-HEAD/examples/pylab_examples/mri_with_eeg.py Matplotlib--JJ-s-dev(Download)
print 'loading eeg', eegfile
data = np.fromstring(file(eegfile, 'rb').read(), float)
data.shape = numSamples, numRows
t = 10.0 * np.arange(numSamples, dtype=float)/numSamples
ticklocs = []
ax = subplot(212)
xlim(0,10)
xticks(np.arange(10))
src/m/a/matplotlib-HEAD/py4science/examples/numpy_wrap/swig/testSeries.py matplotlib(Download)
def testIntNegate(self):
"Test the intNegate function"
myArray = N.arange(5,dtype='i')
Series.intNegate(myArray)
N.testing.assert_array_equal(myArray, N.array([0,-1,-2,-3,-4]))
#######################################################
def testDoubleNegate(self):
"Test the doubleNegate function"
myArray = N.arange(5) * 1.0
Series.doubleNegate(myArray)
N.testing.assert_array_equal(myArray, N.array([0.,-1.,-2.,-3.,-4.]))
#########################################################
src/m/a/matplotlib-HEAD/py4science/examples/iterators_example.py matplotlib(Download)
}
""" % (dt, dt, dt)
b = np.arange(4, dtype=a.dtype)
print '\n A B '
print a, b
# this reshaping is redundant, it would be the default broadcast
src/m/a/matplotlib-HEAD/py4science/examples/logistic/exercise01.py matplotlib(Download)
logmap = Logistic(0.9) x = logmap.trajectory(x0, 100) y = logmap.trajectory(y0, 100) ind = np.arange(len(x), dtype=float) # x-y \sim epsilon exp(lambda * t) # log(|x-y|) = log(epsilon) + lambda*t (b=log(epsilon) and m=lambda)
src/m/a/matplotlib-HEAD/matplotlib/examples/mplot3d/mixed_subplots_demo.py matplotlib(Download)
################ # First subplot ################ t1 = np.arange(0.0, 5.0, 0.1) t2 = np.arange(0.0, 5.0, 0.02) t3 = np.arange(0.0, 2.0, 0.01)
# Second subplot ################# ax = fig.add_subplot(2, 1, 2, projection='3d') X = np.arange(-5, 5, 0.25) xlen = len(X) Y = np.arange(-5, 5, 0.25) ylen = len(Y)
src/m/a/matplotlib-HEAD/examples/mplot3d/mixed_subplots_demo.py matplotlib(Download)
################ # First subplot ################ t1 = np.arange(0.0, 5.0, 0.1) t2 = np.arange(0.0, 5.0, 0.02) t3 = np.arange(0.0, 2.0, 0.01)
# Second subplot ################# ax = fig.add_subplot(2, 1, 2, projection='3d') X = np.arange(-5, 5, 0.25) xlen = len(X) Y = np.arange(-5, 5, 0.25) ylen = len(Y)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next