Menu

#92 stk_dataframe: Accept char `colnames` argument when there is only one column

2.6
closed
nobody
None
2018-09-20
2018-09-18
Julien Bect
No

stk_dataframe currently (2.5.1) accepts a char colnames argument when there is only one column in the case where x is a double array:

>> stk_init;
>> df1 = stk_dataframe (rand (4, 1), 'x')

df1 = <4x1 stk_dataframe array>

   :         x

 * :  0.814724
 * :  0.905792
 * :  0.126987
 * :  0.913376

but not when x is itself an stk_dataframe object:

>> df2 = stk_dataframe (df1, 'y')
Error using stk_dataframe (line 96)
colnames should be either a cell array of strings or [].

>> df2 = stk_dataframe (df1, {'y'})

df2 = <4x1 stk_dataframe array>

   :         y

 * :  0.814724
 * :  0.905792
 * :  0.126987
 * :  0.913376

Discussion

  • Julien Bect

    Julien Bect - 2018-09-20
    • status: open --> closed
     
MongoDB Logo MongoDB