converting dataframe to tensor
Closed this issue · 1 comments
miramolin commented
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
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.