Skip to content

Instantly share code, notes, and snippets.

@ledovsky
Last active January 27, 2025 13:55
Show Gist options
  • Save ledovsky/6f259ca52acd82fb4bc31e95024dbdbf to your computer and use it in GitHub Desktop.
Save ledovsky/6f259ca52acd82fb4bc31e95024dbdbf to your computer and use it in GitHub Desktop.
Jupyter notebook - interactive search widget
"""
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