Closed typeless closed 4 years ago
I am surprised this was not already in there. In any case, I'm currently considering PR #99, which changes the filtering code. I'm putting this issue on hold until that is resolved, but not closing it yet.
I want to clean the data and set the column names like the following:
hdr := df.Filter(
dataframe.F{
Colidx: 0,
Comparator: series.Eq,
Comparando: "Company ID",
},
).Filter(
dataframe.F{
Colidx: 2,
Comparator: series.Eq,
Comparando: "Current month revenue",
},
).Records()
if err := df.SetNames(hdr[1]...); err != nil {
log.Fatal(err)
}
The input table has a multi-row header and only one of the rows is what I need. Since there is no sensible column names before the cleansing. I cannot use the column names as the filter condition either. I think what this PR adds is quite ad-hoc. I'd like to have some better solution. 😆
Merged, thanks!
If you still think there is a better implementation, feel free to try and improve it, but If you really need this, I'm OK with it.
When the column names are not available, we should be able to use a number to index the column.