help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dataframe demo broken


From: IainIsm
Subject: Dataframe demo broken
Date: Thu, 2 Feb 2012 05:51:23 -0800 (PST)

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



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Dataframe-demo-broken-tp4351484p4351484.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]