def linspace2(a, b, n, dtype=None):
a = linspace(a, b, n + <NUM_LIT:1>, dtype=dtype)[:-<NUM_LIT:1>]<EOL>if len(a) > <NUM_LIT:1>:<EOL><INDENT>diff01 = ((a[<NUM_LIT:1>] - a[<NUM_LIT:0>]) / <NUM_LIT:2>).astype(a.dtype)<EOL>a += diff01<EOL><DEDENT>return a<EOL>
similar to numpy.linspace but excluding the boundaries

    this is the normal numpy.linspace:

    >>> print linspace(0,1,5)
    [ 0.    0.25  0.5   0.75  1.  ]

    and this gives excludes the boundaries:

    >>> print linspace2(0,1,5)
    [ 0.1  0.3  0.5  0.7  0.9]