bugGNU Octave - Bugs: bug #56263, [octave forge] (dataframe)...

 
 

bug #56263: [octave forge] (dataframe) dataframe ignores second line when reading csv file with all strings

Submitted by:  Bo <bpeng2000>
Submitted on:  Fri 03 May 2019 05:26:22 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Bo Open/Closed:  Open
Release:  other Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 14 Jun 2019 02:37:45 PM UTC, comment #3: 

I tried dataframe fron the repo, and it appears to work ok

If I checkout the dataframe-1.2.0 tag, it does the same as the inital comment, so it appears to have been fixed, just not in a release.

John Donoghue <lostbard>
Project Member
Wed 08 May 2019 08:45:08 PM UTC, comment #2: 

Hello,
the purpose of a second line with all chars is to indicate columns type. This line was silently removed.

I changed the behaviour: the second line is removed if
1) all fields are char
and
2) all fields are valid argument for the "cast" function

I'll release shortly a new version

Regards

Pascal

Pascal Dupuis <cdemills>
Project Member
Sat 04 May 2019 04:57:41 PM UTC, comment #1: 

Confirmed with dev Octave (6.0.0) & dataframe-1.2.0.

I tried to have a look to see if it were something simple but dataframe.m is quite a complicated function (and I actually lack time).

cc'ing package maintainer.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 03 May 2019 05:26:22 PM UTC, original submission:  

With the attached csv files.

For dataframe with all characters

'name','mask','weapon'
'Leonardo','blue','ninjatos'
'Donatello','purple','bo'
'Michelangelo','orange','nunchaku'
'Raphael','red','sai'

pkg load dataframe
dataframe('dataframe.csv')

ans = dataframe with 3 rows and 3 columns
Src: dataframe.csv
_1         name   mask   weapon
Nr         char   char     char
1    Donatello purple       bo
2 Michelangelo orange nunchaku
3      Raphael    red      sai

The second line is ignored. For a csv file with similar content but a numeric column,

'name','num','weapon'
'Leonardo',12,'ninjatos'
'Donatello',34,'bo'
'Michelangelo',56,'nunchaku'
'Raphael',78,'sai'

loading it yields 4 rows correctly

dataframe('dataframe_with_number.csv')
ans = dataframe with 4 rows and 3 columns
Src: dataframe_with_number.csv
_1         name    num   weapon
Nr         char double     char
1     Leonardo     12 ninjatos
2    Donatello     34       bo
3 Michelangelo     56 nunchaku
4      Raphael     78      sai

Bo <bpeng2000>

 

(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 lostbard (Posted a comment)
  • -email is unavailable- added by cdemills (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by bpeng2000 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-04 philipnienhuis StatusNone => Confirmed
        Carbon-Copy- => Added cdemills@gmail.com
    2019-05-03 siko1056 Summarydataframe ignores second line when reading csv file with all strings => [octave forge] (dataframe) dataframe ignores second line when reading csv file with all strings

    Back to the top


    Powered by Savane 3.5