hosseinmoein / DataFrame

C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
https://hosseinmoein.github.io/DataFrame/
BSD 3-Clause "New" or "Revised" License
2.54k stars 313 forks source link

Can't get_view #220

Closed sghofrany closed 1 year ago

sghofrany commented 1 year ago

I'm having trouble getting a view using a vector of column names, could you please provide a few examples of how I should go about doing that? Here is what I am currently doing:

// dataframe 
using index_type = unsigned long;
hmdf::StdDataFrame<index_type> dataframe;

// we add data and columns... etc

std::vector<char *> view_cols{"AREA_ID"};
hmdf::DataFrameView<index_type> view = dataframe.get_view<index_type>(view_cols);

Getting an error saying image

hosseinmoein commented 1 year ago

The example is in the docs here: https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/get_data.html

Is column "AREA_ID" of same type as your index column?

hosseinmoein commented 1 year ago

One issue might be that the function signature requires:

std::vector<const char *> 

you have

std::vector<char *>
sghofrany commented 1 year ago

Thanks, I believe it was some weird template resolution in CLion.