Last active
January 27, 2025 13:55
-
-
Save ledovsky/6f259ca52acd82fb4bc31e95024dbdbf to your computer and use it in GitHub Desktop.
Jupyter notebook - interactive search widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
I created this snippet to make it convinient to search | |
for column names in wide pandas dataframes (with 100+ columns) | |
""" | |
from ipywidgets import interact | |
def search_widget(texts: list[str]): | |
def f(x): | |
for text in texts: | |
if x.lower() in text.lower(): | |
print(text) | |
return interact(f, x="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment