Removing a column that is not in the columnset is error
import datatable as dt
from datatable import f
#
#print(dt.__version__)
# '1.0.0'
df1 = dt.Frame({'a':[1, 2, 3], 'b':[2, 3, 4],'c':[1., 2., 3.]})
df1[:, f[:].remove(f['d'])]
#
# KeyError: Column d does not exist in the Frame; did you mean a, b or c?
@ztsweet , the error message seems right. What is your expectation?
@ztsweet neat… @st-pasha @oleksiyskononenko can weigh in on this … seems like a bug
@ztsweet kindly add the datatable version. Edit it using the guidelines, so the maintainers can properly look into it
@samukweku the datatable's version is '1.0.0'
So, either the behavior is wrong here (i.e. there should not be an exception), or the documentation is wrong.
But which one? What are your guys' thoughts on this?
Throwing an error like it's done now seems more appropriate to me. I suggest updating the documentation to match the behaviour.
The documentation seems the right way to go, if we are treating it like a set
@oleksiyskononenko what are your thoughts on this?
@pradkrish The Python's .remove() method results in an error for both lists and sets, when the element to be removed is absent in the list/set.
l = ["a", "b", "c"]
l.remove("d") #ValueError: list.remove(x): x not in list
s = {"a", "b", "c"}
s.remove("d") #KeyError: 'd'
So my feeling is that we need to adjust documentation.