question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: regex for drop

See original GitHub issue

Don’t have time to implement this, but I wanted to float the idea and park it. It’s pretty trivial and you can achieve the same thing with filter, but it might be nice if drop had a regex keyword. E.g., these would be equivalent

df = df.filter(regex="^(?!var_start)")
df = df.drop(regex="^var_start", axis=1)

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
WillAydcommented, Mar 14, 2019

@tik0 you can use a regex to do that. Something like:

df.filter(regex=r'^(?!enc_)')

@jreback this is a pretty old issue but I think it’s duplicative of what’s available already in filter. Any reason to keep this one open?

1reaction
MarcoGorellicommented, Mar 21, 2021

closing as there hasn’t been any uptake here (and I agree with the assessment that df.filter(regex=r'^(?!enc_)') is simple enough), though please do ping if you have use-case where that isn’t practical

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regular expression search in developer console - chromium
Issue 418406: Feature request: Regular expression search in ... I miss the ability to search for (multi-line) regular expressions in the ...
Read more >
How do we drop partitions in hive with regex. Is it possible?
I am trying to run the following alter table historical_data drop partition (my_date not rlike '[A-Za ...
Read more >
[Feature Request] Allow use of regular expressions in search ...
[Feature Request] Allow use of regular expressions in search pattern ... use of regular expressions when searching text with the / command.
Read more >
Regex filter Variable drop down - Grafana Community
When selecting a variable using the drop down list at the top of a ... way to get regex search functionality, or is...
Read more >
Working with regex match conditions - AWS Documentation
You can add multiple regular expressions to a single pattern set. If you do so, those expressions are combined with an OR. That...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found