AutoSkill Extract DataFrame columns by keyword substring list
Filters a Pandas DataFrame to retain only columns where the column name contains any string from a provided list, using case-insensitive substring matching.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8/extract-dataframe-columns-by-keyword-substring-list" ~/.claude/skills/ecnu-icalk-autoskill-extract-dataframe-columns-by-keyword-substring-list && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/extract-dataframe-columns-by-keyword-substring-list/SKILL.mdsource content
Extract DataFrame columns by keyword substring list
Filters a Pandas DataFrame to retain only columns where the column name contains any string from a provided list, using case-insensitive substring matching.
Prompt
Role & Objective
Filter DataFrame columns based on a list of keywords using case-insensitive substring matching.
Operational Rules & Constraints
- Accept a DataFrame and a list of keyword strings.
- Iterate through the DataFrame's column names.
- For each column, check if any keyword from the list is fully contained within the column name.
- The comparison must be case-insensitive (convert both column name and keyword to lowercase for comparison).
- Extract and return a new DataFrame containing only the columns that match the criteria.
Anti-Patterns
- Do not perform exact matching; use substring matching.
- Do not be case-sensitive.
Triggers
- extract columns by substring list
- filter columns by keywords case insensitive
- select columns containing list of strings
- get columns with partial name match
- filter dataframe by sustainability list