[SciPy-user] scipy.io.read_array: NaN in data file

Dharhas Pothina Dharhas.Pothina at twdb.state.tx.us
Tue Mar 10 13:01:22 EDT 2009


So this would need svn versions of numpy & the timeseries scikit? What is the roadmap for release versions? 

my only other concern would be whether tsfromtxt would choke if duplicate dates were present in the data file. I still haven't found a good way in python to remove duplicate dates in general. 

thanks,

- dharhas

>>> Pierre GM <pgmdevlist at gmail.com> 3/10/2009 11:54 AM >>>

On Mar 10, 2009, at 12:44 PM, Dharhas Pothina wrote:

>
>>> so does np.genfromtxtx also deal with missing values in a file?
>> Yep:
>
> sweet. This is going to be very useful.

That was the whole aim of the game ;)

>
> This was just an example I made up. But most of the files I'm  
> reading are in the format :
>
> columns that define date followed by columns of various data
>
> Could you run me through the commands to go from the file containing  
> the data to the timeseries masking missing data in the process?
>
> ie. can StringIO read from a file or do I need to load the data  
> first and then call StringIO and then call tsfromtxt() to reread the  
> file?

ts.tsfromtxt is just a tailored version of np.genfromtxt. The input  
can be a filename ("data.txt"), a file (gzip version supported), or a  
string content (a la StringIO). Just use datecols to precise what  
column should be interpreted as date, your delimiter, any specific  
string representing a missing data (eg, "NaN". By default, '' is  
recognized), any additional converter... Just check the docstrings of  
ts.tsfromtxt and np.genfromtxt for more info, and let us know how we  
can improve them.


_______________________________________________
SciPy-user mailing list
SciPy-user at scipy.org 
http://mail.scipy.org/mailman/listinfo/scipy-user




More information about the SciPy-User mailing list