bugGNU Octave - Bugs: bug #44967, load() does not load ascii-file...

 
 

bug #44967: load() does not load ascii-file matrix when there is an NA in final column

Submitter:  Malte Hinrichs <maldje>
Submitted:  Thu 30 Apr 2015 09:12:12 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  4 Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 01 May 2015 03:31:55 PM UTC, comment #2: 

Fixed in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/4a41b7d426b6).  This will be a part of the 4.0.0 release.

Rik <rik5>
Group administrator
Thu 30 Apr 2015 09:39:11 PM UTC, comment #1: 

Confirmed.  The problem is not too many NA values.  The following has a lot of NA, but works.



octave:29> x = ones (3)
x =

   1   1   1
   1   1   1
   1   1   1

octave:30> x(:, [1 2]) = NA
x =

    NA    NA     1
    NA    NA     1
    NA    NA     1

octave:31> save -ascii mat5.asc x
octave:32> clear x
octave:33> load -ascii mat5.asc
octave:34> who
Variables in the current scope:

mat5

octave:35> mat5
mat5 =

    NA    NA     1
    NA    NA     1
    NA    NA     1


The problem, however, seems to be that even a single NA value in the final column is enough to stop the parsing of the file.  Also, note that NaN works fine.  It is only NA values that prevent parsing.

Rik <rik5>
Group administrator
Thu 30 Apr 2015 09:12:12 AM UTC, original submission:  

Please check the following example:


octave:1> x=ones(3);
octave:2> x(2,2)=NA;
x =

     1     1     1
     1    NA     1
     1     1     1

octave:3> save("-ascii","x.txt","x")
octave:4> y=load("-ascii","x.txt")
y =

     1     1     1
     1    NA     1
     1     1     1

octave:5> x(:,3)=NA
x =

     1     1    NA
     1     1    NA
     1     1    NA

octave:6> save("-ascii","x.txt","x")
octave:7> y=load("-ascii","x.txt")
error: load: failed to read matrix from file 'x.txt'


Malte Hinrichs <maldje>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by maldje (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-01 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-04-30 rik5 Priority5 - Normal 4
        StatusNone Confirmed
        Release3.8.2 dev
        Operating SystemMac OS Any
        Summaryload() does not load ascii-file matrix, when there are too many NA values: load() does not load ascii-file matrix when there is an NA in final column

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code