-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Closing CandidateMay be closeable, needs more eyeballsMay be closeable, needs more eyeballsEnhancementIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Description
xref #8994
xref #5904
xref #8572
This might be a bit controversial, but the issues raised in #8994 and #5904
point to some continued confusion w.r.t. attribute setting 'being' column setting
so if we now have
df = DataFrame({'A' : [1,2,3], 'B' : 5 })
df.C = 5
is an attribute set
it could be a column set
e.g. de-facto df['C'] = 5
If someone actually wants an attribute to 'stick' around. (meaning they would have to intercept the __finalize__
methods and actually deal with them properly, then I think it is reasonable to also have them add to the _internal_names
as well (see #8572)
So basically would try to set a column (unless its an internal name).
(note that getattr
is de-facto already equivalent to __getitem__
, e.g. df.B === df['B']
)
(don't mind my JS equivalence notion :)
Metadata
Metadata
Assignees
Labels
Closing CandidateMay be closeable, needs more eyeballsMay be closeable, needs more eyeballsEnhancementIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves