[SciPy-User] load file with "header" in the bottom of the file.

Petro khoroshyy@gmail....
Sun Mar 18 05:04:18 CDT 2012


Thanks.
Genfromtxt solved my problem.

On Mar 17, 5:32 pm, Warren Weckesser <warren.weckes...@enthought.com>
wrote:
> On Fri, Mar 16, 2012 at 9:26 AM, Petro <khoros...@gmail.com> wrote:
> > Hi all.
> > numpy.loadtxt allows to skip headers line.
> > I have a lot of tab-delimited files were description is on the bottom.
> > Does anybody know an easy  way  to read such file.
> > Thanks in advance.
> > Petro.
>
> numpy.genfromtxt has a 'skip_footer' argument for ignoring lines at the end
> of the file.  For example:
>
> In [5]: !cat test.tsv
> 100    200    300
> 400    500    600
> This is a test.
>
> In [6]: a = genfromtxt('test.tsv', delimiter='\t', skip_footer=1)
>
> In [7]: a
> Out[7]:
> array([[ 100.,  200.,  300.],
>        [ 400.,  500.,  600.]])
>
> Warren
>
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-U...@scipy.org
> >http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-U...@scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user


More information about the SciPy-User mailing list