Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove DataFrame._columns #3116

Closed
ajpotts opened this issue Apr 23, 2024 · 1 comment · Fixed by #3147
Closed

remove DataFrame._columns #3116

ajpotts opened this issue Apr 23, 2024 · 1 comment · Fixed by #3147
Assignees
Labels
enhancement New feature or request

Comments

@ajpotts
Copy link
Contributor

ajpotts commented Apr 23, 2024

Remove DataFrame._columns and use DataFrame.keys() and DataFrame.columns.values as a replacement. This will eliminate redundant storage that needs to be managed and could become out of date.

@ajpotts ajpotts added the enhancement New feature or request label Apr 23, 2024
@ajpotts ajpotts self-assigned this Apr 23, 2024
ajpotts added a commit to ajpotts/arkouda that referenced this issue Apr 29, 2024
ajpotts added a commit to ajpotts/arkouda that referenced this issue Apr 29, 2024
@ajpotts
Copy link
Contributor Author

ajpotts commented Apr 29, 2024

Having researched this, the only reason to keep the ._columns attribute is to preserve the order. The downside is that it could cause inconsistencies if accessed outside the __setitem__ method. To remove this attribute and also preserve the column order we could make DataFrame an OrderedDict rather than a UserDict. However, since the two classes have different APIs it would be a larger refactor. A short term solution would be to enforce that ._columns not be modified outside of the __setitem__ method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant