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

ENH: Adding back lookup or value setting by indices #47992

Closed
1 of 3 tasks
jasperhyp opened this issue Aug 6, 2022 · 2 comments
Closed
1 of 3 tasks

ENH: Adding back lookup or value setting by indices #47992

jasperhyp opened this issue Aug 6, 2022 · 2 comments
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@jasperhyp
Copy link

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

As this discussion shows, there are use cases where we want specific loadings indexed by (row, col) pairs to be set to specific values. Unlike using .loc, indexing a group of columns and a group of rows of the same length would return only the values at corresponding positions.

Feature Description

This shouldn't be difficult...

Alternative Solutions

In numpy or pytorch or any numerical packages this is the default.

Additional Context

No response

@jasperhyp jasperhyp added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 6, 2022
@jreback
Copy link
Contributor

jreback commented Aug 6, 2022

pls look at prior discussions
this is not a very common or useful operation in pandas

@jasperhyp
Copy link
Author

jasperhyp commented Aug 7, 2022

pls look at prior discussions this is not a very common or useful operation in pandas

Hi Jeff, Thanks for the pointers. I checked the previous discussions and I think there are some people requesting this functionality of lookup (as shown in #40140) and the main reason for deprecation is more on the performance side. My feature request arises more out of the need to set values for specific loadings indexed by (row, col) pairs rather than just looking them up, which I agree can be easily done by the current factorize functionality. But setting values is a more delicate thing and would require mapping back and forth the columns & indices if doing manually by first transforming to NumPy then transform back. Having a Pandas-native functionality wrapping around this pipeline of operations would be extremely helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants