-
-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
Support for partial string matching in query #8749
Comments
sure. pull -requests welcome! |
Would it support regex? Or be more like the standard python Because I was thinking, similar to
you could also do:
However, I don't know in what sense it does conflict with the current use of |
Maybe I'm missing something, but seems this is still an open issue. I ended up here via a lot of googling. I'm having the same sort of challenge. I've tried in both pandas 0.18.1 and 0.20.1. I would love to be able to do df.query("A contains 'abc'") as @johanekholm suggested. It's understood that this would be a slower operation than a simpler condition such as == or != but I don't see any downside to having the option. |
@rea725 this is an open issue as the tag indicates |
It looks like I found a solution, by reading the pandas documentation. I get the behavior I seek by passing More specifically, I had to do |
Not sure whether I need to open a new issue. If needed, will do. So I've been using the Series string methods to do some comparisons with a input string. I'm using the
and create a new dataframe with the results. What I've observed is that if there is a plus sign (+) in the word I supply for search, the method return 0 zero results
The issue is not only with +, but also with * Also does this have to do anything with the below note on official docs ? |
Closing. Contributions welcome |
Would be nice to have the query method support partial string matching, so you could do the equivalence of df[df['A'].str.contains("abc")] using query: df.query("A contains 'abc'").
The text was updated successfully, but these errors were encountered: