[Numpy-discussion] loading data with gaps
Fri Apr 4 12:02:45 CDT 2008
Look at the thread posted a couple of weeks ago named: loadtxt and missing
I'm guessing you'll find answers to your questions, if not, don't hesitate
2008/4/3, Tim Michelsen <email@example.com>:
> How can I load a data file (e.g. CSV, DAT) in ASCII which has some gaps?
> The file has been saved with from a spreadsheet program which leaves
> cells with not data empty:
> Would this code be correct:
> ### test_loadtxt.py ###
> import numpy
> import maskedarray
> # load data which has empty 'cells' as beeing saved from spreadsheet:
> # 1,23.
> # 2,13.
> # 3,
> # 4,34.
> data = numpy.loadtxt('./loadtxt_test.csv',dtype=str,delimiter=',')
> # create a masked array with all no data ('', empty cells from CSV) masked
> my_masked_array = maskedarray.masked_equal(data,'')
> * How can I change the data type of my maskedarray (my_masked_array) to
> a type that allows me to perform calulations?
> * Would you do this task differently or more efficient?
> * What possibilities do I have to estimate/interpolate the masked values?
> A example would be nice.
> * How to I convert maskedarray (my_masked_array) to a array without
> masked values?
> Thanks in advance for your help,
> Tim Michelsenholg
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion