Pandas data frame filter column names regex

PHOTO EMBED

Sat Oct 31 2020 00:38:58 GMT+0000 (Coordinated Universal Time)

Saved by @ianh #pandas #filter

# importing pandas as pd 
import pandas as pd 
  
# Creating the dataframe  
df = pd.read_csv("nba.csv") 
  
# Using regular expression to extract all 
# columns which has letter 'a' or 'A' in its name. 
df.filter(regex ='[aA]') 
content_copyCOPY

https://www.geeksforgeeks.org/python-pandas-dataframe-filter/