The Artima Developer Community
Sponsored Link

Python Answers Forum
python question

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Mike Shoopert

Posts: 1
Nickname: ssangiz
Registered: Jul, 2019

python question Posted: Jul 11, 2019 2:09 AM
Reply to this message Reply
Advertisement
I have 50 files, all in the same sort of format, which I would like to read into arrays in python.

The files look like this:
xa "\t" xb "\" trapX "\t" ext "\t" absolute
: : : : :
: : : : :
: : : : :
N N N N N
There is a title line and then all other entries are doubles, separated by a tab delimeter
So what I want is an array for each of the entries in the file, like:

xa[50][0-N]
xb[50][0-N]
trapX[50][0-N] and so forth
the entreis should ideadlly be numpy duoubles.
The N, ie number of rows in each file may vary, but there is the same amount of data for each observable.
Files have names as: file.1.dat, file.2.dat etc

What is the best way of extracting the data out of these files? This will have to be done in python.

Thanks

Topic: Portable beach umbrella Previous Topic   Next Topic Topic: writing string variable to file

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use