Dataframe demo broken

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Dataframe demo broken

IainIsm
Hi,

I recently installed the dataframe package, and while the package itself seems to work fine, the demos don't.

In Octave 3.4.3 the output I get for the three demos is as below (also using the [1..3] notation gives an error):

>>> demo('dataframe', 1)
dataframe example 1:
 x=dataframe('octave_frame/data_test.csv')
 disp("Access as a struct: x.VBIAS(1:6)")
 x.VBIAS(1:6)
 pause; disp("Access as a matrix: x(6, 'OK')")
 x(6, "OK")
 pause; disp("Removing the row names:  x.rownames = []");
 x.rownames = []
 pause; disp("Modifying column type: x.types{'Freq'}='uint32'");
 x.types{"Freq"}='uint32'
 pause; disp("Partial extract, returning a dataframe");
 disp("y = x(x.OK=='A'|x.OK=='B', {'Freq', 'VB*', 'C', 'G'}, 'dataframe')")
 y = x(x.OK=='A'|x.OK=='B', {"Freq", "VB*", "C", "G"}, "dataframe")
 pause; disp("Setting rownames")
 disp("y.rownames = char({'low', 'med', 'med', 'high'})");
 y.rownames = char({'low', 'med', 'med', 'high'})
 pause; disp("Partial modification of one column")
 disp("y.Freq('med')=[290e3; 310e3]")
 y.Freq('med') = [290e3; 310e3]
 pause; disp('Complex access');
 disp("y.C('med')([2 1])");
 y.C('med')([2 1])
 pause; disp('Print stats about a dataframe: summary(y)');
 summary(y)

dataframe example 1: failed
fclose: invalid stream number = -1>>> demo('dataframe', 2)
dataframe example 2:
 disp('Modifying a dataframe from a cell array')
  RHS={ 'don''t care', 'idx', 'Vb', 'freq', 'Ib', 'C', 'status', 'comment'
        'yes',     uint16(5), single(3.2), 10000, 1e-11, 6e-13, 'bla', '@'
        'no',     uint16(16), 4, 12000, 2e-11, 4e-13, 7, 'X'};
 disp("Resetting a dataframe: x=dataframe([])");
 x = dataframe([]);
 x(:, :) = RHS
 disp("Overwriting the second line")
 RHS{1, 2} = "idg"; RHS{3, 1}= "No!";
 disp("'x(2, :) = RHS(1:2, :)' will produce two warnings")
 disp("Notice that only the second line content will change");
 disp("x(2, :) = RHS(1:2, :)")
 x(2, :) = RHS(1:2, :)
 pause; disp('same effect, but skipping first column');
 disp("x(1, :) = RHS([1 3], 2:end)");
 x(1, :) = RHS([1 3], 2:end)

Modifying a dataframe from a cell array
Resetting a dataframe: x=dataframe([])
dataframe example 2: failed
regexp: internal error calling pcre_exec
Error code from pcre_exec is -24>>> demo('dataframe', 3)
dataframe example 3:
 disp("same game, but using row indexes.")
 disp("Notice the first field name is empty")
 RHS= { '', 'idx', 'Vb', 'freq', 'Ib', 'C', 'status', 'comment'
        5, uint32(16),   5.3, 11000, 3e-12, 5e-12, "may", "8th"};
 disp("x= dataframe(RHS)")
 x = dataframe(RHS)
 pause; disp("The same effect is achieved by assigning to an empty dataframe")
 x = dataframe([]);
 x(:, :) = RHS

same game, but using row indexes.
Notice the first field name is empty
x= dataframe(RHS)
dataframe example 3: failed
regexp: internal error calling pcre_exec
Error code from pcre_exec is -24>>>

Iain

Reply | Threaded
Open this post in threaded view
|

Re: Dataframe demo broken

IainIsm
I managed to post that waaaaay too soon!

I meant to ask: Is this a known problem where the demo doesn't work out of the box unless some tweaking is done?  If so, how do I go about fixing it please?

I have STFW, but there doesn't seem to be anything on this.

Iain
Reply | Threaded
Open this post in threaded view
|

Re: Dataframe demo broken

CdeMills
In reply to this post by IainIsm
Hello,
I'm the dataframe package author. I found the problems, and will check them this weekend. Thank you for reporting it.

Pascal
Reply | Threaded
Open this post in threaded view
|

Re: Dataframe demo broken

CdeMills
In reply to this post by IainIsm
A new version of the dataframe package has been uploaded solving the issues you saw. Watch for version 0.9 appearing on Sourceforge.

Regards

Pascal