AlexMili / torch-dataframe

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

converting dataframe to tensor #27

Closed miramolin closed 8 years ago

miramolin commented 8 years ago

Hi,

Assuming that df is initialised as a dataframe, and that I use df:load_csv(filepath) to open the .csv file, before running print(df:shape()) to return its dimensions, is there an obvious way to convert df to a tensor? I tried new_tensor = torch.Tensor(df) but this didn't work.

It would be nice if the best method to do this was in the readme.

gforge commented 8 years ago

Just use df:to_tensor(), it's in the README under Exporting.

Btw - if you're starting to use the package then use the dev-version as we will merge it the coming days into the master.