AlexMili / torch-dataframe

Utility class to manipulate dataset from CSV file
MIT License
67 stars 8 forks source link

Error showing df after dropping column. #26

Closed tommy-u closed 8 years ago

tommy-u commented 8 years ago

This exhibits an issue I'm having working with the df after manipulating it. Perhaps 'firstColumn' is not being removed from a data structure after being dropped.

require 'Dataframe'
df = Dataframe()
df:load_table{data=Df_Dict{firstColumn={1,2,3}, secondColumn={4,5,6}}}
df:show() --Shows table as expected. 
df:drop('firstColumn')
df:show() --Error case.

The error:

/Users/tu/torch/install/bin/luajit: ...ch/install/share/lua/5.1/Dataframe/Extensions/column.lua:191: Could not find column: firstColumn
stack traceback:
        [C]: in function 'assert'
        ...ch/install/share/lua/5.1/Dataframe/Extensions/column.lua:191: in function 'get_column'
        ...ch/install/share/lua/5.1/Dataframe/Extensions/output.lua:145: in function '__tostring__'
        ...ch/install/share/lua/5.1/Dataframe/Extensions/output.lua:43: in function 'output'
        ...ch/install/share/lua/5.1/Dataframe/Extensions/output.lua:66: in function 'show'
        run.lua:7: in main chunk
        [C]: in function 'dofile'
        ...s/tu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
        [C]: at 0x01005f5d20
AlexMili commented 8 years ago

Thank you for your report :) The error was already fixed in the next release but not on the master branch. It is now ;)